Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
feat: fork remix-validated-forms to fix a bug. creatable customer dropdown
Brad Barbine3da757cc0db
diff --git a/apps/carbon/app/components/Form/Array.tsx b/apps/carbon/app/components/Form/Array.tsxindex 2158371dce..5e13354e14 100644--- a/apps/carbon/app/components/Form/Array.tsx+++ b/apps/carbon/app/components/Form/Array.tsx@@ -9,9 +9,9 @@ import {Input as InputBase,VStack,} from "@carbon/react";+import { useField, useFieldArray } from "@carbon/remix-validated-form";import { forwardRef } from "react";import { IoMdAdd, IoMdClose } from "react-icons/io";-import { useField, useFieldArray } from "remix-validated-form";type FormArrayProps = InputProps & {name: string;diff --git a/apps/carbon/app/components/Form/Boolean.tsx b/apps/carbon/app/components/Form/Boolean.tsxindex 38e0fb6dc8..04e72a2cbb 100644--- a/apps/carbon/app/components/Form/Boolean.tsx+++ b/apps/carbon/app/components/Form/Boolean.tsx@@ -6,8 +6,8 @@ import {HStack,Switch,} from "@carbon/react";+import { useControlField, useField } from "@carbon/remix-validated-form";import { forwardRef } from "react";-import { useControlField, useField } from "remix-validated-form";type FormBooleanProps = {name: string;diff --git a/apps/carbon/app/components/Form/Color.tsx b/apps/carbon/app/components/Form/Color.tsxindex b1c8140a4d..d4ef55c911 100644--- a/apps/carbon/app/components/Form/Color.tsx+++ b/apps/carbon/app/components/Form/Color.tsx@@ -6,9 +6,9 @@ import {useDisclosure,useOutsideClick,} from "@carbon/react";+import { useControlField, useField } from "@carbon/remix-validated-form";import { useRef } from "react";import { HexColorInput, HexColorPicker } from "react-colorful";-import { useControlField, useField } from "remix-validated-form";type ColorFieldProps = {name: string;diff --git a/apps/carbon/app/components/Form/Combobox.tsx b/apps/carbon/app/components/Form/Combobox.tsxindex 4e686f95d7..2acc141afa 100644--- a/apps/carbon/app/components/Form/Combobox.tsx+++ b/apps/carbon/app/components/Form/Combobox.tsx@@ -5,7 +5,7 @@ import {FormLabel,} from "@carbon/react";-import { useControlField, useField } from "remix-validated-form";+import { useControlField, useField } from "@carbon/remix-validated-form";import { Combobox as ComboboxBase } from "~/components";import type { ComboboxProps as ComboboxBaseProps } from "~/components/Combobox";diff --git a/apps/carbon/app/components/Form/ComboboxControlled.tsx b/apps/carbon/app/components/Form/ComboboxControlled.tsxindex 7ae4ffddcc..884a9ce897 100644--- a/apps/carbon/app/components/Form/ComboboxControlled.tsx+++ b/apps/carbon/app/components/Form/ComboboxControlled.tsx@@ -6,7 +6,7 @@ import {} from "@carbon/react";import { useEffect } from "react";-import { useControlField, useField } from "remix-validated-form";+import { useControlField, useField } from "@carbon/remix-validated-form";import { Combobox as ComboboxBase } from "~/components";import type { ComboboxProps as ComboboxBaseProps } from "~/components/Combobox";diff --git a/apps/carbon/app/components/Form/CreatableCombobox.tsx b/apps/carbon/app/components/Form/CreatableCombobox.tsxindex c657d9cb6d..25c44b2825 100644--- a/apps/carbon/app/components/Form/CreatableCombobox.tsx+++ b/apps/carbon/app/components/Form/CreatableCombobox.tsx@@ -6,7 +6,7 @@ import {} from "@carbon/react";import { forwardRef } from "react";-import { useControlField, useField } from "remix-validated-form";+import { useControlField, useField } from "@carbon/remix-validated-form";import { CreatableCombobox as CreatableComboboxBase } from "~/components";import type { CreatableComboboxProps as CreatableComboboxBaseProps } from "~/components/CreateableCombobox";diff --git a/apps/carbon/app/components/Form/Customer.tsx b/apps/carbon/app/components/Form/Customer.tsxindex 85d1c965e0..99c4651a14 100644--- a/apps/carbon/app/components/Form/Customer.tsx+++ b/apps/carbon/app/components/Form/Customer.tsx@@ -1,24 +1,53 @@-import { useMemo } from "react";+import { useDisclosure } from "@carbon/react";+import { useMemo, useRef, useState } from "react";+import { CustomerForm } from "~/modules/sales";import { useCustomers } from "~/stores";import type { ComboboxProps } from "./Combobox";-import Combobox from "./Combobox";+import CreatableCombobox from "./CreatableCombobox";type CustomerSelectProps = Omit<ComboboxProps, "options">;const Customer = (props: CustomerSelectProps) => {- const [customers] = useCustomers();+ const [suppliers] = useCustomers();+ const newCustomersModal = useDisclosure();+ const [createdCustomer, setCreatedCustomer] = useState<string>("");+ const triggerRef = useRef<HTMLButtonElement>(null);const options = useMemo(() =>- customers.map((c) => ({+ suppliers.map((c) => ({value: c.id,label: c.name,})) ?? [],- [customers]+ [suppliers]);return (- <Combobox options={options} {...props} label={props?.label ?? "Customer"} />+ <>+ <CreatableCombobox+ ref={triggerRef}+ options={options}+ {...props}+ label={props?.label ?? "Customer"}+ onCreateOption={(option) => {+ newCustomersModal.onOpen();+ setCreatedCustomer(option);+ }}+ />+ {newCustomersModal.isOpen && (+ <CustomerForm+ type="modal"+ onClose={() => {+ setCreatedCustomer("");+ newCustomersModal.onClose();+ triggerRef.current?.click();+ }}+ initialValues={{+ name: createdCustomer,+ }}+ />+ )}+ </>);};diff --git a/apps/carbon/app/components/Form/DatePicker.tsx b/apps/carbon/app/components/Form/DatePicker.tsxindex 7921425787..8ef5c77ca1 100644--- a/apps/carbon/app/components/Form/DatePicker.tsx+++ b/apps/carbon/app/components/Form/DatePicker.tsx@@ -4,10 +4,10 @@ import {FormErrorMessage,FormLabel,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import type { CalendarDate } from "@internationalized/date";import { parseDate } from "@internationalized/date";import { useState } from "react";-import { useField } from "remix-validated-form";type DatePickerProps = { name: string; label?: string; isDisabled?: boolean };diff --git a/apps/carbon/app/components/Form/Employees.tsx b/apps/carbon/app/components/Form/Employees.tsxindex 510571b023..7eee54cba3 100644--- a/apps/carbon/app/components/Form/Employees.tsx+++ b/apps/carbon/app/components/Form/Employees.tsx@@ -4,8 +4,8 @@ import {FormHelperText,FormLabel,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import { useState } from "react";-import { useField } from "remix-validated-form";import { UserSelect } from "../Selectors";import type {IndividualOrGroup,diff --git a/apps/carbon/app/components/Form/Hidden.tsx b/apps/carbon/app/components/Form/Hidden.tsxindex 9aa032d8ac..a7e21bd6a4 100644--- a/apps/carbon/app/components/Form/Hidden.tsx+++ b/apps/carbon/app/components/Form/Hidden.tsx@@ -4,8 +4,8 @@ import {FormErrorMessage,Input as InputBase,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import { forwardRef } from "react";-import { useField } from "remix-validated-form";type HiddenProps = InputProps & {name: string;diff --git a/apps/carbon/app/components/Form/Input.tsx b/apps/carbon/app/components/Form/Input.tsxindex f249cca140..7b2011b8e9 100644--- a/apps/carbon/app/components/Form/Input.tsx+++ b/apps/carbon/app/components/Form/Input.tsx@@ -9,8 +9,8 @@ import {InputLeftAddon,InputRightAddon,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import { forwardRef } from "react";-import { useField } from "remix-validated-form";type FormInputProps = InputProps & {name: string;diff --git a/apps/carbon/app/components/Form/InputControlled.tsx b/apps/carbon/app/components/Form/InputControlled.tsxindex 8192a63eae..bd1f5401c1 100644--- a/apps/carbon/app/components/Form/InputControlled.tsx+++ b/apps/carbon/app/components/Form/InputControlled.tsx@@ -9,9 +9,9 @@ import {InputLeftAddon,InputRightAddon,} from "@carbon/react";+import { useControlField, useField } from "@carbon/remix-validated-form";import type { ChangeEvent } from "react";import { forwardRef, useEffect } from "react";-import { useControlField, useField } from "remix-validated-form";type FormInputControlledProps = Omit<InputProps, "value" | "onChange"> & {name: string;diff --git a/apps/carbon/app/components/Form/MultiSelect.tsx b/apps/carbon/app/components/Form/MultiSelect.tsxindex 0bf2423251..7aff4386c4 100644--- a/apps/carbon/app/components/Form/MultiSelect.tsx+++ b/apps/carbon/app/components/Form/MultiSelect.tsx@@ -5,7 +5,7 @@ import {FormLabel,} from "@carbon/react";-import { useControlField, useField } from "remix-validated-form";+import { useControlField, useField } from "@carbon/remix-validated-form";import { MultiSelect as MultiSelectBase } from "~/components";import type { MultiSelectProps as MultiSelectBaseProps } from "~/components/MultiSelect";diff --git a/apps/carbon/app/components/Form/Number.tsx b/apps/carbon/app/components/Form/Number.tsxindex 7fc562fe54..9073c4d795 100644--- a/apps/carbon/app/components/Form/Number.tsx+++ b/apps/carbon/app/components/Form/Number.tsx@@ -12,9 +12,9 @@ import {NumberInputStepper,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import { forwardRef } from "react";import { LuChevronDown, LuChevronUp } from "react-icons/lu";-import { useField } from "remix-validated-form";type FormNumberProps = NumberFieldProps & {name: string;diff --git a/apps/carbon/app/components/Form/NumberControlled.tsx b/apps/carbon/app/components/Form/NumberControlled.tsxindex d948869655..0cf9523c7b 100644--- a/apps/carbon/app/components/Form/NumberControlled.tsx+++ b/apps/carbon/app/components/Form/NumberControlled.tsx@@ -12,9 +12,9 @@ import {NumberInputStepper,} from "@carbon/react";+import { useControlField, useField } from "@carbon/remix-validated-form";import { forwardRef, useEffect } from "react";import { LuChevronDown, LuChevronUp } from "react-icons/lu";-import { useControlField, useField } from "remix-validated-form";type FormNumberProps = NumberFieldProps & {name: string;diff --git a/apps/carbon/app/components/Form/Password.tsx b/apps/carbon/app/components/Form/Password.tsxindex 44aaabf56d..f6817dd9d1 100644--- a/apps/carbon/app/components/Form/Password.tsx+++ b/apps/carbon/app/components/Form/Password.tsx@@ -8,9 +8,9 @@ import {InputGroup,InputRightElement,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import { forwardRef, useState } from "react";import { BiHide, BiShowAlt } from "react-icons/bi";-import { useField } from "remix-validated-form";type FormPasswordProps = InputProps & {name: string;diff --git a/apps/carbon/app/components/Form/PhoneInput.tsx b/apps/carbon/app/components/Form/PhoneInput.tsxindex 8246232d97..d1120957ab 100644--- a/apps/carbon/app/components/Form/PhoneInput.tsx+++ b/apps/carbon/app/components/Form/PhoneInput.tsx@@ -1,5 +1,3 @@-import * as ReactPhoneInput from "react-phone-number-input";-import flags from "react-phone-number-input/flags";import type { InputProps } from "@carbon/react";import {Button,@@ -18,14 +16,16 @@ import {PopoverTrigger,cn,} from "@carbon/react";-import { RxCaretSort, RxCheck } from "react-icons/rx";-import { useControlField, useField } from "remix-validated-form";+import { useControlField, useField } from "@carbon/remix-validated-form";import type {ElementRef,ForwardRefExoticComponent,InputHTMLAttributes,} from "react";import { forwardRef, useCallback } from "react";+import { RxCaretSort, RxCheck } from "react-icons/rx";+import * as ReactPhoneInput from "react-phone-number-input";+import flags from "react-phone-number-input/flags";const PhoneInputComponent = ReactPhoneInput.default;diff --git a/apps/carbon/app/components/Form/Radios.tsx b/apps/carbon/app/components/Form/Radios.tsxindex d48c5a262c..75a17eaf5a 100644--- a/apps/carbon/app/components/Form/Radios.tsx+++ b/apps/carbon/app/components/Form/Radios.tsx@@ -5,8 +5,8 @@ import {RadioGroup,RadioGroupItem,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import { useId } from "react";-import { useField } from "remix-validated-form";type RadiosProps = {name: string;diff --git a/apps/carbon/app/components/Form/RichText.tsx b/apps/carbon/app/components/Form/RichText.tsxindex 79b5cf1c5e..2a7da5b65a 100644--- a/apps/carbon/app/components/Form/RichText.tsx+++ b/apps/carbon/app/components/Form/RichText.tsx@@ -4,9 +4,9 @@ import {FormErrorMessage,useEditor,} from "@carbon/react";+import { useControlField, useField } from "@carbon/remix-validated-form";import type { ComponentProps } from "react";import { useEffect } from "react";-import { useControlField, useField } from "remix-validated-form";type RichTextProps = Omit<ComponentProps<typeof Editor>, "editor"> & {name: string;diff --git a/apps/carbon/app/components/Form/Select.tsx b/apps/carbon/app/components/Form/Select.tsxindex fed0c1ec3c..5b2c9368c0 100644--- a/apps/carbon/app/components/Form/Select.tsx+++ b/apps/carbon/app/components/Form/Select.tsx@@ -5,7 +5,7 @@ import {FormLabel,} from "@carbon/react";-import { useControlField, useField } from "remix-validated-form";+import { useControlField, useField } from "@carbon/remix-validated-form";import { Select as SelectBase } from "~/components";import type { SelectProps as SelectBaseProps } from "~/components/Select";diff --git a/apps/carbon/app/components/Form/SelectControlled.tsx b/apps/carbon/app/components/Form/SelectControlled.tsxindex 1fdba0e46d..dbfbcb4e4b 100644--- a/apps/carbon/app/components/Form/SelectControlled.tsx+++ b/apps/carbon/app/components/Form/SelectControlled.tsx@@ -6,7 +6,7 @@ import {} from "@carbon/react";import { useEffect } from "react";-import { useControlField, useField } from "remix-validated-form";+import { useControlField, useField } from "@carbon/remix-validated-form";import { Select as SelectBase } from "~/components";import type { SelectProps as SelectBaseProps } from "~/components/Select";diff --git a/apps/carbon/app/components/Form/Submit.tsx b/apps/carbon/app/components/Form/Submit.tsxindex b1b2f4cfe6..aa1e907e03 100644--- a/apps/carbon/app/components/Form/Submit.tsx+++ b/apps/carbon/app/components/Form/Submit.tsx@@ -1,20 +1,21 @@import type { ButtonProps } from "@carbon/react";import { Button } from "@carbon/react";+import { useIsSubmitting } from "@carbon/remix-validated-form";import { forwardRef } from "react";-import { useIsSubmitting } from "remix-validated-form";type SubmitProps = ButtonProps & { formId?: string; text?: string };export const Submit = forwardRef<HTMLButtonElement, SubmitProps>(- ({ formId, children, ...props }, ref) => {+ ({ formId, children, isDisabled, ...props }, ref) => {const isSubmitting = useIsSubmitting(formId);return (<Buttonref={ref}form={formId}type="submit"+ disabled={isDisabled || isSubmitting}isLoading={isSubmitting}- isDisabled={isSubmitting}+ isDisabled={isDisabled || isSubmitting}{...props}>{children}diff --git a/apps/carbon/app/components/Form/Textarea.tsx b/apps/carbon/app/components/Form/Textarea.tsxindex a69f8fcfbd..6928a6b729 100644--- a/apps/carbon/app/components/Form/Textarea.tsx+++ b/apps/carbon/app/components/Form/Textarea.tsx@@ -5,9 +5,9 @@ import {FormLabel,Textarea as TextAreaBase,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import type { ChangeEvent } from "react";import { forwardRef, useState } from "react";-import { useField } from "remix-validated-form";type FormTextArea = TextareaProps & {name: string;diff --git a/apps/carbon/app/components/Form/TimePicker.tsx b/apps/carbon/app/components/Form/TimePicker.tsxindex 9d69c3c0a2..dd8dfebd80 100644--- a/apps/carbon/app/components/Form/TimePicker.tsx+++ b/apps/carbon/app/components/Form/TimePicker.tsx@@ -4,6 +4,7 @@ import {FormLabel,TimePicker as TimePickerBase,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import type {CalendarDateTime,Time,@@ -11,7 +12,6 @@ import type {} from "@internationalized/date";import { parseTime } from "@internationalized/date";import { useState } from "react";-import { useField } from "remix-validated-form";type TimePickerProps = {name: string;diff --git a/apps/carbon/app/components/Form/Timezone.tsx b/apps/carbon/app/components/Form/Timezone.tsxindex 44151f6eba..8de7f777f3 100644--- a/apps/carbon/app/components/Form/Timezone.tsx+++ b/apps/carbon/app/components/Form/Timezone.tsx@@ -13,9 +13,9 @@ import {SelectTrigger,SelectValue,} from "@carbon/react";+import { useControlField, useField } from "@carbon/remix-validated-form";import { timezones } from "@carbon/utils";import { MdClose } from "react-icons/md";-import { useControlField, useField } from "remix-validated-form";import type { SelectProps } from "./Select";type TimezoneProps = Omit<SelectProps, "options"> & {diff --git a/apps/carbon/app/components/Form/User.tsx b/apps/carbon/app/components/Form/User.tsxindex 47bde38df0..791c95af4b 100644--- a/apps/carbon/app/components/Form/User.tsx+++ b/apps/carbon/app/components/Form/User.tsx@@ -4,8 +4,8 @@ import {FormHelperText,FormLabel,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import { useState } from "react";-import { useField } from "remix-validated-form";import { UserSelect } from "../Selectors";import type {IndividualOrGroup,diff --git a/apps/carbon/app/components/Form/Users.tsx b/apps/carbon/app/components/Form/Users.tsxindex 763ac37331..c8dd6ccc1e 100644--- a/apps/carbon/app/components/Form/Users.tsx+++ b/apps/carbon/app/components/Form/Users.tsx@@ -4,8 +4,8 @@ import {FormHelperText,FormLabel,} from "@carbon/react";+import { useField } from "@carbon/remix-validated-form";import { useState } from "react";-import { useField } from "remix-validated-form";import { UserSelect } from "../Selectors";import type {IndividualOrGroup,diff --git a/apps/carbon/app/modules/account/account.models.ts b/apps/carbon/app/modules/account/account.models.tsindex 788981b7ff..817a5b11ae 100644--- a/apps/carbon/app/modules/account/account.models.ts+++ b/apps/carbon/app/modules/account/account.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";diff --git a/apps/carbon/app/modules/account/ui/Password/PasswordForm.tsx b/apps/carbon/app/modules/account/ui/Password/PasswordForm.tsxindex c5eeb999ab..9ed6ba80a7 100644--- a/apps/carbon/app/modules/account/ui/Password/PasswordForm.tsx+++ b/apps/carbon/app/modules/account/ui/Password/PasswordForm.tsx@@ -1,6 +1,6 @@import { VStack } from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useRef, useState } from "react";-import { ValidatedForm } from "remix-validated-form";import { Password, Submit } from "~/components/Form";import { accountPasswordValidator } from "~/modules/account";import { path } from "~/utils/path";diff --git a/apps/carbon/app/modules/account/ui/Personal/PersonalDataForm.tsx b/apps/carbon/app/modules/account/ui/Personal/PersonalDataForm.tsxindex f4691b6168..a3bb37829a 100644--- a/apps/carbon/app/modules/account/ui/Personal/PersonalDataForm.tsx+++ b/apps/carbon/app/modules/account/ui/Personal/PersonalDataForm.tsx@@ -1,5 +1,5 @@import { VStack } from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Submit } from "~/components/Form";import type { PersonalData } from "~/modules/account";import { accountPersonalDataValidator } from "~/modules/account";diff --git a/apps/carbon/app/modules/account/ui/Profile/ProfileForm.tsx b/apps/carbon/app/modules/account/ui/Profile/ProfileForm.tsxindex c691fdf280..be21e21bb6 100644--- a/apps/carbon/app/modules/account/ui/Profile/ProfileForm.tsx+++ b/apps/carbon/app/modules/account/ui/Profile/ProfileForm.tsx@@ -6,8 +6,8 @@ import {CardTitle,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useParams } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit, TextArea } from "~/components/Form";import { accountProfileValidator } from "~/modules/account";import type { User } from "~/modules/users";diff --git a/apps/carbon/app/modules/account/ui/UserAttributes/UserAttributesForm.tsx b/apps/carbon/app/modules/account/ui/UserAttributes/UserAttributesForm.tsxindex 39de03b46f..189b642ea3 100644--- a/apps/carbon/app/modules/account/ui/UserAttributes/UserAttributesForm.tsx+++ b/apps/carbon/app/modules/account/ui/UserAttributes/UserAttributesForm.tsx@@ -1,8 +1,8 @@import { Button, HStack, Switch, VStack, useDisclosure } from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { parseDate } from "@internationalized/date";import { useFetcher, useParams } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Boolean as BooleanInput,DatePicker,diff --git a/apps/carbon/app/modules/accounting/accounting.models.ts b/apps/carbon/app/modules/accounting/accounting.models.tsindex ce8451d27b..042ea1b96a 100644--- a/apps/carbon/app/modules/accounting/accounting.models.ts+++ b/apps/carbon/app/modules/accounting/accounting.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";import { months } from "~/modules/shared";diff --git a/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountCategoryForm.tsx b/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountCategoryForm.tsxindex 964762200f..90aca671c3 100644--- a/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountCategoryForm.tsx+++ b/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountCategoryForm.tsx@@ -9,7 +9,7 @@ import {HStack,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Hidden, Input, Select, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import {diff --git a/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountSubcategoryForm.tsx b/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountSubcategoryForm.tsxindex 87d7902456..fb34fb11d3 100644--- a/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountSubcategoryForm.tsx+++ b/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountSubcategoryForm.tsx@@ -12,8 +12,8 @@ import {Input as InputBase,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useParams } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit } from "~/components/Form";import { usePermissions, useRouteData } from "~/hooks";import type { AccountCategory } from "~/modules/accounting";diff --git a/apps/carbon/app/modules/accounting/ui/AccountDefaults/AccountDefaultsForm.tsx b/apps/carbon/app/modules/accounting/ui/AccountDefaults/AccountDefaultsForm.tsxindex 3cb723f37b..2d477bb28a 100644--- a/apps/carbon/app/modules/accounting/ui/AccountDefaults/AccountDefaultsForm.tsx+++ b/apps/carbon/app/modules/accounting/ui/AccountDefaults/AccountDefaultsForm.tsx@@ -11,8 +11,8 @@ import {TabsTrigger,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Select, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import type { AccountListItem } from "~/modules/accounting";diff --git a/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountForm.tsx b/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountForm.tsxindex e8b08e3e04..944aa420f6 100644--- a/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountForm.tsx+++ b/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountForm.tsx@@ -13,7 +13,7 @@ import {import { useNavigate } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import {AccountCategory,AccountSubcategory,diff --git a/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTableFilters.tsx b/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTableFilters.tsxindex 900956beff..58f5618977 100644--- a/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTableFilters.tsx+++ b/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTableFilters.tsx@@ -39,7 +39,7 @@ const ChartOfAccountsTableFilters = () => {/><Popover><PopoverTrigger asChild>- <Button variant="solid" leftIcon={<MdCalendarMonth />}>+ <Button variant="secondary" leftIcon={<MdCalendarMonth />}>Date Range</Button></PopoverTrigger>diff --git a/apps/carbon/app/modules/accounting/ui/Currencies/CurrencyForm.tsx b/apps/carbon/app/modules/accounting/ui/Currencies/CurrencyForm.tsxindex 9c4a2e7362..a2ce410236 100644--- a/apps/carbon/app/modules/accounting/ui/Currencies/CurrencyForm.tsx+++ b/apps/carbon/app/modules/accounting/ui/Currencies/CurrencyForm.tsx@@ -9,9 +9,9 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import { Boolean, Hidden, Input, Number, Submit } from "~/components/Form";import { usePermissions, useRouteData } from "~/hooks";import type { Currency } from "~/modules/accounting";diff --git a/apps/carbon/app/modules/accounting/ui/FiscalYear/FiscalYearSettingsForm.tsx b/apps/carbon/app/modules/accounting/ui/FiscalYear/FiscalYearSettingsForm.tsxindex de0e9ba55c..c0dd916855 100644--- a/apps/carbon/app/modules/accounting/ui/FiscalYear/FiscalYearSettingsForm.tsx+++ b/apps/carbon/app/modules/accounting/ui/FiscalYear/FiscalYearSettingsForm.tsx@@ -1,5 +1,5 @@import { VStack } from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Select, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { fiscalYearSettingsValidator } from "~/modules/accounting";diff --git a/apps/carbon/app/modules/accounting/ui/PaymentTerms/PaymentTermForm.tsx b/apps/carbon/app/modules/accounting/ui/PaymentTerms/PaymentTermForm.tsxindex 13b67f3ad1..6582d757f8 100644--- a/apps/carbon/app/modules/accounting/ui/PaymentTerms/PaymentTermForm.tsx+++ b/apps/carbon/app/modules/accounting/ui/PaymentTerms/PaymentTermForm.tsx@@ -9,9 +9,9 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Number, Select, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import type { PaymentTermCalculationMethod } from "~/modules/accounting";diff --git a/apps/carbon/app/modules/documents/documents.models.ts b/apps/carbon/app/modules/documents/documents.models.tsindex 3acf31b8a1..c5f3db3a89 100644--- a/apps/carbon/app/modules/documents/documents.models.ts+++ b/apps/carbon/app/modules/documents/documents.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";export const documentValidator = withZod(diff --git a/apps/carbon/app/modules/documents/ui/Documents/DocumentForm.tsx b/apps/carbon/app/modules/documents/ui/Documents/DocumentForm.tsxindex 906b109d0a..9d028abbfe 100644--- a/apps/carbon/app/modules/documents/ui/Documents/DocumentForm.tsx+++ b/apps/carbon/app/modules/documents/ui/Documents/DocumentForm.tsx@@ -9,8 +9,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit, TextArea, Users } from "~/components/Form";import { usePermissions } from "~/hooks";import { documentValidator } from "~/modules/documents";diff --git a/apps/carbon/app/modules/inventory/inventory.models.ts b/apps/carbon/app/modules/inventory/inventory.models.tsindex d49d73bb58..b0d3fedea5 100644--- a/apps/carbon/app/modules/inventory/inventory.models.ts+++ b/apps/carbon/app/modules/inventory/inventory.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";diff --git a/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/ReceiptForm.tsx b/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/ReceiptForm.tsxindex 6cf616ff47..74280615af 100644--- a/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/ReceiptForm.tsx+++ b/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/ReceiptForm.tsx@@ -12,8 +12,8 @@ import {MenubarItem,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Outlet } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import {ComboboxControlled,Hidden,diff --git a/apps/carbon/app/modules/inventory/ui/ShippingMethods/ShippingMethodForm.tsx b/apps/carbon/app/modules/inventory/ui/ShippingMethods/ShippingMethodForm.tsxindex ae4c5efd5a..21e3d810b8 100644--- a/apps/carbon/app/modules/inventory/ui/ShippingMethods/ShippingMethodForm.tsx+++ b/apps/carbon/app/modules/inventory/ui/ShippingMethods/ShippingMethodForm.tsx@@ -10,8 +10,8 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Account, Hidden, Input, Select, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { shippingMethodValidator } from "~/modules/inventory";diff --git a/apps/carbon/app/modules/invoicing/invoicing.models.ts b/apps/carbon/app/modules/invoicing/invoicing.models.tsindex 7e04a600a6..1367b033bf 100644--- a/apps/carbon/app/modules/invoicing/invoicing.models.ts+++ b/apps/carbon/app/modules/invoicing/invoicing.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm.tsxindex c86ac9c412..aca67d48bd 100644--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm.tsx+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm.tsx@@ -8,8 +8,8 @@ import {VStack,cn,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Currency,DatePicker,diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsxindex e04167c0c4..98a3d4c755 100644--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx@@ -19,10 +19,10 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useFetcher, useNavigate, useParams } from "@remix-run/react";import { useEffect, useMemo, useState } from "react";import { LuChevronDown, LuChevronUp } from "react-icons/lu";-import { ValidatedForm } from "remix-validated-form";import {Account,ComboboxControlled,diff --git a/apps/carbon/app/modules/parts/parts.models.ts b/apps/carbon/app/modules/parts/parts.models.tsindex ed9b231874..24dc6f071f 100644--- a/apps/carbon/app/modules/parts/parts.models.ts+++ b/apps/carbon/app/modules/parts/parts.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";diff --git a/apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsxindex 3f17c2e2c9..dc07524079 100644--- a/apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsx+++ b/apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsx@@ -6,7 +6,7 @@ import {CardTitle,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Boolean, Hidden, Number, Select, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { partCostValidator, partCostingMethods } from "~/modules/parts";diff --git a/apps/carbon/app/modules/parts/ui/Part/PartForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartForm.tsxindex 089e01a825..863db4821f 100644--- a/apps/carbon/app/modules/parts/ui/Part/PartForm.tsx+++ b/apps/carbon/app/modules/parts/ui/Part/PartForm.tsx@@ -10,9 +10,9 @@ import {VStack,cn,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useFetcher } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Boolean,Combobox,diff --git a/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsxindex b3ee8ad923..24ef5d457f 100644--- a/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsx+++ b/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsx@@ -8,8 +8,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useRevalidator } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Combobox } from "~/components";import { CreatableCombobox, Hidden, Number, Submit } from "~/components/Form";import { usePermissions, useUser } from "~/hooks";diff --git a/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsxindex ea96ce212f..b0d7ae9d39 100644--- a/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsx+++ b/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsx@@ -6,7 +6,7 @@ import {CardTitle,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Boolean, Hidden, Number, Select, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import {diff --git a/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsxindex aab95d1b89..236cd7a3b3 100644--- a/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsx+++ b/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsx@@ -8,7 +8,7 @@ import {HStack,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Combobox } from "~/components";import {Boolean,diff --git a/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsxindex 2fac0d59a0..16febd154e 100644--- a/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsx+++ b/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsx@@ -6,7 +6,7 @@ import {CardTitle,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import {Boolean,Combobox,diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsxindex 07019e9728..b6c384cc07 100644--- a/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsx+++ b/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsx@@ -6,8 +6,8 @@ import {CardTitle,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Boolean,Combobox,diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSidebar/usePartSidebar.tsx b/apps/carbon/app/modules/parts/ui/Part/PartSidebar/usePartSidebar.tsxindex 33ad1fb34d..a57d37c585 100644--- a/apps/carbon/app/modules/parts/ui/Part/PartSidebar/usePartSidebar.tsx+++ b/apps/carbon/app/modules/parts/ui/Part/PartSidebar/usePartSidebar.tsx@@ -14,6 +14,7 @@ export function usePartSidebar(replenishment: PartReplenishmentSystem) {name: "Details",to: "",icon: BsBank,+ shortcut: "Command+Shift+d",},{name: "Purchasing",@@ -21,6 +22,7 @@ export function usePartSidebar(replenishment: PartReplenishmentSystem) {isDisabled: replenishment === "Make",role: ["employee", "supplier"],icon: BsCartDash,+ shortcut: "Command+Shift+p",},{name: "Suppliers",@@ -28,6 +30,7 @@ export function usePartSidebar(replenishment: PartReplenishmentSystem) {isDisabled: replenishment === "Make",role: ["employee", "supplier"],icon: PiShareNetworkFill,+ shortcut: "Command+Shift+s",},{name: "Manufacturing",@@ -35,30 +38,35 @@ export function usePartSidebar(replenishment: PartReplenishmentSystem) {isDisabled: replenishment === "Buy",role: ["employee"],icon: BiListCheck,+ shortcut: "Command+Shift+m",},{name: "Costing",to: "costing",role: ["employee", "supplier"],icon: IoPricetagsOutline,+ shortcut: "Command+Shift+c",},{name: "Planning",to: "planning",role: ["employee"],icon: BsBarChartLineFill,+ shortcut: "Command+Shift+p",},{name: "Inventory",to: "inventory",role: ["employee", "supplier"],icon: HiOutlineCube,+ shortcut: "Command+Shift+i",},{name: "Sale Price",to: "sale-price",role: ["employee", "customer"],icon: PiMoneyFill,+ shortcut: "Command+Shift+x",},].filter((item) =>diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSupplierForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartSupplierForm.tsxindex ed27e6a707..c2e2b47473 100644--- a/apps/carbon/app/modules/parts/ui/Part/PartSupplierForm.tsx+++ b/apps/carbon/app/modules/parts/ui/Part/PartSupplierForm.tsx@@ -9,9 +9,9 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate, useParams } from "@remix-run/react";import { useMemo } from "react";-import { ValidatedForm } from "remix-validated-form";import {Combobox,Hidden,diff --git a/apps/carbon/app/modules/parts/ui/PartGroups/PartGroupForm.tsx b/apps/carbon/app/modules/parts/ui/PartGroups/PartGroupForm.tsxindex 58562c7a2e..54e1a8f6f5 100644--- a/apps/carbon/app/modules/parts/ui/PartGroups/PartGroupForm.tsx+++ b/apps/carbon/app/modules/parts/ui/PartGroups/PartGroupForm.tsx@@ -9,8 +9,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit, TextArea } from "~/components/Form";import { usePermissions } from "~/hooks";import { partGroupValidator } from "~/modules/parts";diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsx b/apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsxindex da20bf349a..ba45c268ec 100644--- a/apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsx+++ b/apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsx@@ -8,8 +8,8 @@ import {VStack,cn,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Boolean,Combobox,diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceSupplierForm.tsx b/apps/carbon/app/modules/parts/ui/Service/ServiceSupplierForm.tsxindex ed09d00b64..4a40a76564 100644--- a/apps/carbon/app/modules/parts/ui/Service/ServiceSupplierForm.tsx+++ b/apps/carbon/app/modules/parts/ui/Service/ServiceSupplierForm.tsx@@ -9,8 +9,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate, useParams } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit, Supplier } from "~/components/Form";import { usePermissions } from "~/hooks";import { serviceSupplierValidator } from "~/modules/parts";diff --git a/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsx b/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsxindex f0f7cb6cfd..0da04ac936 100644--- a/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsx+++ b/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsx@@ -10,8 +10,8 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { unitOfMeasureValidator } from "~/modules/parts";diff --git a/apps/carbon/app/modules/purchasing/purchasing.models.ts b/apps/carbon/app/modules/purchasing/purchasing.models.tsindex 60ee0edc9b..4a5957b303 100644--- a/apps/carbon/app/modules/purchasing/purchasing.models.ts+++ b/apps/carbon/app/modules/purchasing/purchasing.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";import { address, contact } from "~/types/validators";diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm.tsxindex 771cad4938..571c7a0b38 100644--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm.tsx@@ -6,8 +6,8 @@ import {CardTitle,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Boolean,Customer,diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm.tsxindex 14a475d156..d630314149 100644--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm.tsx@@ -8,8 +8,8 @@ import {VStack,cn,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {DatePicker,Hidden,diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsxindex cca976d3de..13adad0628 100644--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx@@ -10,9 +10,9 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useFetcher, useNavigate, useParams } from "@remix-run/react";import { useEffect, useMemo, useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Account,ComboboxControlled,diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm.tsxindex 59ae5382ba..3c4c8bb65d 100644--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm.tsx@@ -6,8 +6,8 @@ import {CardTitle,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Boolean,Currency,diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderReleaseModal.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderReleaseModal.tsxindex a48a7bfc10..8368a465c2 100644--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderReleaseModal.tsx+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderReleaseModal.tsx@@ -9,9 +9,9 @@ import {ModalTitle,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useParams } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import { SelectControlled, SupplierContact } from "~/components/Form";import { useIntegrations } from "~/hooks/useIntegrations";import { path } from "~/utils/path";diff --git a/apps/carbon/app/modules/purchasing/ui/RequestForQuote/RequestForQuoteForm.tsx b/apps/carbon/app/modules/purchasing/ui/RequestForQuote/RequestForQuoteForm.tsxindex b24162696d..3d10065ed5 100644--- a/apps/carbon/app/modules/purchasing/ui/RequestForQuote/RequestForQuoteForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/RequestForQuote/RequestForQuoteForm.tsx@@ -8,7 +8,7 @@ import {VStack,cn,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import {DatePicker,Hidden,diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsxindex 11efc6a439..b5ad13c714 100644--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsx@@ -9,8 +9,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate, useParams } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import {DatePicker,Hidden,diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm.tsxindex e74818566e..960a412b7e 100644--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm.tsx@@ -11,8 +11,8 @@ import {VStack,cn,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useFetcher } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Employee, Hidden, Input, Select, Submit } from "~/components/Form";import { usePermissions, useRouteData } from "~/hooks";import type { SupplierStatus, SupplierType } from "~/modules/purchasing";diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocationForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocationForm.tsxindex b87bd4d9b9..457ffa5aef 100644--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocationForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocationForm.tsx@@ -10,8 +10,8 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate, useParams } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { supplierLocationValidator } from "~/modules/purchasing";diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm.tsxindex 92f58b3714..2e153eb942 100644--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm.tsx@@ -7,8 +7,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Currency,Hidden,diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm.tsxindex 86568bb773..95325caa81 100644--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm.tsx@@ -7,8 +7,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Hidden,Select,diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierSidebar/useSupplierSidebar.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierSidebar/useSupplierSidebar.tsxindex 8899c15c45..d11e74b276 100644--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierSidebar/useSupplierSidebar.tsx+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierSidebar/useSupplierSidebar.tsx@@ -17,9 +17,10 @@ export function useSupplierSidebar({ contacts, locations }: Props) {const permissions = usePermissions();return [{- name: "Overview",+ name: "Details",to: "",icon: BsBank,+ shortcut: "Command+Shift+d",},{name: "Contacts",@@ -27,6 +28,7 @@ export function useSupplierSidebar({ contacts, locations }: Props) {role: ["employee"],count: contacts,icon: BsFillPersonLinesFill,+ shortcut: "Command+Shift+c",},{name: "Locations",@@ -34,18 +36,21 @@ export function useSupplierSidebar({ contacts, locations }: Props) {role: ["employee", "supplier"],count: locations,icon: BsFillPinMapFill,+ shortcut: "Command+Shift+l",},{name: "Payments",to: "payments",role: ["employee"],icon: BsCreditCard,+ shortcut: "Command+Shift+p",},{name: "Shipping",to: "shipping",role: ["employee"],icon: BsTruck,+ shortcut: "Command+Shift+s",},].filter((item) =>diff --git a/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypeForm.tsx b/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypeForm.tsxindex 5cf004a280..0ab84e6258 100644--- a/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypeForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypeForm.tsx@@ -9,8 +9,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Color, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { supplierTypeValidator } from "~/modules/purchasing";diff --git a/apps/carbon/app/modules/resources/resources.models.ts b/apps/carbon/app/modules/resources/resources.models.tsindex c127df9bbe..547fbd3223 100644--- a/apps/carbon/app/modules/resources/resources.models.ts+++ b/apps/carbon/app/modules/resources/resources.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";import { DataType } from "~/modules/users";diff --git a/apps/carbon/app/modules/resources/ui/Abilities/AbilityForm.tsx b/apps/carbon/app/modules/resources/ui/Abilities/AbilityForm.tsxindex 0a24ab9528..a9af3fafae 100644--- a/apps/carbon/app/modules/resources/ui/Abilities/AbilityForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Abilities/AbilityForm.tsx@@ -10,9 +10,9 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Employees,Hidden,diff --git a/apps/carbon/app/modules/resources/ui/Abilities/EmployeeAbilityForm.tsx b/apps/carbon/app/modules/resources/ui/Abilities/EmployeeAbilityForm.tsxindex 6af1065df4..3b245a3ed1 100644--- a/apps/carbon/app/modules/resources/ui/Abilities/EmployeeAbilityForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Abilities/EmployeeAbilityForm.tsx@@ -10,9 +10,9 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useParams } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import { Employee, Hidden, Number, Select, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import type { Ability } from "~/modules/resources";diff --git a/apps/carbon/app/modules/resources/ui/Attributes/AttributeCategoryForm.tsx b/apps/carbon/app/modules/resources/ui/Attributes/AttributeCategoryForm.tsxindex ab371f5492..72fda82327 100644--- a/apps/carbon/app/modules/resources/ui/Attributes/AttributeCategoryForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Attributes/AttributeCategoryForm.tsx@@ -9,7 +9,7 @@ import {HStack,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Boolean, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { attributeCategoryValidator } from "~/modules/resources";diff --git a/apps/carbon/app/modules/resources/ui/Attributes/AttributeForm.tsx b/apps/carbon/app/modules/resources/ui/Attributes/AttributeForm.tsxindex 18798853f6..a3f325e463 100644--- a/apps/carbon/app/modules/resources/ui/Attributes/AttributeForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Attributes/AttributeForm.tsx@@ -10,8 +10,8 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Array,Boolean,diff --git a/apps/carbon/app/modules/resources/ui/Contractors/ContractorForm.tsx b/apps/carbon/app/modules/resources/ui/Contractors/ContractorForm.tsxindex 86666a650b..dd6e88081e 100644--- a/apps/carbon/app/modules/resources/ui/Contractors/ContractorForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Contractors/ContractorForm.tsx@@ -11,9 +11,9 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useLocation, useNavigate } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Abilities,Number,diff --git a/apps/carbon/app/modules/resources/ui/Departments/DepartmentForm.tsx b/apps/carbon/app/modules/resources/ui/Departments/DepartmentForm.tsxindex 745ae8d8f0..2d63c9f01c 100644--- a/apps/carbon/app/modules/resources/ui/Departments/DepartmentForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Departments/DepartmentForm.tsx@@ -10,8 +10,8 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Color, Department, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { departmentValidator } from "~/modules/resources";diff --git a/apps/carbon/app/modules/resources/ui/Equipment/EquipmentForm.tsx b/apps/carbon/app/modules/resources/ui/Equipment/EquipmentForm.tsxindex 7e2a40294b..5fcfd1ec2d 100644--- a/apps/carbon/app/modules/resources/ui/Equipment/EquipmentForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Equipment/EquipmentForm.tsx@@ -12,9 +12,13 @@ import {HStack,VStack,} from "@carbon/react";+import {+ ValidatedForm,+ useControlField,+ useField,+} from "@carbon/remix-validated-form";import { useFetcher } from "@remix-run/react";import { useEffect, useMemo, useState } from "react";-import { ValidatedForm, useControlField, useField } from "remix-validated-form";import {Hidden,Input,diff --git a/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypeForm.tsx b/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypeForm.tsxindex d5781e9b15..f3d7a13477 100644--- a/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypeForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypeForm.tsx@@ -9,7 +9,7 @@ import {HStack,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import {Ability,Color,diff --git a/apps/carbon/app/modules/resources/ui/Holidays/HolidayForm.tsx b/apps/carbon/app/modules/resources/ui/Holidays/HolidayForm.tsxindex 5fc26de9a5..c419fa87e9 100644--- a/apps/carbon/app/modules/resources/ui/Holidays/HolidayForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Holidays/HolidayForm.tsx@@ -9,8 +9,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { DatePicker, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { holidayValidator } from "~/modules/resources";diff --git a/apps/carbon/app/modules/resources/ui/Locations/LocationForm.tsx b/apps/carbon/app/modules/resources/ui/Locations/LocationForm.tsxindex cbf097d5ef..8817adc63b 100644--- a/apps/carbon/app/modules/resources/ui/Locations/LocationForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Locations/LocationForm.tsx@@ -9,8 +9,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit, Timezone } from "~/components/Form";import { usePermissions } from "~/hooks";import { locationValidator } from "~/modules/resources";diff --git a/apps/carbon/app/modules/resources/ui/Partners/PartnerForm.tsx b/apps/carbon/app/modules/resources/ui/Partners/PartnerForm.tsxindex a0c526deca..8caa59e0a9 100644--- a/apps/carbon/app/modules/resources/ui/Partners/PartnerForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Partners/PartnerForm.tsx@@ -13,9 +13,9 @@ import {VStack,useMount,} from "@carbon/react";+import { ValidatedForm, useControlField } from "@carbon/remix-validated-form";import { useFetcher, useNavigate } from "@remix-run/react";import { useEffect, useMemo } from "react";-import { ValidatedForm, useControlField } from "remix-validated-form";import {Ability,ComboboxControlled,diff --git a/apps/carbon/app/modules/resources/ui/Person/PersonJob.tsx b/apps/carbon/app/modules/resources/ui/Person/PersonJob.tsxindex c0bdb1dc05..5a5e2e581b 100644--- a/apps/carbon/app/modules/resources/ui/Person/PersonJob.tsx+++ b/apps/carbon/app/modules/resources/ui/Person/PersonJob.tsx@@ -6,8 +6,8 @@ import {CardTitle,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {DatePicker,Employee,diff --git a/apps/carbon/app/modules/resources/ui/Shifts/ShiftForm.tsx b/apps/carbon/app/modules/resources/ui/Shifts/ShiftForm.tsxindex 1b352763b0..ee68554cc7 100644--- a/apps/carbon/app/modules/resources/ui/Shifts/ShiftForm.tsx+++ b/apps/carbon/app/modules/resources/ui/Shifts/ShiftForm.tsx@@ -11,8 +11,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import {Boolean,Hidden,diff --git a/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellForm.tsx b/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellForm.tsxindex e688737c14..2920e086b8 100644--- a/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellForm.tsx+++ b/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellForm.tsx@@ -10,7 +10,7 @@ import {VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import {DatePicker,Department,diff --git a/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypeForm.tsx b/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypeForm.tsxindex ba16ec1111..66f335c60d 100644--- a/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypeForm.tsx+++ b/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypeForm.tsx@@ -9,7 +9,7 @@ import {HStack,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import {Ability,Color,diff --git a/apps/carbon/app/modules/sales/sales.models.ts b/apps/carbon/app/modules/sales/sales.models.tsindex 997b89472c..c36f90c34b 100644--- a/apps/carbon/app/modules/sales/sales.models.ts+++ b/apps/carbon/app/modules/sales/sales.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";import { address, contact } from "~/types/validators";diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsxindex dfd97509f1..058505b50c 100644--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsx@@ -9,8 +9,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate, useParams } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import {DatePicker,Hidden,diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsxindex fc5444f6b9..295f542c68 100644--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx@@ -1,15 +1,18 @@import {- Card,- CardContent,- CardDescription,- CardFooter,- CardHeader,- CardTitle,HStack,+ ModalCard,+ ModalCardBody,+ ModalCardContent,+ ModalCardDescription,+ ModalCardFooter,+ ModalCardHeader,+ ModalCardProvider,+ ModalCardTitle,VStack,cn,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";+import { useFetcher } from "@remix-run/react";import {Combobox,Employee,@@ -26,10 +29,17 @@ import { path } from "~/utils/path";type CustomerFormProps = {initialValues: TypeOfValidator<typeof customerValidator>;+ type?: "card" | "modal";+ onClose?: () => void;};-const CustomerForm = ({ initialValues }: CustomerFormProps) => {+const CustomerForm = ({+ initialValues,+ type = "card",+ onClose,+}: CustomerFormProps) => {const permissions = usePermissions();+ const fetcher = useFetcher();const routeData = useRouteData<{customerTypes: CustomerType[];@@ -54,65 +64,81 @@ const CustomerForm = ({ initialValues }: CustomerFormProps) => {: !permissions.can("create", "sales");return (- <ValidatedForm- method="post"- validator={customerValidator}- defaultValues={initialValues}- >- <Card>- <CardHeader>- <CardTitle>- {isEditing ? "Customer Overview" : "New Customer"}- </CardTitle>- {!isEditing && (- <CardDescription>- A customer is a business or person who buys your parts or- services.- </CardDescription>- )}- </CardHeader>- <CardContent>- <Hidden name="id" />- <div- className={cn(- "grid w-full gap-x-8 gap-y-2",- isEditing ? "grid-cols-1 lg:grid-cols-3" : "grid-cols-1"- )}+ <ModalCardProvider type={type}>+ <ModalCard onClose={onClose}>+ <ModalCardContent>+ <ValidatedForm+ method="post"+ action={+ isEditing+ ? undefined+ : type === "card"+ ? path.to.newCustomer+ : path.to.api.newCustomer+ }+ validator={customerValidator}+ defaultValues={initialValues}+ onSubmit={onClose}+ fetcher={fetcher}>- <VStack>- <Input autoFocus={!isEditing} name="name" label="Name" />- <Input name="taxId" label="Tax ID" />- </VStack>- <VStack>- <Combobox- name="customerTypeId"- label="Customer Type"- options={customerTypeOptions}- placeholder="Select Customer Type"- />- <Select- name="customerStatusId"- label="Customer Status"- options={customerStatusOptions}- placeholder="Select Customer Status"- />- </VStack>- {isEditing && (- <>+ <ModalCardHeader>+ <ModalCardTitle>+ {isEditing ? "Customer Overview" : "New Customer"}+ </ModalCardTitle>+ {!isEditing && (+ <ModalCardDescription>+ A customer is a business or person who buys your parts or+ services.+ </ModalCardDescription>+ )}+ </ModalCardHeader>+ <ModalCardBody>+ <Hidden name="id" />+ <div+ className={cn(+ "grid w-full gap-x-8 gap-y-2",+ isEditing ? "grid-cols-1 lg:grid-cols-3" : "grid-cols-1"+ )}+ ><VStack>- <Employee name="accountManagerId" label="Account Manager" />+ <Input name="name" label="Name" />+ <Input name="taxId" label="Tax ID" /></VStack>- </>- )}- </div>- </CardContent>- <CardFooter>- <HStack>- <Submit isDisabled={isDisabled}>Save</Submit>- </HStack>- </CardFooter>- </Card>- </ValidatedForm>+ <VStack>+ <Combobox+ name="customerTypeId"+ label="Customer Type"+ options={customerTypeOptions}+ placeholder="Select Customer Type"+ />+ <Select+ name="customerStatusId"+ label="Customer Status"+ options={customerStatusOptions}+ placeholder="Select Customer Status"+ />+ </VStack>+ {isEditing && (+ <>+ <VStack>+ <Employee+ name="accountManagerId"+ label="Account Manager"+ />+ </VStack>+ </>+ )}+ </div>+ </ModalCardBody>+ <ModalCardFooter>+ <HStack>+ <Submit isDisabled={isDisabled}>Save</Submit>+ </HStack>+ </ModalCardFooter>+ </ValidatedForm>+ </ModalCardContent>+ </ModalCard>+ </ModalCardProvider>);};diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerLocationForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerLocationForm.tsxindex 5682bc6ac6..da02626dfb 100644--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerLocationForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerLocationForm.tsx@@ -10,8 +10,8 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate, useParams } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { customerLocationValidator } from "~/modules/sales";diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm.tsxindex 61974a2408..66c6b990ff 100644--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm.tsx@@ -7,8 +7,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Currency,Customer,diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm.tsxindex d23ff91d7c..8938523d0d 100644--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm.tsx@@ -7,8 +7,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Customer,CustomerContact,diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerSidebar/useCustomerSidebar.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerSidebar/useCustomerSidebar.tsxindex e3eb705d8f..dd19bb801b 100644--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerSidebar/useCustomerSidebar.tsx+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerSidebar/useCustomerSidebar.tsx@@ -17,9 +17,10 @@ export function useCustomerSidebar({ contacts, locations }: Props) {const permissions = usePermissions();return [{- name: "Overview",+ name: "Details",to: "",icon: BsBank,+ shortcut: "Command+Shift+d",},{name: "Contacts",@@ -27,6 +28,7 @@ export function useCustomerSidebar({ contacts, locations }: Props) {role: ["employee"],count: contacts,icon: BsFillPersonLinesFill,+ shortcut: "Command+Shift+c",},{name: "Locations",@@ -34,18 +36,21 @@ export function useCustomerSidebar({ contacts, locations }: Props) {role: ["employee", "customer"],count: locations,icon: BsFillPinMapFill,+ shortcut: "Command+Shift+l",},{name: "Payments",to: "payments",role: ["employee"],icon: BsCreditCard,+ shortcut: "Command+Shift+p",},{name: "Shipping",to: "shipping",role: ["employee"],icon: BsTruck,+ shortcut: "Command+Shift+s",},].filter((item) =>diff --git a/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypeForm.tsx b/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypeForm.tsxindex 172ab60c6b..efcbae4a2d 100644--- a/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypeForm.tsx+++ b/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypeForm.tsx@@ -9,8 +9,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Color, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { customerTypeValidator } from "~/modules/sales";diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationAssemblyForm.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationAssemblyForm.tsxindex 0376b65a23..208879d7f8 100644--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationAssemblyForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationAssemblyForm.tsx@@ -15,11 +15,11 @@ import {IconButton,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate, useParams } from "@remix-run/react";import { useState } from "react";import { BsDownload, BsThreeDotsVertical, BsUpload } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";-import { ValidatedForm } from "remix-validated-form";import {Hidden,InputControlled,diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationForm.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationForm.tsxindex 6d405a1a30..a939f4b98b 100644--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationForm.tsx@@ -8,8 +8,8 @@ import {VStack,cn,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Customer,CustomerContact,diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationLineForm.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationLineForm.tsxindex bd17c208fb..1fc34044ab 100644--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationLineForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationLineForm.tsx@@ -17,11 +17,11 @@ import {cn,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate, useParams } from "@remix-run/react";import { useState } from "react";import { BsDownload, BsThreeDotsVertical, BsUpload } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";-import { ValidatedForm } from "remix-validated-form";import {Hidden,Input,diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationMaterialForm.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationMaterialForm.tsxindex dc36c5e613..2e34289fb8 100644--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationMaterialForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationMaterialForm.tsx@@ -10,9 +10,9 @@ import {VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate, useParams } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import {Hidden,InputControlled,diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationOperationForm.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationOperationForm.tsxindex 204c1a953d..133eee01f6 100644--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationOperationForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationOperationForm.tsx@@ -15,11 +15,11 @@ import {IconButton,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate, useParams } from "@remix-run/react";import { useState } from "react";import { BsThreeDotsVertical } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";-import { ValidatedForm } from "remix-validated-form";import {EquipmentType,Hidden,diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationReleaseModal.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationReleaseModal.tsxindex efd552864f..eeca3c21b3 100644--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationReleaseModal.tsx+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationReleaseModal.tsx@@ -9,9 +9,9 @@ import {ModalTitle,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useParams } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import { CustomerContact, SelectControlled } from "~/components/Form";import { useIntegrations } from "~/hooks/useIntegrations";import { path } from "~/utils/path";diff --git a/apps/carbon/app/modules/settings/integrations.models.ts b/apps/carbon/app/modules/settings/integrations.models.tsindex a1e988b2ab..8ae2107964 100644--- a/apps/carbon/app/modules/settings/integrations.models.ts+++ b/apps/carbon/app/modules/settings/integrations.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";diff --git a/apps/carbon/app/modules/settings/settings.models.ts b/apps/carbon/app/modules/settings/settings.models.tsindex cfd084c580..aff90904de 100644--- a/apps/carbon/app/modules/settings/settings.models.ts+++ b/apps/carbon/app/modules/settings/settings.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";diff --git a/apps/carbon/app/modules/settings/ui/Company/CompanyForm.tsx b/apps/carbon/app/modules/settings/ui/Company/CompanyForm.tsxindex cd25fb28c4..3c1393d4c8 100644--- a/apps/carbon/app/modules/settings/ui/Company/CompanyForm.tsx+++ b/apps/carbon/app/modules/settings/ui/Company/CompanyForm.tsx@@ -7,7 +7,7 @@ import {CardTitle,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Hidden, Input, Submit } from "~/components/Form";import { companyValidator } from "~/modules/settings";import type { TypeOfValidator } from "~/types/validators";diff --git a/apps/carbon/app/modules/settings/ui/Integrations/ExchangeRatesForm.tsx b/apps/carbon/app/modules/settings/ui/Integrations/ExchangeRatesForm.tsxindex d032bed218..6d56583421 100644--- a/apps/carbon/app/modules/settings/ui/Integrations/ExchangeRatesForm.tsx+++ b/apps/carbon/app/modules/settings/ui/Integrations/ExchangeRatesForm.tsx@@ -10,7 +10,7 @@ import {HStack,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Boolean, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { exchangeRatesFormValidator } from "~/modules/settings";diff --git a/apps/carbon/app/modules/settings/ui/Integrations/GooglePlacesForm.tsx b/apps/carbon/app/modules/settings/ui/Integrations/GooglePlacesForm.tsxindex d0403b38ce..6ad04d717e 100644--- a/apps/carbon/app/modules/settings/ui/Integrations/GooglePlacesForm.tsx+++ b/apps/carbon/app/modules/settings/ui/Integrations/GooglePlacesForm.tsx@@ -10,7 +10,7 @@ import {HStack,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Boolean, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { resendFormValidator } from "~/modules/settings";diff --git a/apps/carbon/app/modules/settings/ui/Integrations/ResendForm.tsx b/apps/carbon/app/modules/settings/ui/Integrations/ResendForm.tsxindex df060d30e6..c716c52506 100644--- a/apps/carbon/app/modules/settings/ui/Integrations/ResendForm.tsx+++ b/apps/carbon/app/modules/settings/ui/Integrations/ResendForm.tsx@@ -10,7 +10,7 @@ import {HStack,VStack,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Boolean, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { resendFormValidator } from "~/modules/settings";diff --git a/apps/carbon/app/modules/settings/ui/Sequences/SequenceForm.tsx b/apps/carbon/app/modules/settings/ui/Sequences/SequenceForm.tsxindex 9b2a3817af..9ef6dc9761 100644--- a/apps/carbon/app/modules/settings/ui/Sequences/SequenceForm.tsx+++ b/apps/carbon/app/modules/settings/ui/Sequences/SequenceForm.tsx@@ -10,9 +10,9 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Number, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import { sequenceValidator } from "~/modules/settings";diff --git a/apps/carbon/app/modules/settings/ui/Theme/ThemeForm.tsx b/apps/carbon/app/modules/settings/ui/Theme/ThemeForm.tsxindex 20b070f37f..07fd67e91f 100644--- a/apps/carbon/app/modules/settings/ui/Theme/ThemeForm.tsx+++ b/apps/carbon/app/modules/settings/ui/Theme/ThemeForm.tsx@@ -9,11 +9,11 @@ import {VStack,cn,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import type { Theme } from "@carbon/utils";import { themes } from "@carbon/utils";import { useEffect, useState } from "react";import { RxCheck } from "react-icons/rx";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Submit } from "~/components/Form";import { useMode } from "~/hooks/useMode";import type { Theme as ThemeValue } from "~/modules/settings";diff --git a/apps/carbon/app/modules/shared/shared.models.ts b/apps/carbon/app/modules/shared/shared.models.tsindex 7381534fd6..03776379f9 100644--- a/apps/carbon/app/modules/shared/shared.models.ts+++ b/apps/carbon/app/modules/shared/shared.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";diff --git a/apps/carbon/app/modules/shared/ui/Notes/Notes.tsx b/apps/carbon/app/modules/shared/ui/Notes/Notes.tsxindex 40ca233f7c..c6037d2eae 100644--- a/apps/carbon/app/modules/shared/ui/Notes/Notes.tsx+++ b/apps/carbon/app/modules/shared/ui/Notes/Notes.tsx@@ -1,8 +1,8 @@import { Button, HStack, HTML, VStack } from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { formatTimeAgo } from "@carbon/utils";import { Form } from "@remix-run/react";import { Fragment } from "react";-import { ValidatedForm } from "remix-validated-form";import { Avatar } from "~/components";import { Hidden, RichText, Submit } from "~/components/Form";import { usePermissions, useUser } from "~/hooks";diff --git a/apps/carbon/app/modules/users/ui/Customers/CreateCustomerModal.tsx b/apps/carbon/app/modules/users/ui/Customers/CreateCustomerModal.tsxindex 066cb7e110..fe846d224e 100644--- a/apps/carbon/app/modules/users/ui/Customers/CreateCustomerModal.tsx+++ b/apps/carbon/app/modules/users/ui/Customers/CreateCustomerModal.tsx@@ -13,9 +13,13 @@ import {ModalTitle,VStack,} from "@carbon/react";+import {+ ValidatedForm,+ useControlField,+ useField,+} from "@carbon/remix-validated-form";import { useFetcher, useNavigate } from "@remix-run/react";import { useEffect, useMemo, useRef, useState } from "react";-import { ValidatedForm, useControlField, useField } from "remix-validated-form";import { Combobox } from "~/components";import { Customer, Submit } from "~/components/Form";import { useUrlParams } from "~/hooks";diff --git a/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypeForm.tsx b/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypeForm.tsxindex f089fa1248..6d41a89f98 100644--- a/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypeForm.tsx+++ b/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypeForm.tsx@@ -9,9 +9,9 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import { Color, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";import type { Permission } from "~/modules/users";diff --git a/apps/carbon/app/modules/users/ui/Employees/BulkEditPermissionsForm.tsx b/apps/carbon/app/modules/users/ui/Employees/BulkEditPermissionsForm.tsxindex 0cdec830e5..95c7fefa30 100644--- a/apps/carbon/app/modules/users/ui/Employees/BulkEditPermissionsForm.tsx+++ b/apps/carbon/app/modules/users/ui/Employees/BulkEditPermissionsForm.tsx@@ -10,9 +10,9 @@ import {VStack,useMount,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useFetcher } from "@remix-run/react";import { useEffect, useState } from "react";-import { ValidatedForm } from "remix-validated-form";import { Employees, Hidden, Radios, Submit } from "~/components/Form";import type { Permission } from "~/modules/users";import { bulkPermissionsValidator } from "~/modules/users";diff --git a/apps/carbon/app/modules/users/ui/Employees/CreateEmployeeModal.tsx b/apps/carbon/app/modules/users/ui/Employees/CreateEmployeeModal.tsxindex 44927e6f4c..c27d34de2f 100644--- a/apps/carbon/app/modules/users/ui/Employees/CreateEmployeeModal.tsx+++ b/apps/carbon/app/modules/users/ui/Employees/CreateEmployeeModal.tsx@@ -10,8 +10,8 @@ import {VStack,useMount,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useFetcher, useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Input, Select, Submit } from "~/components/Form";import type { getEmployeeTypes } from "~/modules/users";import { createEmployeeValidator } from "~/modules/users";diff --git a/apps/carbon/app/modules/users/ui/Employees/EmployeePermissionsForm.tsx b/apps/carbon/app/modules/users/ui/Employees/EmployeePermissionsForm.tsxindex 50a54cd9a4..e4a379f23c 100644--- a/apps/carbon/app/modules/users/ui/Employees/EmployeePermissionsForm.tsx+++ b/apps/carbon/app/modules/users/ui/Employees/EmployeePermissionsForm.tsx@@ -9,9 +9,9 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";import { useState } from "react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Select, Submit } from "~/components/Form";import type { Permission } from "~/modules/users";import { employeeValidator } from "~/modules/users";diff --git a/apps/carbon/app/modules/users/ui/Groups/GroupsForm.tsx b/apps/carbon/app/modules/users/ui/Groups/GroupsForm.tsxindex a56470dfb5..3f8c923fe7 100644--- a/apps/carbon/app/modules/users/ui/Groups/GroupsForm.tsx+++ b/apps/carbon/app/modules/users/ui/Groups/GroupsForm.tsx@@ -9,8 +9,8 @@ import {HStack,VStack,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useNavigate } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit, Users } from "~/components/Form";import { usePermissions } from "~/hooks";import { groupValidator } from "~/modules/users";diff --git a/apps/carbon/app/modules/users/ui/Suppliers/CreateSupplierModal/CreateSupplierModal.tsx b/apps/carbon/app/modules/users/ui/Suppliers/CreateSupplierModal/CreateSupplierModal.tsxindex 8891d15ab2..dfb94d1d1b 100644--- a/apps/carbon/app/modules/users/ui/Suppliers/CreateSupplierModal/CreateSupplierModal.tsx+++ b/apps/carbon/app/modules/users/ui/Suppliers/CreateSupplierModal/CreateSupplierModal.tsx@@ -12,9 +12,13 @@ import {ModalTitle,VStack,} from "@carbon/react";+import {+ ValidatedForm,+ useControlField,+ useField,+} from "@carbon/remix-validated-form";import { useFetcher, useNavigate } from "@remix-run/react";import { useEffect, useMemo, useRef, useState } from "react";-import { ValidatedForm, useControlField, useField } from "remix-validated-form";import { Combobox } from "~/components";import { Submit, Supplier } from "~/components/Form";import { useUrlParams } from "~/hooks";diff --git a/apps/carbon/app/modules/users/ui/components/DeactivateUsersModal.tsx b/apps/carbon/app/modules/users/ui/components/DeactivateUsersModal.tsxindex bcea6df4ad..4cae6ac6f1 100644--- a/apps/carbon/app/modules/users/ui/components/DeactivateUsersModal.tsx+++ b/apps/carbon/app/modules/users/ui/components/DeactivateUsersModal.tsx@@ -8,7 +8,7 @@ import {ModalHeader,ModalTitle,} from "@carbon/react";-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { UserSelect } from "~/components/Selectors";import { deactivateUsersValidator } from "~/modules/users";import { path } from "~/utils/path";diff --git a/apps/carbon/app/modules/users/ui/components/ResendInviteModal.tsx b/apps/carbon/app/modules/users/ui/components/ResendInviteModal.tsxindex bb642e917b..e6a2e541ab 100644--- a/apps/carbon/app/modules/users/ui/components/ResendInviteModal.tsx+++ b/apps/carbon/app/modules/users/ui/components/ResendInviteModal.tsx@@ -8,8 +8,8 @@ import {ModalHeader,ModalTitle,} from "@carbon/react";+import { ValidatedForm } from "@carbon/remix-validated-form";import { useFetcher } from "@remix-run/react";-import { ValidatedForm } from "remix-validated-form";import { UserSelect } from "~/components/Selectors";import { resendInviteValidator } from "~/modules/users";import { path } from "~/utils/path";diff --git a/apps/carbon/app/modules/users/users.models.ts b/apps/carbon/app/modules/users/users.models.tsindex e2d7936ba6..dd16a65e20 100644--- a/apps/carbon/app/modules/users/users.models.ts+++ b/apps/carbon/app/modules/users/users.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";diff --git a/apps/carbon/app/root.tsx b/apps/carbon/app/root.tsxindex 2da8c371ab..24ca33702b 100644--- a/apps/carbon/app/root.tsx+++ b/apps/carbon/app/root.tsx@@ -1,5 +1,6 @@// root.tsximport { Heading } from "@carbon/react";+import { withZod } from "@carbon/remix-validated-form";import type {ActionFunctionArgs,LoaderFunctionArgs,@@ -17,7 +18,6 @@ import {useLoaderData,useRouteError,} from "@remix-run/react";-import { withZod } from "@remix-validated-form/with-zod";import { Analytics } from "@vercel/analytics/react";import React from "react";import { getBrowserEnv } from "~/config/env";diff --git a/apps/carbon/app/routes/_public+/forgot-password.tsx b/apps/carbon/app/routes/_public+/forgot-password.tsxindex 659e21a0d5..8cc2b889d7 100644--- a/apps/carbon/app/routes/_public+/forgot-password.tsx+++ b/apps/carbon/app/routes/_public+/forgot-password.tsx@@ -13,7 +13,7 @@ import type {import { json, redirect } from "@remix-run/node";import { Link, useActionData } from "@remix-run/react";import { LuAlertCircle, LuCheckCircle } from "react-icons/lu";-import { ValidatedForm, validationError } from "remix-validated-form";+import { ValidatedForm, validationError } from "@carbon/remix-validated-form";import { Input, Submit } from "~/components/Form";import { getUserByEmail } from "~/modules/users/users.server";diff --git a/apps/carbon/app/routes/_public+/login.tsx b/apps/carbon/app/routes/_public+/login.tsxindex 314812096e..8670b131d5 100644--- a/apps/carbon/app/routes/_public+/login.tsx+++ b/apps/carbon/app/routes/_public+/login.tsx@@ -7,7 +7,7 @@ import type {import { json, redirect } from "@remix-run/node";import { Link, useActionData, useSearchParams } from "@remix-run/react";import { LuAlertCircle } from "react-icons/lu";-import { ValidatedForm, validationError } from "remix-validated-form";+import { ValidatedForm, validationError } from "@carbon/remix-validated-form";import { Hidden, Input, Password, Submit } from "~/components/Form";import {diff --git a/apps/carbon/app/routes/_public+/reset-password.tsx b/apps/carbon/app/routes/_public+/reset-password.tsxindex 1702442f22..696416907a 100644--- a/apps/carbon/app/routes/_public+/reset-password.tsx+++ b/apps/carbon/app/routes/_public+/reset-password.tsx@@ -3,7 +3,7 @@ import { Button, HStack, VStack } from "@carbon/react";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useNavigate } from "@remix-run/react";-import { ValidatedForm, validationError } from "remix-validated-form";+import { ValidatedForm, validationError } from "@carbon/remix-validated-form";import { Password, Submit } from "~/components/Form";import { resetPassword } from "~/modules/users/users.server";import { resetPasswordValidator } from "~/services/auth";diff --git a/apps/carbon/app/routes/api+/parts.new.ts b/apps/carbon/app/routes/api+/parts.new.tsindex 5e507fca8e..5ac7868c89 100644--- a/apps/carbon/app/routes/api+/parts.new.ts+++ b/apps/carbon/app/routes/api+/parts.new.ts@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { partValidator, upsertPart } from "~/modules/parts";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/api+/purchasing.suppliers.new.tsx b/apps/carbon/app/routes/api+/purchasing.suppliers.new.tsxindex b1eed3a857..a12e488bec 100644--- a/apps/carbon/app/routes/api+/purchasing.suppliers.new.tsx+++ b/apps/carbon/app/routes/api+/purchasing.suppliers.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { insertSupplier, supplierValidator } from "~/modules/purchasing";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/api+/sales.customers.new.ts b/apps/carbon/app/routes/api+/sales.customers.new.tsindex b1d5567cc7..2dca5ab433 100644--- a/apps/carbon/app/routes/api+/sales.customers.new.ts+++ b/apps/carbon/app/routes/api+/sales.customers.new.ts@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { customerValidator, insertCustomer } from "~/modules/sales";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/onboarding+/company.tsx b/apps/carbon/app/routes/onboarding+/company.tsxindex 83cae41c8a..b3b2a8bcd3 100644--- a/apps/carbon/app/routes/onboarding+/company.tsx+++ b/apps/carbon/app/routes/onboarding+/company.tsx@@ -12,7 +12,7 @@ import {import { getLocalTimeZone } from "@internationalized/date";import { json, redirect, type ActionFunctionArgs } from "@remix-run/node";import { Link, useLoaderData } from "@remix-run/react";-import { ValidatedForm, validationError } from "remix-validated-form";+import { ValidatedForm, validationError } from "@carbon/remix-validated-form";import { Hidden, Input, Submit } from "~/components/Form";import { useOnboarding } from "~/hooks";import {diff --git a/apps/carbon/app/routes/onboarding+/theme.tsx b/apps/carbon/app/routes/onboarding+/theme.tsxindex 8512677412..8fd4ccdbe5 100644--- a/apps/carbon/app/routes/onboarding+/theme.tsx+++ b/apps/carbon/app/routes/onboarding+/theme.tsx@@ -16,7 +16,7 @@ import { json, redirect } from "@remix-run/node";import { Link, useLoaderData } from "@remix-run/react";import { useEffect, useState } from "react";import { RxCheck } from "react-icons/rx";-import { ValidatedForm, validationError } from "remix-validated-form";+import { ValidatedForm, validationError } from "@carbon/remix-validated-form";import { Hidden, Submit } from "~/components/Form";import { useOnboarding } from "~/hooks";import { useMode } from "~/hooks/useMode";diff --git a/apps/carbon/app/routes/onboarding+/user.tsx b/apps/carbon/app/routes/onboarding+/user.tsxindex c05aa7d472..2a389457f4 100644--- a/apps/carbon/app/routes/onboarding+/user.tsx+++ b/apps/carbon/app/routes/onboarding+/user.tsx@@ -10,7 +10,7 @@ import {} from "@carbon/react";import { redirect, type ActionFunctionArgs } from "@remix-run/node";import { Link, useLoaderData } from "@remix-run/react";-import { ValidatedForm, validationError } from "remix-validated-form";+import { ValidatedForm, validationError } from "@carbon/remix-validated-form";import { Hidden, Input, Password, Submit } from "~/components/Form";import { useOnboarding } from "~/hooks";import { getSupabaseServiceRole } from "~/lib/supabase";diff --git a/apps/carbon/app/routes/x+/account+/$userId.attribute.tsx b/apps/carbon/app/routes/x+/account+/$userId.attribute.tsxindex 0087be8d00..1e0b1e48a2 100644--- a/apps/carbon/app/routes/x+/account+/$userId.attribute.tsx+++ b/apps/carbon/app/routes/x+/account+/$userId.attribute.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {attributeBooleanValidator,attributeNumericValidator,diff --git a/apps/carbon/app/routes/x+/account+/password.tsx b/apps/carbon/app/routes/x+/account+/password.tsxindex c97b5d6344..f814e426fd 100644--- a/apps/carbon/app/routes/x+/account+/password.tsx+++ b/apps/carbon/app/routes/x+/account+/password.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { PageTitle } from "~/components/Layout";import { getSupabaseServiceRole } from "~/lib/supabase";import { PasswordForm, accountPasswordValidator } from "~/modules/account";diff --git a/apps/carbon/app/routes/x+/account+/profile.tsx b/apps/carbon/app/routes/x+/account+/profile.tsxindex 5dc0afb7fe..926cd9fd09 100644--- a/apps/carbon/app/routes/x+/account+/profile.tsx+++ b/apps/carbon/app/routes/x+/account+/profile.tsx@@ -8,7 +8,7 @@ import {import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { PageTitle } from "~/components/Layout";import {ProfileForm,diff --git a/apps/carbon/app/routes/x+/accounting+/categories.$categoryId.tsx b/apps/carbon/app/routes/x+/accounting+/categories.$categoryId.tsxindex dbea7605c5..4e19c755b2 100644--- a/apps/carbon/app/routes/x+/accounting+/categories.$categoryId.tsx+++ b/apps/carbon/app/routes/x+/accounting+/categories.$categoryId.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData, useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";import {AccountCategoryForm,accountCategoryValidator,diff --git a/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.new.tsx b/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.new.tsxindex 89e29d8244..3c58d88c74 100644--- a/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.new.tsx+++ b/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.new.tsx@@ -5,9 +5,9 @@ import {upsertAccountSubcategory,} from "~/modules/accounting";+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";import { assertIsPost } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/accounting+/categories.new.tsx b/apps/carbon/app/routes/x+/accounting+/categories.new.tsxindex 985025a21f..4911c27a1a 100644--- a/apps/carbon/app/routes/x+/accounting+/categories.new.tsx+++ b/apps/carbon/app/routes/x+/accounting+/categories.new.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";import type { AccountClass, AccountIncomeBalance } from "~/modules/accounting";import {AccountCategoryForm,diff --git a/apps/carbon/app/routes/x+/accounting+/charts.$accountId.tsx b/apps/carbon/app/routes/x+/accounting+/charts.$accountId.tsxindex 4ea2b7707b..e28329ecb4 100644--- a/apps/carbon/app/routes/x+/accounting+/charts.$accountId.tsx+++ b/apps/carbon/app/routes/x+/accounting+/charts.$accountId.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import {accountValidator,diff --git a/apps/carbon/app/routes/x+/accounting+/charts.new.tsx b/apps/carbon/app/routes/x+/accounting+/charts.new.tsxindex 373aff205e..d5c17c10c7 100644--- a/apps/carbon/app/routes/x+/accounting+/charts.new.tsx+++ b/apps/carbon/app/routes/x+/accounting+/charts.new.tsx@@ -1,6 +1,6 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";import type {AccountClass,AccountConsolidatedRate,diff --git a/apps/carbon/app/routes/x+/accounting+/currencies.$currencyId.tsx b/apps/carbon/app/routes/x+/accounting+/currencies.$currencyId.tsxindex 34770ed3bf..80e022d864 100644--- a/apps/carbon/app/routes/x+/accounting+/currencies.$currencyId.tsx+++ b/apps/carbon/app/routes/x+/accounting+/currencies.$currencyId.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import {CurrencyForm,diff --git a/apps/carbon/app/routes/x+/accounting+/currencies.new.tsx b/apps/carbon/app/routes/x+/accounting+/currencies.new.tsxindex e237647107..9daa75b56a 100644--- a/apps/carbon/app/routes/x+/accounting+/currencies.new.tsx+++ b/apps/carbon/app/routes/x+/accounting+/currencies.new.tsx@@ -1,6 +1,6 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";import {CurrencyForm,currencyValidator,diff --git a/apps/carbon/app/routes/x+/accounting+/defaults.tsx b/apps/carbon/app/routes/x+/accounting+/defaults.tsxindex 24e3864950..48e654f612 100644--- a/apps/carbon/app/routes/x+/accounting+/defaults.tsx+++ b/apps/carbon/app/routes/x+/accounting+/defaults.tsx@@ -1,8 +1,8 @@import { VStack } from "@carbon/react";+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { PageTitle } from "~/components/Layout";import { useRouteData } from "~/hooks";import type { AccountListItem } from "~/modules/accounting";diff --git a/apps/carbon/app/routes/x+/accounting+/payment-terms.$paymentTermId.tsx b/apps/carbon/app/routes/x+/accounting+/payment-terms.$paymentTermId.tsxindex 18909b1da6..cab7c67625 100644--- a/apps/carbon/app/routes/x+/accounting+/payment-terms.$paymentTermId.tsx+++ b/apps/carbon/app/routes/x+/accounting+/payment-terms.$paymentTermId.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import type { PaymentTermCalculationMethod } from "~/modules/accounting";import {PaymentTermForm,diff --git a/apps/carbon/app/routes/x+/accounting+/payment-terms.new.tsx b/apps/carbon/app/routes/x+/accounting+/payment-terms.new.tsxindex 64ac4eb422..3295be57aa 100644--- a/apps/carbon/app/routes/x+/accounting+/payment-terms.new.tsx+++ b/apps/carbon/app/routes/x+/accounting+/payment-terms.new.tsx@@ -1,6 +1,6 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";import type { PaymentTermCalculationMethod } from "~/modules/accounting";import {PaymentTermForm,diff --git a/apps/carbon/app/routes/x+/accounting+/subcategory.$subcategoryId.tsx b/apps/carbon/app/routes/x+/accounting+/subcategory.$subcategoryId.tsxindex d52099e557..d635a71ff4 100644--- a/apps/carbon/app/routes/x+/accounting+/subcategory.$subcategoryId.tsx+++ b/apps/carbon/app/routes/x+/accounting+/subcategory.$subcategoryId.tsx@@ -1,6 +1,6 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";import {accountSubcategoryValidator,upsertAccountSubcategory,diff --git a/apps/carbon/app/routes/x+/accounting+/years.tsx b/apps/carbon/app/routes/x+/accounting+/years.tsxindex 61893e109c..b98c368b56 100644--- a/apps/carbon/app/routes/x+/accounting+/years.tsx+++ b/apps/carbon/app/routes/x+/accounting+/years.tsx@@ -1,8 +1,8 @@import { VStack } from "@carbon/react";+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { PageTitle } from "~/components/Layout";import {FiscalYearSettingsForm,diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.$customerContactId.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.$customerContactId.tsxindex d711b84d6f..0bb1e94c2e 100644--- a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.$customerContactId.tsx+++ b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.$customerContactId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {CustomerContactForm,customerContactValidator,diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.new.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.new.tsxindex 7f8eabe428..92fa383864 100644--- a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.new.tsx+++ b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { getSupabaseServiceRole } from "~/lib/supabase";import {CustomerContactForm,diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.index.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.index.tsxindex 5f5f25c91b..c4a9bb9ae8 100644--- a/apps/carbon/app/routes/x+/customer+/$customerId.index.tsx+++ b/apps/carbon/app/routes/x+/customer+/$customerId.index.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { useRouteData } from "~/hooks";import type { CustomerDetail } from "~/modules/sales";import {diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.locations.$customerLocationId.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.locations.$customerLocationId.tsxindex 34653ffed6..0046f731ca 100644--- a/apps/carbon/app/routes/x+/customer+/$customerId.locations.$customerLocationId.tsx+++ b/apps/carbon/app/routes/x+/customer+/$customerId.locations.$customerLocationId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {CustomerLocationForm,customerLocationValidator,diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.locations.new.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.locations.new.tsxindex ce8a34219b..a38b1a3ebb 100644--- a/apps/carbon/app/routes/x+/customer+/$customerId.locations.new.tsx+++ b/apps/carbon/app/routes/x+/customer+/$customerId.locations.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {CustomerLocationForm,customerLocationValidator,diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.payments.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.payments.tsxindex fe1f8c06a5..4911023e81 100644--- a/apps/carbon/app/routes/x+/customer+/$customerId.payments.tsx+++ b/apps/carbon/app/routes/x+/customer+/$customerId.payments.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {CustomerPaymentForm,customerPaymentValidator,diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.shipping.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.shipping.tsxindex bd82a30c90..5aea6f2865 100644--- a/apps/carbon/app/routes/x+/customer+/$customerId.shipping.tsx+++ b/apps/carbon/app/routes/x+/customer+/$customerId.shipping.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {CustomerShippingForm,customerShippingValidator,diff --git a/apps/carbon/app/routes/x+/customer+/new.tsx b/apps/carbon/app/routes/x+/customer+/new.tsxindex df4729f06b..98674b5077 100644--- a/apps/carbon/app/routes/x+/customer+/new.tsx+++ b/apps/carbon/app/routes/x+/customer+/new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {CustomerForm,customerValidator,diff --git a/apps/carbon/app/routes/x+/documents+/$documentId.labels.tsx b/apps/carbon/app/routes/x+/documents+/$documentId.labels.tsxindex ec274d0410..025a08648a 100644--- a/apps/carbon/app/routes/x+/documents+/$documentId.labels.tsx+++ b/apps/carbon/app/routes/x+/documents+/$documentId.labels.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {documentLabelsValidator,updateDocumentLabels,diff --git a/apps/carbon/app/routes/x+/documents+/favorite.tsx b/apps/carbon/app/routes/x+/documents+/favorite.tsxindex 18dffaa3bc..831f2753f7 100644--- a/apps/carbon/app/routes/x+/documents+/favorite.tsx+++ b/apps/carbon/app/routes/x+/documents+/favorite.tsx@@ -1,6 +1,5 @@+import { validationError, withZod } from "@carbon/remix-validated-form";import { json, type ActionFunctionArgs } from "@remix-run/node";-import { withZod } from "@remix-validated-form/with-zod";-import { validationError } from "remix-validated-form";import { updateDocumentFavorite } from "~/modules/documents";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/documents+/search.$documentId.tsx b/apps/carbon/app/routes/x+/documents+/search.$documentId.tsxindex 9fe01785a8..5a86182958 100644--- a/apps/carbon/app/routes/x+/documents+/search.$documentId.tsx+++ b/apps/carbon/app/routes/x+/documents+/search.$documentId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {DocumentForm,documentValidator,diff --git a/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.tsx b/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.tsxindex 3605b52436..d401ff2286 100644--- a/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.tsx+++ b/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {ReceiptForm,getReceipt,diff --git a/apps/carbon/app/routes/x+/inventory+/shipping-methods.$shippingMethodId.tsx b/apps/carbon/app/routes/x+/inventory+/shipping-methods.$shippingMethodId.tsxindex 5c4b67c88a..c2f3a57ca3 100644--- a/apps/carbon/app/routes/x+/inventory+/shipping-methods.$shippingMethodId.tsx+++ b/apps/carbon/app/routes/x+/inventory+/shipping-methods.$shippingMethodId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import type { ShippingCarrier } from "~/modules/inventory";import {ShippingMethodForm,diff --git a/apps/carbon/app/routes/x+/inventory+/shipping-methods.new.tsx b/apps/carbon/app/routes/x+/inventory+/shipping-methods.new.tsxindex 52c308dc25..cb81498a17 100644--- a/apps/carbon/app/routes/x+/inventory+/shipping-methods.new.tsx+++ b/apps/carbon/app/routes/x+/inventory+/shipping-methods.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import type { ShippingCarrier } from "~/modules/inventory";import {ShippingMethodForm,diff --git a/apps/carbon/app/routes/x+/part+/$partId.costing.tsx b/apps/carbon/app/routes/x+/part+/$partId.costing.tsxindex 4314329f58..58ef90ba9f 100644--- a/apps/carbon/app/routes/x+/part+/$partId.costing.tsx+++ b/apps/carbon/app/routes/x+/part+/$partId.costing.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { getAccountsList } from "~/modules/accounting";import {PartCostingForm,diff --git a/apps/carbon/app/routes/x+/part+/$partId.index.tsx b/apps/carbon/app/routes/x+/part+/$partId.index.tsxindex 0e79a6038c..88866e7347 100644--- a/apps/carbon/app/routes/x+/part+/$partId.index.tsx+++ b/apps/carbon/app/routes/x+/part+/$partId.index.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { useRouteData } from "~/hooks";import type { PartSummary } from "~/modules/parts";import { PartForm, partValidator, upsertPart } from "~/modules/parts";diff --git a/apps/carbon/app/routes/x+/part+/$partId.inventory.tsx b/apps/carbon/app/routes/x+/part+/$partId.inventory.tsxindex 345868a59c..f3b029ef49 100644--- a/apps/carbon/app/routes/x+/part+/$partId.inventory.tsx+++ b/apps/carbon/app/routes/x+/part+/$partId.inventory.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { useRouteData } from "~/hooks";import {PartInventoryForm,diff --git a/apps/carbon/app/routes/x+/part+/$partId.manufacturing.tsx b/apps/carbon/app/routes/x+/part+/$partId.manufacturing.tsxindex 47721f5f5d..4497cb614c 100644--- a/apps/carbon/app/routes/x+/part+/$partId.manufacturing.tsx+++ b/apps/carbon/app/routes/x+/part+/$partId.manufacturing.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import {PartManufacturingForm,getPartManufacturing,diff --git a/apps/carbon/app/routes/x+/part+/$partId.planning.tsx b/apps/carbon/app/routes/x+/part+/$partId.planning.tsxindex 3184fd49f0..1a2c1bba1d 100644--- a/apps/carbon/app/routes/x+/part+/$partId.planning.tsx+++ b/apps/carbon/app/routes/x+/part+/$partId.planning.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { useRouteData } from "~/hooks";import {PartPlanningForm,diff --git a/apps/carbon/app/routes/x+/part+/$partId.purchasing.tsx b/apps/carbon/app/routes/x+/part+/$partId.purchasing.tsxindex 3390075feb..a0e96438a3 100644--- a/apps/carbon/app/routes/x+/part+/$partId.purchasing.tsx+++ b/apps/carbon/app/routes/x+/part+/$partId.purchasing.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { useRouteData } from "~/hooks";import type { UnitOfMeasureListItem } from "~/modules/parts";import {diff --git a/apps/carbon/app/routes/x+/part+/$partId.sale-price.tsx b/apps/carbon/app/routes/x+/part+/$partId.sale-price.tsxindex 849256a3a8..ab7a1f3ecb 100644--- a/apps/carbon/app/routes/x+/part+/$partId.sale-price.tsx+++ b/apps/carbon/app/routes/x+/part+/$partId.sale-price.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { useRouteData } from "~/hooks";import type { UnitOfMeasureListItem } from "~/modules/parts";import {diff --git a/apps/carbon/app/routes/x+/part+/$partId.suppliers.new.tsx b/apps/carbon/app/routes/x+/part+/$partId.suppliers.new.tsxindex 6993fab14c..da0ffb67fc 100644--- a/apps/carbon/app/routes/x+/part+/$partId.suppliers.new.tsx+++ b/apps/carbon/app/routes/x+/part+/$partId.suppliers.new.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";import {PartSupplierForm,partSupplierValidator,diff --git a/apps/carbon/app/routes/x+/part+/new.tsx b/apps/carbon/app/routes/x+/part+/new.tsxindex 08ca7c39b6..378f5b2be5 100644--- a/apps/carbon/app/routes/x+/part+/new.tsx+++ b/apps/carbon/app/routes/x+/part+/new.tsx@@ -1,6 +1,6 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";import { PartForm, partValidator, upsertPart } from "~/modules/parts";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/parts+/groups.$groupId.tsx b/apps/carbon/app/routes/x+/parts+/groups.$groupId.tsxindex 9e2a061d87..bbfbc117ae 100644--- a/apps/carbon/app/routes/x+/parts+/groups.$groupId.tsx+++ b/apps/carbon/app/routes/x+/parts+/groups.$groupId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {PartGroupForm,getPartGroup,diff --git a/apps/carbon/app/routes/x+/parts+/groups.new.tsx b/apps/carbon/app/routes/x+/parts+/groups.new.tsxindex 08efc41dbb..913269a939 100644--- a/apps/carbon/app/routes/x+/parts+/groups.new.tsx+++ b/apps/carbon/app/routes/x+/parts+/groups.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {PartGroupForm,partGroupValidator,diff --git a/apps/carbon/app/routes/x+/parts+/uom.$uomId.tsx b/apps/carbon/app/routes/x+/parts+/uom.$uomId.tsxindex 30811415a4..ceb8423dc6 100644--- a/apps/carbon/app/routes/x+/parts+/uom.$uomId.tsx+++ b/apps/carbon/app/routes/x+/parts+/uom.$uomId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {UnitOfMeasureForm,getUnitOfMeasure,diff --git a/apps/carbon/app/routes/x+/parts+/uom.new.tsx b/apps/carbon/app/routes/x+/parts+/uom.new.tsxindex 6f370e029b..c23810d0a0 100644--- a/apps/carbon/app/routes/x+/parts+/uom.new.tsx+++ b/apps/carbon/app/routes/x+/parts+/uom.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {UnitOfMeasureForm,unitOfMeasureValidator,diff --git a/apps/carbon/app/routes/x+/person+/$personId.job.tsx b/apps/carbon/app/routes/x+/person+/$personId.job.tsxindex c4ac2b0ca2..5f4f2321a5 100644--- a/apps/carbon/app/routes/x+/person+/$personId.job.tsx+++ b/apps/carbon/app/routes/x+/person+/$personId.job.tsx@@ -6,7 +6,7 @@ import { flash } from "~/services/session.server";import { path } from "~/utils/path";import { error, success } from "~/utils/result";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {PersonJob,employeeJobValidator,diff --git a/apps/carbon/app/routes/x+/person+/$personId.private.tsx b/apps/carbon/app/routes/x+/person+/$personId.private.tsxindex 92b4a7ef97..e6ba66fdf3 100644--- a/apps/carbon/app/routes/x+/person+/$personId.private.tsx+++ b/apps/carbon/app/routes/x+/person+/$personId.private.tsx@@ -3,7 +3,7 @@ import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import type { PrivateAttributes } from "~/modules/account";import { UserAttributesForm, getPrivateAttributes } from "~/modules/account";import { employeeJobValidator, upsertEmployeeJob } from "~/modules/resources";diff --git a/apps/carbon/app/routes/x+/person+/$personId.public.tsx b/apps/carbon/app/routes/x+/person+/$personId.public.tsxindex a8865890b6..edddccb2af 100644--- a/apps/carbon/app/routes/x+/person+/$personId.public.tsx+++ b/apps/carbon/app/routes/x+/person+/$personId.public.tsx@@ -3,7 +3,7 @@ import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import type { PublicAttributes } from "~/modules/account";import { UserAttributesForm, getPublicAttributes } from "~/modules/account";import { employeeJobValidator, upsertEmployeeJob } from "~/modules/resources";diff --git a/apps/carbon/app/routes/x+/person+/$personId.tsx b/apps/carbon/app/routes/x+/person+/$personId.tsxindex 0b6fdd3ce6..75c3df8587 100644--- a/apps/carbon/app/routes/x+/person+/$personId.tsx+++ b/apps/carbon/app/routes/x+/person+/$personId.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { Outlet } from "@remix-run/react";-import { validationError } from "remix-validated-form";import {accountProfileValidator,updatePublicAccount,diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.details.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.details.tsxindex 9c94f2695e..58d9eb78f1 100644--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.details.tsx+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.details.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { useRouteData } from "~/hooks";import type { PurchaseInvoice } from "~/modules/invoicing";import {diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsxindex b82d2ce84a..2dd44c8b1e 100644--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import type { PurchaseInvoiceLineType } from "~/modules/invoicing";import {PurchaseInvoiceLineForm,diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.new.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.new.tsxindex bd65a3691d..ca8539cb35 100644--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.new.tsx+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.new.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";import type { PurchaseInvoiceLineType } from "~/modules/invoicing";import {PurchaseInvoiceLineForm,diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.tsxindex 2483171c8f..d0d2e81372 100644--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.tsx+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.tsx@@ -1,6 +1,6 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";import {PurchaseInvoiceLines,purchaseInvoiceValidator,diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/new.tsxindex 01b537a914..9bc65088b9 100644--- a/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx+++ b/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import type { FunctionsResponse } from "@supabase/functions-js";-import { validationError } from "remix-validated-form";import { useRouteData, useUrlParams } from "~/hooks";import type { PurchaseInvoiceStatus } from "~/modules/invoicing";import {diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.delivery.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.delivery.tsxindex 68624946e8..5df61435dc 100644--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.delivery.tsx+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.delivery.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import {getShippingMethodsList,getShippingTermsList,diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsxindex e0b9856b57..19fa075023 100644--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { useRouteData } from "~/hooks";import type { PurchaseOrder } from "~/modules/purchasing";import {diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsxindex daaf356e14..162a25e235 100644--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import type { PurchaseOrderLineType } from "~/modules/purchasing";import {PurchaseOrderLineForm,diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsxindex 90b961ef88..4f485042ab 100644--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";import type { PurchaseOrderLineType } from "~/modules/purchasing";import {PurchaseOrderLineForm,diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.payment.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.payment.tsxindex f3e67bc8e3..9b169fcbc5 100644--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.payment.tsx+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.payment.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { getPaymentTermsList } from "~/modules/accounting";import {PurchaseOrderPaymentForm,diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.release.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.release.tsxindex df7a64c20f..1ef9bed6df 100644--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.release.tsx+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.release.tsx@@ -1,7 +1,7 @@import { PurchaseOrderEmail } from "@carbon/documents";+import { validationError } from "@carbon/remix-validated-form";import { renderAsync } from "@react-email/components";import { redirect, type ActionFunctionArgs } from "@remix-run/node";-import { validationError } from "remix-validated-form";import { triggerClient } from "~/lib/trigger.server";import {getPurchaseOrder,diff --git a/apps/carbon/app/routes/x+/purchase-order+/new.tsx b/apps/carbon/app/routes/x+/purchase-order+/new.tsxindex f04ff07ea7..10acda10b8 100644--- a/apps/carbon/app/routes/x+/purchase-order+/new.tsx+++ b/apps/carbon/app/routes/x+/purchase-order+/new.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import { getLocalTimeZone, today } from "@internationalized/date";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";import { useUrlParams } from "~/hooks";import type {PurchaseOrderStatus,@@ -24,10 +24,13 @@ export async function action({ request }: ActionFunctionArgs) {const { client, userId } = await requirePermissions(request, {create: "purchasing",});+ const formData = await request.formData();+ console.log("formData");+ for (var pair of formData.entries()) {+ console.log(pair[0] + ", " + pair[1]);+ }- const validation = await purchaseOrderValidator.validate(- await request.formData()- );+ const validation = await purchaseOrderValidator.validate(formData);if (validation.error) {return validationError(validation.error);diff --git a/apps/carbon/app/routes/x+/purchasing+/orders.favorite.tsx b/apps/carbon/app/routes/x+/purchasing+/orders.favorite.tsxindex 3d59f51d05..c5fe6a6729 100644--- a/apps/carbon/app/routes/x+/purchasing+/orders.favorite.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/orders.favorite.tsx@@ -1,6 +1,5 @@+import { validationError, withZod } from "@carbon/remix-validated-form";import { json, type ActionFunctionArgs } from "@remix-run/node";-import { withZod } from "@remix-validated-form/with-zod";-import { validationError } from "remix-validated-form";import { updatePurchaseOrderFavorite } from "~/modules/purchasing";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/purchasing+/rfqs.favorite.tsx b/apps/carbon/app/routes/x+/purchasing+/rfqs.favorite.tsxindex be9afa7726..27b7212816 100644--- a/apps/carbon/app/routes/x+/purchasing+/rfqs.favorite.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/rfqs.favorite.tsx@@ -1,6 +1,5 @@+import { validationError, withZod } from "@carbon/remix-validated-form";import { json, type ActionFunctionArgs } from "@remix-run/node";-import { withZod } from "@remix-validated-form/with-zod";-import { validationError } from "remix-validated-form";import { updateRequestForQuoteFavorite } from "~/modules/purchasing";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsxindex 4fd53bd322..2fef208d2d 100644--- a/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {SupplierTypeForm,getSupplierType,diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsxindex 8952cdf9e5..ccacb6f965 100644--- a/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {SupplierTypeForm,supplierTypeValidator,diff --git a/apps/carbon/app/routes/x+/quote+/$id.details.tsx b/apps/carbon/app/routes/x+/quote+/$id.details.tsxindex 6499ab34ba..c51a8c745f 100644--- a/apps/carbon/app/routes/x+/quote+/$id.details.tsx+++ b/apps/carbon/app/routes/x+/quote+/$id.details.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { useRouteData } from "~/hooks";import type { Quotation, QuotationAttachment } from "~/modules/sales";import {diff --git a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.assembly.$assemblyId.tsx b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.assembly.$assemblyId.tsxindex 1ba20f312a..317ac9f321 100644--- a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.assembly.$assemblyId.tsx+++ b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.assembly.$assemblyId.tsx@@ -2,7 +2,7 @@ import { Outlet, json, redirect, useLoaderData } from "@remix-run/react";import QuotationAssemblyForm from "~/modules/sales/ui/Quotation/QuotationAssemblyForm";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {getQuoteAssembly,quotationAssemblyValidator,diff --git a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.assembly.new.tsx b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.assembly.new.tsxindex e4fdf1a810..77835b2984 100644--- a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.assembly.new.tsx+++ b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.assembly.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect, useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { useUrlParams } from "~/hooks";import {QuotationAssemblyForm,diff --git a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.details.tsx b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.details.tsxindex 2b707c1f32..dd087d7b34 100644--- a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.details.tsx+++ b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.details.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {QuotationLineForm,QuotationLineQuantities,diff --git a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.material.new.tsx b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.material.new.tsxindex 9c689bcb8f..47233755bd 100644--- a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.material.new.tsx+++ b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.material.new.tsx@@ -1,7 +1,7 @@import { json, redirect } from "@remix-run/react";import type { ActionFunctionArgs } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {QuotationMaterialForm,quotationMaterialValidator,diff --git a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.tsx b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.tsxindex 35380b6174..c225271107 100644--- a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.tsx+++ b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.$operationId.tsx@@ -1,7 +1,7 @@import { json, redirect, useLoaderData } from "@remix-run/react";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {QuotationMaterialLines,QuotationOperationForm,diff --git a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.new.tsx b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.new.tsxindex 66f41e66c2..11d2e6aef0 100644--- a/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.new.tsx+++ b/apps/carbon/app/routes/x+/quote+/$id.lines.$lineId.operation.new.tsx@@ -2,7 +2,7 @@ import { redirect, useParams } from "@remix-run/react";import { useUrlParams } from "~/hooks";import type { ActionFunctionArgs } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {QuotationOperationForm,quotationOperationValidator,diff --git a/apps/carbon/app/routes/x+/quote+/$id.new.tsx b/apps/carbon/app/routes/x+/quote+/$id.new.tsxindex 21e2fdd676..bf200018c3 100644--- a/apps/carbon/app/routes/x+/quote+/$id.new.tsx+++ b/apps/carbon/app/routes/x+/quote+/$id.new.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {QuotationLineForm,insertQuoteLineQuantity,diff --git a/apps/carbon/app/routes/x+/quote+/new.tsx b/apps/carbon/app/routes/x+/quote+/new.tsxindex f51a7dd2a0..d57ef2b571 100644--- a/apps/carbon/app/routes/x+/quote+/new.tsx+++ b/apps/carbon/app/routes/x+/quote+/new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { useUser } from "~/hooks";import {QuotationForm,diff --git a/apps/carbon/app/routes/x+/resources+/abilities.new.tsx b/apps/carbon/app/routes/x+/resources+/abilities.new.tsxindex 11e5c77498..bf4be3728d 100644--- a/apps/carbon/app/routes/x+/resources+/abilities.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/abilities.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {AbilityForm,abilityValidator,diff --git a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.$id.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.$id.tsxindex 383cd64d01..da0bde140a 100644--- a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.$id.tsx+++ b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.$id.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useLoaderData, useNavigate, useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { useRouteData } from "~/hooks";import type { Ability } from "~/modules/resources";import {diff --git a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.new.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.new.tsxindex d9894021d3..ec6f6c8008 100644--- a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.new.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useNavigate, useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { useRouteData } from "~/hooks";import type { Ability } from "~/modules/resources";import {diff --git a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsxindex 1f1c7a343b..7798f77f8a 100644--- a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsx+++ b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsx@@ -18,7 +18,7 @@ import { useState } from "react";import { IoMdClose } from "react-icons/io";import { LuChevronDown, LuChevronUp } from "react-icons/lu";import { MdEdit, MdOutlineArrowBackIos } from "react-icons/md";-import { ValidatedForm, validationError } from "remix-validated-form";+import { ValidatedForm, validationError } from "@carbon/remix-validated-form";import { New } from "~/components";import { Hidden, Input, Submit } from "~/components/Form";import type { AbilityDatum } from "~/modules/resources";diff --git a/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsx b/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsxindex 1c34f7ebf4..69eaddd8ea 100644--- a/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { attributeValidator, updateAttribute } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/resources+/attribute.new.tsx b/apps/carbon/app/routes/x+/resources+/attribute.new.tsxindex 28cca9c63d..60cd9057ad 100644--- a/apps/carbon/app/routes/x+/resources+/attribute.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/attribute.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { attributeValidator, insertAttribute } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsxindex 4ba8cc14b0..a46b603d47 100644--- a/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsx+++ b/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData, useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {AttributeCategoryForm,attributeCategoryValidator,diff --git a/apps/carbon/app/routes/x+/resources+/attributes.new.tsx b/apps/carbon/app/routes/x+/resources+/attributes.new.tsxindex 602889400e..69b4d52e16 100644--- a/apps/carbon/app/routes/x+/resources+/attributes.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/attributes.new.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {AttributeCategoryForm,attributeCategoryValidator,diff --git a/apps/carbon/app/routes/x+/resources+/contractors.$supplierContactId.tsx b/apps/carbon/app/routes/x+/resources+/contractors.$supplierContactId.tsxindex c55340e699..29f7c785a0 100644--- a/apps/carbon/app/routes/x+/resources+/contractors.$supplierContactId.tsx+++ b/apps/carbon/app/routes/x+/resources+/contractors.$supplierContactId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {ContractorForm,contractorValidator,diff --git a/apps/carbon/app/routes/x+/resources+/contractors.new.tsx b/apps/carbon/app/routes/x+/resources+/contractors.new.tsxindex 6bb1dbd97c..c0613583af 100644--- a/apps/carbon/app/routes/x+/resources+/contractors.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/contractors.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { useUrlParams } from "~/hooks";import {ContractorForm,diff --git a/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx b/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsxindex e98d13bec6..b6f2bfe8ac 100644--- a/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx+++ b/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {DepartmentForm,departmentValidator,diff --git a/apps/carbon/app/routes/x+/resources+/departments.new.tsx b/apps/carbon/app/routes/x+/resources+/departments.new.tsxindex 4a89aa80d1..042cda3a84 100644--- a/apps/carbon/app/routes/x+/resources+/departments.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/departments.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {DepartmentForm,departmentValidator,diff --git a/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsxindex b5a022e4e1..6a005a977d 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData, useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {EquipmentTypeForm,equipmentTypeValidator,diff --git a/apps/carbon/app/routes/x+/resources+/equipment.new.tsx b/apps/carbon/app/routes/x+/resources+/equipment.new.tsxindex f605a541d3..939fd80eda 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.new.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {EquipmentTypeForm,equipmentTypeValidator,diff --git a/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsxindex 1500dac768..5b1dcb17fa 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { equipmentValidator, upsertEquipment } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx b/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsxindex 59c8b0ec37..b419792c5e 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { equipmentValidator, upsertEquipment } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsx b/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsxindex 02e51fd2ec..1d24cfced3 100644--- a/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsx+++ b/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {HolidayForm,getHoliday,diff --git a/apps/carbon/app/routes/x+/resources+/holidays.new.tsx b/apps/carbon/app/routes/x+/resources+/holidays.new.tsxindex 214f973350..735618f8ca 100644--- a/apps/carbon/app/routes/x+/resources+/holidays.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/holidays.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {HolidayForm,holidayValidator,diff --git a/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsx b/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsxindex 776f8d59c3..4dde80999c 100644--- a/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsx+++ b/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsx@@ -2,7 +2,7 @@ import { getLocalTimeZone } from "@internationalized/date";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {LocationForm,getLocation,diff --git a/apps/carbon/app/routes/x+/resources+/locations.new.tsx b/apps/carbon/app/routes/x+/resources+/locations.new.tsxindex 04fcee6a26..25fc7b0fd2 100644--- a/apps/carbon/app/routes/x+/resources+/locations.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/locations.new.tsx@@ -1,7 +1,7 @@import { getLocalTimeZone } from "@internationalized/date";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {LocationForm,locationValidator,diff --git a/apps/carbon/app/routes/x+/resources+/partners.$supplierLocationId.$abilityId.tsx b/apps/carbon/app/routes/x+/resources+/partners.$supplierLocationId.$abilityId.tsxindex 176c6ba04c..dc0352746d 100644--- a/apps/carbon/app/routes/x+/resources+/partners.$supplierLocationId.$abilityId.tsx+++ b/apps/carbon/app/routes/x+/resources+/partners.$supplierLocationId.$abilityId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {PartnerForm,getPartner,diff --git a/apps/carbon/app/routes/x+/resources+/partners.new.tsx b/apps/carbon/app/routes/x+/resources+/partners.new.tsxindex 4084731b7c..e4a93f004f 100644--- a/apps/carbon/app/routes/x+/resources+/partners.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/partners.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { useUrlParams } from "~/hooks";import {PartnerForm,diff --git a/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsx b/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsxindex 97f3a129d2..41f0f0b905 100644--- a/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsx+++ b/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {ShiftForm,getShift,diff --git a/apps/carbon/app/routes/x+/resources+/shifts.new.tsx b/apps/carbon/app/routes/x+/resources+/shifts.new.tsxindex c0210364a4..3358d22b37 100644--- a/apps/carbon/app/routes/x+/resources+/shifts.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/shifts.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { ShiftForm, shiftValidator, upsertShift } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsxindex e141ee4673..dddc9546b2 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData, useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {WorkCellTypeForm,getWorkCellType,diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.cell.$workCellId.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.cell.$workCellId.tsxindex b8ae9f01e3..8c4b1315bc 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.cell.$workCellId.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.cell.$workCellId.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { upsertWorkCell, workCellValidator } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.cell.new.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.cell.new.tsxindex 9de63d148e..8732ff5da1 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.cell.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.cell.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { upsertWorkCell, workCellValidator } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.new.tsxindex afcfe9ffc8..5f3f429211 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {upsertWorkCellType,WorkCellTypeForm,diff --git a/apps/carbon/app/routes/x+/rfq+/new.tsx b/apps/carbon/app/routes/x+/rfq+/new.tsxindex a3cdcbed90..07d812a9c9 100644--- a/apps/carbon/app/routes/x+/rfq+/new.tsx+++ b/apps/carbon/app/routes/x+/rfq+/new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import type { RequestForQuoteStatus } from "~/modules/purchasing";import {RequestForQuoteForm,diff --git a/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsxindex f0f84e8447..df9f02d82f 100644--- a/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx+++ b/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {CustomerTypeForm,customerTypeValidator,diff --git a/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.new.tsxindex b1f4ce41af..b402c1a1b0 100644--- a/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx+++ b/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {CustomerTypeForm,customerTypeValidator,diff --git a/apps/carbon/app/routes/x+/sales+/quotes.favorite.tsx b/apps/carbon/app/routes/x+/sales+/quotes.favorite.tsxindex ea4fb496e1..6ab62983ae 100644--- a/apps/carbon/app/routes/x+/sales+/quotes.favorite.tsx+++ b/apps/carbon/app/routes/x+/sales+/quotes.favorite.tsx@@ -1,6 +1,5 @@+import { validationError, withZod } from "@carbon/remix-validated-form";import { json, type ActionFunctionArgs } from "@remix-run/node";-import { withZod } from "@remix-validated-form/with-zod";-import { validationError } from "remix-validated-form";import { updateQuoteFavorite } from "~/modules/sales";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/service+/$serviceId.index.tsx b/apps/carbon/app/routes/x+/service+/$serviceId.index.tsxindex 13d9b6f40b..86649d5920 100644--- a/apps/carbon/app/routes/x+/service+/$serviceId.index.tsx+++ b/apps/carbon/app/routes/x+/service+/$serviceId.index.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";import { useRouteData } from "~/hooks";import type { Service } from "~/modules/parts";import { ServiceForm, serviceValidator, upsertService } from "~/modules/parts";diff --git a/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.new.tsx b/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.new.tsxindex 6da7ee7894..f048bea7c7 100644--- a/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.new.tsx+++ b/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.new.tsx@@ -1,7 +1,7 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";import {ServiceSupplierForm,serviceSupplierValidator,diff --git a/apps/carbon/app/routes/x+/service+/new.tsx b/apps/carbon/app/routes/x+/service+/new.tsxindex b3eba2246d..e3a7d1916e 100644--- a/apps/carbon/app/routes/x+/service+/new.tsx+++ b/apps/carbon/app/routes/x+/service+/new.tsx@@ -1,6 +1,6 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";import { ServiceForm, serviceValidator, upsertService } from "~/modules/parts";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/settings+/company.tsx b/apps/carbon/app/routes/x+/settings+/company.tsxindex 1858d7a09c..2dbeb551b7 100644--- a/apps/carbon/app/routes/x+/settings+/company.tsx+++ b/apps/carbon/app/routes/x+/settings+/company.tsx@@ -1,7 +1,7 @@import { VStack } from "@carbon/react";import type { ActionFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { useRouteData } from "~/hooks";import type { Company as CompanyType } from "~/modules/settings";import {diff --git a/apps/carbon/app/routes/x+/settings+/integrations.exchange-rates-v1.tsx b/apps/carbon/app/routes/x+/settings+/integrations.exchange-rates-v1.tsxindex 366af74294..b30273d503 100644--- a/apps/carbon/app/routes/x+/settings+/integrations.exchange-rates-v1.tsx+++ b/apps/carbon/app/routes/x+/settings+/integrations.exchange-rates-v1.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData, useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {ExchangeRatesForm,apiKey,diff --git a/apps/carbon/app/routes/x+/settings+/integrations.google-places-v2.tsx b/apps/carbon/app/routes/x+/settings+/integrations.google-places-v2.tsxindex 2f8cb80c80..c6f8f05aec 100644--- a/apps/carbon/app/routes/x+/settings+/integrations.google-places-v2.tsx+++ b/apps/carbon/app/routes/x+/settings+/integrations.google-places-v2.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData, useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {GooglePlacesForm,apiKey,diff --git a/apps/carbon/app/routes/x+/settings+/integrations.resend.tsx b/apps/carbon/app/routes/x+/settings+/integrations.resend.tsxindex 5c7d7a00ea..3907f8afa4 100644--- a/apps/carbon/app/routes/x+/settings+/integrations.resend.tsx+++ b/apps/carbon/app/routes/x+/settings+/integrations.resend.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData, useNavigate } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {ResendForm,apiKey,diff --git a/apps/carbon/app/routes/x+/settings+/sequences.$tableId.tsx b/apps/carbon/app/routes/x+/settings+/sequences.$tableId.tsxindex 175db8e73e..879301efd3 100644--- a/apps/carbon/app/routes/x+/settings+/sequences.$tableId.tsx+++ b/apps/carbon/app/routes/x+/settings+/sequences.$tableId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {SequenceForm,getSequence,diff --git a/apps/carbon/app/routes/x+/settings+/theme.tsx b/apps/carbon/app/routes/x+/settings+/theme.tsxindex 52a48b760b..dcb06bcf0a 100644--- a/apps/carbon/app/routes/x+/settings+/theme.tsx+++ b/apps/carbon/app/routes/x+/settings+/theme.tsx@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import type { Theme as ThemeValue } from "~/modules/settings";import {ThemeForm,diff --git a/apps/carbon/app/routes/x+/shared+/notes.new.tsx b/apps/carbon/app/routes/x+/shared+/notes.new.tsxindex 54aedd5e9a..23830c536f 100644--- a/apps/carbon/app/routes/x+/shared+/notes.new.tsx+++ b/apps/carbon/app/routes/x+/shared+/notes.new.tsx@@ -1,6 +1,6 @@+import { validationError } from "@carbon/remix-validated-form";import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";import { insertNote, noteValidator } from "~/modules/shared";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session.server";diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.$supplierContactId.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.$supplierContactId.tsxindex 0b0921c8da..32d20510db 100644--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.$supplierContactId.tsx+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.$supplierContactId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {SupplierContactForm,getSupplierContact,diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.new.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.new.tsxindex b3e2916255..4a7442f6a1 100644--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.new.tsx+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { getSupabaseServiceRole } from "~/lib/supabase";import {SupplierContactForm,diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.index.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.index.tsxindex 4787f4bbac..5da433f2fe 100644--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.index.tsx+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.index.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useParams } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { useRouteData } from "~/hooks";import type { SupplierDetail } from "~/modules/purchasing";import {diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.$supplierLocationId.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.$supplierLocationId.tsxindex bfdc6b856f..9a18dc9b54 100644--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.$supplierLocationId.tsx+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.$supplierLocationId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {SupplierLocationForm,getSupplierLocation,diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.new.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.new.tsxindex 81f2c028c6..bf7b532285 100644--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.new.tsx+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {insertSupplierLocation,SupplierLocationForm,diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.payments.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.payments.tsxindex fb8c0f7d78..72a225d9f4 100644--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.payments.tsx+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.payments.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {SupplierPaymentForm,getSupplierPayment,diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.shipping.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.shipping.tsxindex 9de4817c9c..6f068de6cc 100644--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.shipping.tsx+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.shipping.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {SupplierShippingForm,getSupplierShipping,diff --git a/apps/carbon/app/routes/x+/supplier+/new.tsx b/apps/carbon/app/routes/x+/supplier+/new.tsxindex 93ad80fbf3..453bb3065c 100644--- a/apps/carbon/app/routes/x+/supplier+/new.tsx+++ b/apps/carbon/app/routes/x+/supplier+/new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {insertSupplier,SupplierForm,diff --git a/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsx b/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsxindex a86765e39c..745d869390 100644--- a/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsx+++ b/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import type { Permission } from "~/modules/users";import {bulkPermissionsValidator,diff --git a/apps/carbon/app/routes/x+/users+/customers.new.tsx b/apps/carbon/app/routes/x+/users+/customers.new.tsxindex f0054cc918..62c99f8597 100644--- a/apps/carbon/app/routes/x+/users+/customers.new.tsx+++ b/apps/carbon/app/routes/x+/users+/customers.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {createCustomerAccountValidator,CreateCustomerModal,diff --git a/apps/carbon/app/routes/x+/users+/deactivate.tsx b/apps/carbon/app/routes/x+/users+/deactivate.tsxindex a80d09651e..e34a8d7d33 100644--- a/apps/carbon/app/routes/x+/users+/deactivate.tsx+++ b/apps/carbon/app/routes/x+/users+/deactivate.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { deactivateUsersValidator } from "~/modules/users";import { deactivateUser } from "~/modules/users/users.server";import type { UserAdminQueueData } from "~/queues";diff --git a/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx b/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsxindex 6d6503f9bf..be1085410d 100644--- a/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx+++ b/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {EmployeeTypeForm,employeeTypePermissionsValidator,diff --git a/apps/carbon/app/routes/x+/users+/employee-types.new.tsx b/apps/carbon/app/routes/x+/users+/employee-types.new.tsxindex cf778a19b5..dfe602612e 100644--- a/apps/carbon/app/routes/x+/users+/employee-types.new.tsx+++ b/apps/carbon/app/routes/x+/users+/employee-types.new.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {EmployeeTypeForm,employeeTypePermissionsValidator,diff --git a/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsx b/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsxindex 6574507022..2d16e96c15 100644--- a/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsx+++ b/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsx@@ -2,7 +2,7 @@ import type { Json } from "@carbon/database";import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {EmployeePermissionsForm,employeeValidator,diff --git a/apps/carbon/app/routes/x+/users+/employees.new.tsx b/apps/carbon/app/routes/x+/users+/employees.new.tsxindex d33eb345e0..16eb25c7ca 100644--- a/apps/carbon/app/routes/x+/users+/employees.new.tsx+++ b/apps/carbon/app/routes/x+/users+/employees.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { CreateEmployeeModal, createEmployeeValidator } from "~/modules/users";import { createEmployeeAccount } from "~/modules/users/users.server";import { requirePermissions } from "~/services/auth";diff --git a/apps/carbon/app/routes/x+/users+/groups.$groupId.tsx b/apps/carbon/app/routes/x+/users+/groups.$groupId.tsxindex c3a08b3f06..683a831fa4 100644--- a/apps/carbon/app/routes/x+/users+/groups.$groupId.tsx+++ b/apps/carbon/app/routes/x+/users+/groups.$groupId.tsx@@ -1,7 +1,7 @@import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {GroupForm,getGroupMembers,diff --git a/apps/carbon/app/routes/x+/users+/groups.new.tsx b/apps/carbon/app/routes/x+/users+/groups.new.tsxindex 49ecad1f76..778b198e84 100644--- a/apps/carbon/app/routes/x+/users+/groups.new.tsx+++ b/apps/carbon/app/routes/x+/users+/groups.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {GroupForm,deleteGroup,diff --git a/apps/carbon/app/routes/x+/users+/resend-invite.tsx b/apps/carbon/app/routes/x+/users+/resend-invite.tsxindex ebd5e7d190..f10fec6309 100644--- a/apps/carbon/app/routes/x+/users+/resend-invite.tsx+++ b/apps/carbon/app/routes/x+/users+/resend-invite.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { json } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { resendInviteValidator } from "~/modules/users";import { resendInvite } from "~/modules/users/users.server";import type { UserAdminQueueData } from "~/queues";diff --git a/apps/carbon/app/routes/x+/users+/suppliers.new.tsx b/apps/carbon/app/routes/x+/users+/suppliers.new.tsxindex 254b367e23..a3abff635a 100644--- a/apps/carbon/app/routes/x+/users+/suppliers.new.tsx+++ b/apps/carbon/app/routes/x+/users+/suppliers.new.tsx@@ -1,6 +1,6 @@import type { ActionFunctionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import {createSupplierAccountValidator,CreateSupplierModal,diff --git a/apps/carbon/app/services/auth/auth.models.ts b/apps/carbon/app/services/auth/auth.models.tsindex 441333b840..e845b4a4a7 100644--- a/apps/carbon/app/services/auth/auth.models.ts+++ b/apps/carbon/app/services/auth/auth.models.ts@@ -1,4 +1,4 @@-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";export const loginValidator = withZod(diff --git a/apps/carbon/app/types/index.ts b/apps/carbon/app/types/index.tsindex a3488c173e..b89e7e4bea 100644--- a/apps/carbon/app/types/index.ts+++ b/apps/carbon/app/types/index.ts@@ -2,7 +2,7 @@ import type { OptionBase } from "@carbon/react";import type { TypedResponse } from "@remix-run/node";import type { ReactElement } from "react";import type { IconType } from "react-icons";-import type { ValidationErrorResponseData } from "remix-validated-form";+import type { ValidationErrorResponseData } from "@carbon/remix-validated-form";export type Action = {label: string;diff --git a/apps/carbon/app/types/validators.ts b/apps/carbon/app/types/validators.tsindex 6e13d399b5..2450d6eda1 100644--- a/apps/carbon/app/types/validators.ts+++ b/apps/carbon/app/types/validators.ts@@ -1,4 +1,4 @@-import type { Validator } from "remix-validated-form";+import type { Validator } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";diff --git a/apps/carbon/package.json b/apps/carbon/package.jsonindex 02b1d4adc1..616be81928 100644--- a/apps/carbon/package.json+++ b/apps/carbon/package.json@@ -6,6 +6,7 @@"@carbon/logger": "*","@carbon/react": "*","@carbon/redis": "*",+ "@carbon/remix-validated-form": "*","@carbon/utils": "*","@internationalized/date": "^3.3.0","@nanostores/react": "^0.7.1",@@ -15,7 +16,6 @@"@remix-run/node": "~2.5.1","@remix-run/react": "~2.5.1","@remix-run/serve": "~2.5.1",- "@remix-validated-form/with-zod": "^2.0.7","@supabase/functions-js": "2.1.5","@supabase/supabase-js": "^2.39.3","@tailwindcss/container-queries": "^0.1.1",@@ -58,7 +58,6 @@"react-icons": "^4.12.0","reactflow": "^11.7.4","remix-flat-routes": "^0.5.10",- "remix-validated-form": "^5.1.5","resend": "^3.1.0","tailwind-merge": "2.2.1","tailwind-scrollbar": "^3.0.5",diff --git a/apps/carbon/remix.config.js b/apps/carbon/remix.config.jsindex 9831cad375..2a28cfcdc2 100644--- a/apps/carbon/remix.config.js+++ b/apps/carbon/remix.config.js@@ -28,6 +28,7 @@ module.exports = {"@carbon/documents","@carbon/logger","@carbon/react",+ "@carbon/remix-validated-form","@carbon/utils","nanoid","nanostores",diff --git a/package-lock.json b/package-lock.jsonindex 03cf1f807f..87b371c427 100644--- a/package-lock.json+++ b/package-lock.json@@ -38,6 +38,7 @@"@carbon/logger": "*","@carbon/react": "*","@carbon/redis": "*",+ "@carbon/remix-validated-form": "*","@carbon/utils": "*","@internationalized/date": "^3.3.0","@nanostores/react": "^0.7.1",@@ -47,7 +48,6 @@"@remix-run/node": "~2.5.1","@remix-run/react": "~2.5.1","@remix-run/serve": "~2.5.1",- "@remix-validated-form/with-zod": "^2.0.7","@supabase/functions-js": "2.1.5","@supabase/supabase-js": "^2.39.3","@tailwindcss/container-queries": "^0.1.1",@@ -90,7 +90,6 @@"react-icons": "^4.12.0","reactflow": "^11.7.4","remix-flat-routes": "^0.5.10",- "remix-validated-form": "^5.1.5","resend": "^3.1.0","tailwind-merge": "2.2.1","tailwind-scrollbar": "^3.0.5",@@ -139,12 +138,12 @@}},"node_modules/@ampproject/remapping": {- "version": "2.2.1",- "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",- "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",+ "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==","dependencies": {- "@jridgewell/gen-mapping": "^0.3.0",- "@jridgewell/trace-mapping": "^0.3.9"+ "@jridgewell/gen-mapping": "^0.3.5",+ "@jridgewell/trace-mapping": "^0.3.24"},"engines": {"node": ">=6.0.0"@@ -1066,6 +1065,10 @@"resolved": "packages/redis","link": true},+ "node_modules/@carbon/remix-validated-form": {+ "resolved": "packages/remix-validated-form",+ "link": true+ },"node_modules/@carbon/tailwind": {"resolved": "packages/tailwind","link": true@@ -2204,13 +2207,13 @@}},"node_modules/@jridgewell/gen-mapping": {- "version": "0.3.4",- "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.4.tgz",- "integrity": "sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==",+ "version": "0.3.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",+ "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==","dependencies": {- "@jridgewell/set-array": "^1.0.1",+ "@jridgewell/set-array": "^1.2.1","@jridgewell/sourcemap-codec": "^1.4.10",- "@jridgewell/trace-mapping": "^0.3.9"+ "@jridgewell/trace-mapping": "^0.3.24"},"engines": {"node": ">=6.0.0"@@ -2225,9 +2228,9 @@}},"node_modules/@jridgewell/set-array": {- "version": "1.1.2",- "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",- "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",+ "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==","engines": {"node": ">=6.0.0"}@@ -2238,9 +2241,9 @@"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="},"node_modules/@jridgewell/trace-mapping": {- "version": "0.3.23",- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.23.tgz",- "integrity": "sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==",+ "version": "0.3.25",+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",+ "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==","dependencies": {"@jridgewell/resolve-uri": "^3.1.0","@jridgewell/sourcemap-codec": "^1.4.14"@@ -5287,6 +5290,15 @@"react": "^16.8.0 || ^17.0.0 || ^18.0.0"}},+ "node_modules/@react-pdf/renderer/node_modules/scheduler": {+ "version": "0.17.0",+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.17.0.tgz",+ "integrity": "sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA==",+ "dependencies": {+ "loose-envify": "^1.1.0",+ "object-assign": "^4.1.1"+ }+ },"node_modules/@react-pdf/stylesheet": {"version": "4.2.4","resolved": "https://registry.npmjs.org/@react-pdf/stylesheet/-/stylesheet-4.2.4.tgz",@@ -6087,45 +6099,6 @@"resolved": "https://registry.npmjs.org/@remirror/core-constants/-/core-constants-2.0.2.tgz","integrity": "sha512-dyHY+sMF0ihPus3O27ODd4+agdHMEmuRdyiZJ2CCWjPV5UFmn17ZbElvk6WOGVE4rdCJKZQCrPV2BcikOMLUGQ=="},- "node_modules/@remirror/core-helpers": {- "version": "3.0.0",- "resolved": "https://registry.npmjs.org/@remirror/core-helpers/-/core-helpers-3.0.0.tgz",- "integrity": "sha512-tusEgQJIqg4qKj6HSBUFcyRnWnziw3neh4T9wOmsPGHFC3w9kl5KSrDb9UAgE8uX6y32FnS7vJ955mWOl3n50A==",- "dependencies": {- "@remirror/core-constants": "^2.0.2",- "@remirror/types": "^1.0.1",- "@types/object.omit": "^3.0.0",- "@types/object.pick": "^1.3.2",- "@types/throttle-debounce": "^2.1.0",- "case-anything": "^2.1.13",- "dash-get": "^1.0.2",- "deepmerge": "^4.3.1",- "fast-deep-equal": "^3.1.3",- "make-error": "^1.3.6",- "object.omit": "^3.0.0",- "object.pick": "^1.3.0",- "throttle-debounce": "^3.0.1"- }- },- "node_modules/@remirror/types": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/@remirror/types/-/types-1.0.1.tgz",- "integrity": "sha512-VlZQxwGnt1jtQ18D6JqdIF+uFZo525WEqrfp9BOc3COPpK4+AWCgdnAWL+ho6imWcoINlGjR/+3b6y5C1vBVEA==",- "dependencies": {- "type-fest": "^2.19.0"- }- },- "node_modules/@remirror/types/node_modules/type-fest": {- "version": "2.19.0",- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",- "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==",- "engines": {- "node": ">=12.20"- },- "funding": {- "url": "https://github.com/sponsors/sindresorhus"- }- },"node_modules/@remix-run/dev": {"version": "2.5.1","resolved": "https://registry.npmjs.org/@remix-run/dev/-/dev-2.5.1.tgz",@@ -6946,12 +6919,12 @@}},"node_modules/@remix-run/server-runtime": {- "version": "2.8.0",- "resolved": "https://registry.npmjs.org/@remix-run/server-runtime/-/server-runtime-2.8.0.tgz",- "integrity": "sha512-bb6rRefxEqA1fHGUo2i2s1uMztYqQlxupVCVsAs+sUkzTXtORJW+b0oFIKf5yWyaarBJ4zeLyoPsAMBqVX8P3w==",+ "version": "2.8.1",+ "resolved": "https://registry.npmjs.org/@remix-run/server-runtime/-/server-runtime-2.8.1.tgz",+ "integrity": "sha512-fh4SOEoONrN73Kvzc0gMDCmYpVRVbvoj9j3BUXHAcn0An8iX+HD/22gU7nTkIBzExM/F9xgEcwTewOnWqLw0Bg==","peer": true,"dependencies": {- "@remix-run/router": "1.15.2",+ "@remix-run/router": "1.15.3","@types/cookie": "^0.6.0","@web3-storage/multipart-parser": "^1.0.0","cookie": "^0.6.0",@@ -6971,9 +6944,9 @@}},"node_modules/@remix-run/server-runtime/node_modules/@remix-run/router": {- "version": "1.15.2",- "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.15.2.tgz",- "integrity": "sha512-+Rnav+CaoTE5QJc4Jcwh5toUpnVLKYbpU6Ys0zqbakqbaLQHeglLVHPfxOiQqdNmUy5C2lXz5dwC6tQNX2JW2Q==",+ "version": "1.15.3",+ "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.15.3.tgz",+ "integrity": "sha512-Oy8rmScVrVxWZVOpEF57ovlnhpZ8CCPlnIIumVcV9nFdiSIrus99+Lw78ekXyGvVDlIsFJbSfmSovJUhCWYV3w==","peer": true,"engines": {"node": ">=14.0.0"@@ -7080,19 +7053,10 @@"web-streams-polyfill": "^3.1.1"}},- "node_modules/@remix-validated-form/with-zod": {- "version": "2.0.7",- "resolved": "https://registry.npmjs.org/@remix-validated-form/with-zod/-/with-zod-2.0.7.tgz",- "integrity": "sha512-iytcQ9qlg3VRV9CXh33vTPnJcDdxmMPE6vZJj9oFh4Wf4kpQ2ck6s1jFOrpJxiwYRQrtlIzuR+JaWOa8pXwnfw==",- "peerDependencies": {- "remix-validated-form": "^4.x || ^5.x",- "zod": ">= 3.11.0"- }- },"node_modules/@rollup/rollup-android-arm-eabi": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz",- "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.1.tgz",+ "integrity": "sha512-iU2Sya8hNn1LhsYyf0N+L4Gf9Qc+9eBTJJJsaOGUp+7x4n2M9dxTt8UvhJl3oeftSjblSlpCfvjA/IfP3g5VjQ==","cpu": ["arm"],@@ -7102,9 +7066,9 @@]},"node_modules/@rollup/rollup-android-arm64": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz",- "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.1.tgz",+ "integrity": "sha512-wlzcWiH2Ir7rdMELxFE5vuM7D6TsOcJ2Yw0c3vaBR3VOsJFVTx9xvwnAvhgU5Ii8Gd6+I11qNHwndDscIm0HXg==","cpu": ["arm64"],@@ -7114,9 +7078,9 @@]},"node_modules/@rollup/rollup-darwin-arm64": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz",- "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.1.tgz",+ "integrity": "sha512-YRXa1+aZIFN5BaImK+84B3uNK8C6+ynKLPgvn29X9s0LTVCByp54TB7tdSMHDR7GTV39bz1lOmlLDuedgTwwHg==","cpu": ["arm64"],@@ -7126,9 +7090,9 @@]},"node_modules/@rollup/rollup-darwin-x64": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz",- "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.1.tgz",+ "integrity": "sha512-opjWJ4MevxeA8FhlngQWPBOvVWYNPFkq6/25rGgG+KOy0r8clYwL1CFd+PGwRqqMFVQ4/Qd3sQu5t7ucP7C/Uw==","cpu": ["x64"],@@ -7138,9 +7102,9 @@]},"node_modules/@rollup/rollup-linux-arm-gnueabihf": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz",- "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.1.tgz",+ "integrity": "sha512-uBkwaI+gBUlIe+EfbNnY5xNyXuhZbDSx2nzzW8tRMjUmpScd6lCQYKY2V9BATHtv5Ef2OBq6SChEP8h+/cxifQ==","cpu": ["arm"],@@ -7150,9 +7114,9 @@]},"node_modules/@rollup/rollup-linux-arm64-gnu": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz",- "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.1.tgz",+ "integrity": "sha512-0bK9aG1kIg0Su7OcFTlexkVeNZ5IzEsnz1ept87a0TUgZ6HplSgkJAnFpEVRW7GRcikT4GlPV0pbtVedOaXHQQ==","cpu": ["arm64"],@@ -7162,9 +7126,9 @@]},"node_modules/@rollup/rollup-linux-arm64-musl": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz",- "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.1.tgz",+ "integrity": "sha512-qB6AFRXuP8bdkBI4D7UPUbE7OQf7u5OL+R94JE42Z2Qjmyj74FtDdLGeriRyBDhm4rQSvqAGCGC01b8Fu2LthQ==","cpu": ["arm64"],@@ -7174,9 +7138,9 @@]},"node_modules/@rollup/rollup-linux-riscv64-gnu": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz",- "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.1.tgz",+ "integrity": "sha512-sHig3LaGlpNgDj5o8uPEoGs98RII8HpNIqFtAI8/pYABO8i0nb1QzT0JDoXF/pxzqO+FkxvwkHZo9k0NJYDedg==","cpu": ["riscv64"],@@ -7186,9 +7150,9 @@]},"node_modules/@rollup/rollup-linux-x64-gnu": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz",- "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.1.tgz",+ "integrity": "sha512-nD3YcUv6jBJbBNFvSbp0IV66+ba/1teuBcu+fBBPZ33sidxitc6ErhON3JNavaH8HlswhWMC3s5rgZpM4MtPqQ==","cpu": ["x64"],@@ -7198,9 +7162,9 @@]},"node_modules/@rollup/rollup-linux-x64-musl": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz",- "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.1.tgz",+ "integrity": "sha512-7/XVZqgBby2qp/cO0TQ8uJK+9xnSdJ9ct6gSDdEr4MfABrjTyrW6Bau7HQ73a2a5tPB7hno49A0y1jhWGDN9OQ==","cpu": ["x64"],@@ -7210,9 +7174,9 @@]},"node_modules/@rollup/rollup-win32-arm64-msvc": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz",- "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.1.tgz",+ "integrity": "sha512-CYc64bnICG42UPL7TrhIwsJW4QcKkIt9gGlj21gq3VV0LL6XNb1yAdHVp1pIi9gkts9gGcT3OfUYHjGP7ETAiw==","cpu": ["arm64"],@@ -7222,9 +7186,9 @@]},"node_modules/@rollup/rollup-win32-ia32-msvc": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz",- "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.1.tgz",+ "integrity": "sha512-LN+vnlZ9g0qlHGlS920GR4zFCqAwbv2lULrR29yGaWP9u7wF5L7GqWu9Ah6/kFZPXPUkpdZwd//TNR+9XC9hvA==","cpu": ["ia32"],@@ -7234,9 +7198,9 @@]},"node_modules/@rollup/rollup-win32-x64-msvc": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz",- "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.1.tgz",+ "integrity": "sha512-n+vkrSyphvmU0qkQ6QBNXCGr2mKjhP08mPRM/Xp5Ck2FV4NrHU+y6axzDeixUrCBHVUS51TZhjqrKBBsHLKb2Q==","cpu": ["x64"],@@ -7635,6 +7599,24 @@"node": ">=12"}},+ "node_modules/@testing-library/react": {+ "version": "13.4.0",+ "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-13.4.0.tgz",+ "integrity": "sha512-sXOGON+WNTh3MLE9rve97ftaZukN3oNf2KjDy7YTx6hcTO2uuLHuCGynMDhFwGw/jYf4OJ2Qk0i4i79qMNNkyw==",+ "dev": true,+ "dependencies": {+ "@babel/runtime": "^7.12.5",+ "@testing-library/dom": "^8.5.0",+ "@types/react-dom": "^18.0.0"+ },+ "engines": {+ "node": ">=12"+ },+ "peerDependencies": {+ "react": "^18.0.0",+ "react-dom": "^18.0.0"+ }+ },"node_modules/@theguild/remark-mermaid": {"version": "0.0.5","resolved": "https://registry.npmjs.org/@theguild/remark-mermaid/-/remark-mermaid-0.0.5.tgz",@@ -8905,6 +8887,12 @@"node": ">= 10"}},+ "node_modules/@types/jest/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",+ "dev": true+ },"node_modules/@types/js-yaml": {"version": "4.0.9","resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz",@@ -8938,6 +8926,15 @@"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz","integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ=="},+ "node_modules/@types/lodash.get": {+ "version": "4.4.9",+ "resolved": "https://registry.npmjs.org/@types/lodash.get/-/lodash.get-4.4.9.tgz",+ "integrity": "sha512-J5dvW98sxmGnamqf+/aLP87PYXyrha9xIgc2ZlHl6OHMFR2Ejdxep50QfU0abO1+CH6+ugx+8wEUN1toImAinA==",+ "dev": true,+ "dependencies": {+ "@types/lodash": "*"+ }+ },"node_modules/@types/lodash.template": {"version": "4.5.3","resolved": "https://registry.npmjs.org/@types/lodash.template/-/lodash.template-4.5.3.tgz",@@ -8966,9 +8963,9 @@"integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g=="},"node_modules/@types/node": {- "version": "18.19.20",- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.20.tgz",- "integrity": "sha512-SKXZvI375jkpvAj8o+5U2518XQv76mAsixqfXiVyWyXZbVWQK25RurFovYpVIxVzul0rZoH58V/3SkEnm7s3qA==",+ "version": "18.19.22",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.22.tgz",+ "integrity": "sha512-p3pDIfuMg/aXBmhkyanPshdfJuX5c5+bQjYLIikPLXAUycEogij/c50n/C+8XOA5L93cU4ZRXtn+dNQGi0IZqQ==","dependencies": {"undici-types": "~5.26.4"}@@ -8993,16 +8990,6 @@"integrity": "sha512-k7kRA033QNtC+gLc4VPlfnue58CM1iQLgn1IMAU8VPHGOj7oIHPp9UlhedEnD/Gl8evoCjwkZjlBORtZ3JByUA==","dev": true},- "node_modules/@types/object.omit": {- "version": "3.0.3",- "resolved": "https://registry.npmjs.org/@types/object.omit/-/object.omit-3.0.3.tgz",- "integrity": "sha512-xrq4bQTBGYY2cw+gV4PzoG2Lv3L0pjZ1uXStRRDQoATOYW1lCsFQHhQ+OkPhIcQoqLjAq7gYif7D14Qaa6Zbew=="- },- "node_modules/@types/object.pick": {- "version": "1.3.4",- "resolved": "https://registry.npmjs.org/@types/object.pick/-/object.pick-1.3.4.tgz",- "integrity": "sha512-5PjwB0uP2XDp3nt5u5NJAG2DORHIRClPzWT/TTZhJ2Ekwe8M5bA9tvPdi9NO/n2uvu2/ictat8kgqvLfcIE1SA=="- },"node_modules/@types/phoenix": {"version": "1.6.4","resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.4.tgz",@@ -9019,9 +9006,9 @@"integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng=="},"node_modules/@types/react": {- "version": "18.2.60",- "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.60.tgz",- "integrity": "sha512-dfiPj9+k20jJrLGOu9Nf6eqxm2EyJRrq2NvwOFsfbb7sFExZ9WELPs67UImHj3Ayxg8ruTtKtNnbjaF8olPq0A==",+ "version": "18.2.64",+ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.64.tgz",+ "integrity": "sha512-MlmPvHgjj2p3vZaxbQgFUQFvD8QiZwACfGqEdDSWou5yISWxDQ4/74nCAwsUiX7UFLKZz3BbVSPj+YxeoGGCfg==","dependencies": {"@types/prop-types": "*","@types/scheduler": "*",@@ -9029,9 +9016,9 @@}},"node_modules/@types/react-dom": {- "version": "18.2.19",- "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.19.tgz",- "integrity": "sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==",+ "version": "18.2.21",+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.21.tgz",+ "integrity": "sha512-gnvBA/21SA4xxqNXEwNiVcP0xSGHh/gi1VhWv9Bl46a0ItbTT5nFY+G9VSQpaG/8N/qdJpJ+vftQ4zflTtnjLw==","devOptional": true,"dependencies": {"@types/react": "*"@@ -9074,10 +9061,17 @@"resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz","integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw=="},- "node_modules/@types/throttle-debounce": {- "version": "2.1.0",- "resolved": "https://registry.npmjs.org/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz",- "integrity": "sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ=="+ "node_modules/@types/strip-bom": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz",+ "integrity": "sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==",+ "dev": true+ },+ "node_modules/@types/strip-json-comments": {+ "version": "0.0.30",+ "resolved": "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz",+ "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==",+ "dev": true},"node_modules/@types/tinycolor2": {"version": "1.4.6",@@ -10150,6 +10144,24 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/array.prototype.findlast": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.4.tgz",+ "integrity": "sha512-BMtLxpV+8BD+6ZPFIWmnUBpQoy+A+ujcg4rhp2iwCRJYA7PEh2MS4NL3lz8EiDlLrJPp2hg9qWihr5pd//jcGw==",+ "dependencies": {+ "call-bind": "^1.0.5",+ "define-properties": "^1.2.1",+ "es-abstract": "^1.22.3",+ "es-errors": "^1.3.0",+ "es-shim-unscopables": "^1.0.2"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },"node_modules/array.prototype.findlastindex": {"version": "1.2.4","resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.4.tgz",@@ -10202,6 +10214,17 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/array.prototype.toreversed": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/array.prototype.toreversed/-/array.prototype.toreversed-1.1.2.tgz",+ "integrity": "sha512-wwDCoT4Ck4Cz7sLtgUmzR5UV3YF5mFHUlbChCzZBQZ+0m2cl/DH3tKgvphv1nKgFsJ48oCSg6p91q2Vm0I/ZMA==",+ "dependencies": {+ "call-bind": "^1.0.2",+ "define-properties": "^1.2.0",+ "es-abstract": "^1.22.1",+ "es-shim-unscopables": "^1.0.0"+ }+ },"node_modules/array.prototype.tosorted": {"version": "1.1.3","resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.3.tgz",@@ -10600,12 +10623,12 @@}},"node_modules/body-parser": {- "version": "1.20.1",- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",- "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==",+ "version": "1.20.2",+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",+ "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==","dependencies": {"bytes": "3.1.2",- "content-type": "~1.0.4",+ "content-type": "~1.0.5","debug": "2.6.9","depd": "2.0.0","destroy": "1.2.0",@@ -10613,7 +10636,7 @@"iconv-lite": "0.4.24","on-finished": "2.4.1","qs": "6.11.0",- "raw-body": "2.5.1",+ "raw-body": "2.5.2","type-is": "~1.6.18","unpipe": "1.0.0"},@@ -11120,9 +11143,9 @@}},"node_modules/caniuse-lite": {- "version": "1.0.30001591",- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001591.tgz",- "integrity": "sha512-PCzRMei/vXjJyL5mJtzNiUCKP59dm8Apqc3PH8gJkMnMXZGox93RbE76jHsmLwmIo6/3nsYIpJtx0O7u5PqFuQ==",+ "version": "1.0.30001596",+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001596.tgz",+ "integrity": "sha512-zpkZ+kEr6We7w63ORkoJ2pOfBwBkY/bJrG/UZ90qNb45Isblu8wzDgevEOrRL1r9dWayHjYiiyCMEXPn4DweGQ==","funding": [{"type": "opencollective",@@ -11153,17 +11176,6 @@"resolved": "apps/carbon","link": true},- "node_modules/case-anything": {- "version": "2.1.13",- "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz",- "integrity": "sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==",- "engines": {- "node": ">=12.13"- },- "funding": {- "url": "https://github.com/sponsors/mesqueeb"- }- },"node_modules/ccount": {"version": "2.0.1","resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz",@@ -12850,11 +12862,6 @@"resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz","integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA=="},- "node_modules/dash-get": {- "version": "1.0.2",- "resolved": "https://registry.npmjs.org/dash-get/-/dash-get-1.0.2.tgz",- "integrity": "sha512-4FbVrHDwfOASx7uQVxeiCTo7ggSdYZbqs8lH+WU6ViypPlDbe9y6IP5VVUDQBv9DcnyaiPT5XT0UWHgJ64zLeQ=="- },"node_modules/data-uri-to-buffer": {"version": "4.0.1","resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",@@ -13515,9 +13522,9 @@"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="},"node_modules/electron-to-chromium": {- "version": "1.4.686",- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.686.tgz",- "integrity": "sha512-3avY1B+vUzNxEgkBDpKOP8WarvUAEwpRaiCL0He5OKWEFxzaOFiq4WoZEZe7qh0ReS7DiWoHMnYoQCKxNZNzSg=="+ "version": "1.4.698",+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.698.tgz",+ "integrity": "sha512-f9iZD1t3CLy1AS6vzM5EKGa6p9pRcOeEFXRFbaG2Ta+Oe7MkfRQ3fsvPYidzHe1h4i0JvIvpcY55C+B6BZNGtQ=="},"node_modules/elkjs": {"version": "0.9.2",@@ -14240,26 +14247,28 @@}},"node_modules/eslint-plugin-react": {- "version": "7.33.2",- "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz",- "integrity": "sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==",+ "version": "7.34.0",+ "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.0.tgz",+ "integrity": "sha512-MeVXdReleBTdkz/bvcQMSnCXGi+c9kvy51IpinjnJgutl3YTHWsDdke7Z1ufZpGfDG8xduBDKyjtB9JH1eBKIQ==","dependencies": {- "array-includes": "^3.1.6",- "array.prototype.flatmap": "^1.3.1",- "array.prototype.tosorted": "^1.1.1",+ "array-includes": "^3.1.7",+ "array.prototype.findlast": "^1.2.4",+ "array.prototype.flatmap": "^1.3.2",+ "array.prototype.toreversed": "^1.1.2",+ "array.prototype.tosorted": "^1.1.3","doctrine": "^2.1.0",- "es-iterator-helpers": "^1.0.12",+ "es-iterator-helpers": "^1.0.17","estraverse": "^5.3.0","jsx-ast-utils": "^2.4.1 || ^3.0.0","minimatch": "^3.1.2",- "object.entries": "^1.1.6",- "object.fromentries": "^2.0.6",- "object.hasown": "^1.1.2",- "object.values": "^1.1.6",+ "object.entries": "^1.1.7",+ "object.fromentries": "^2.0.7",+ "object.hasown": "^1.1.3",+ "object.values": "^1.1.7","prop-types": "^15.8.1",- "resolve": "^2.0.0-next.4",+ "resolve": "^2.0.0-next.5","semver": "^6.3.1",- "string.prototype.matchall": "^4.0.8"+ "string.prototype.matchall": "^4.0.10"},"engines": {"node": ">=4"@@ -14705,13 +14714,13 @@"integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw=="},"node_modules/express": {- "version": "4.18.2",- "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",- "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==",+ "version": "4.18.3",+ "resolved": "https://registry.npmjs.org/express/-/express-4.18.3.tgz",+ "integrity": "sha512-6VyCijWQ+9O7WuVMTRBTl+cjNNIzD5cY5mQ1WM8r/LEkI2u8EYpOotESNwzNlyCn3g+dmjKYI6BmNneSr/FSRw==","dependencies": {"accepts": "~1.3.8","array-flatten": "1.1.1",- "body-parser": "1.20.1",+ "body-parser": "1.20.2","content-disposition": "0.5.4","content-type": "~1.0.4","cookie": "0.5.0",@@ -14811,14 +14820,6 @@"node": ">=0.10.0"}},- "node_modules/extend-shallow/node_modules/is-extendable": {- "version": "0.1.1",- "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",- "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",- "engines": {- "node": ">=0.10.0"- }- },"node_modules/external-editor": {"version": "3.1.0","resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",@@ -15621,9 +15622,9 @@}},"node_modules/get-tsconfig": {- "version": "4.7.2",- "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz",- "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==",+ "version": "4.7.3",+ "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz",+ "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==","dependencies": {"resolve-pkg-maps": "^1.0.0"},@@ -17444,12 +17445,9 @@}},"node_modules/is-extendable": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",- "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",- "dependencies": {- "is-plain-object": "^2.0.4"- },+ "version": "0.1.1",+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",+ "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==","engines": {"node": ">=0.10.0"}@@ -18228,6 +18226,11 @@"node": ">= 10"}},+ "node_modules/jest-config/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ },"node_modules/jest-diff": {"version": "26.6.2","resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz",@@ -18256,6 +18259,11 @@"node": ">= 10"}},+ "node_modules/jest-diff/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ },"node_modules/jest-docblock": {"version": "26.0.0","resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz",@@ -18296,6 +18304,11 @@"node": ">= 10"}},+ "node_modules/jest-each/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ },"node_modules/jest-environment-jsdom": {"version": "26.6.2","resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz",@@ -18405,6 +18418,11 @@"node": ">= 10"}},+ "node_modules/jest-jasmine2/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ },"node_modules/jest-leak-detector": {"version": "26.6.2","resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz",@@ -18431,6 +18449,11 @@"node": ">= 10"}},+ "node_modules/jest-leak-detector/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ },"node_modules/jest-matcher-utils": {"version": "26.6.2","resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz",@@ -18459,6 +18482,11 @@"node": ">= 10"}},+ "node_modules/jest-matcher-utils/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ },"node_modules/jest-message-util": {"version": "26.6.2","resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz",@@ -18492,6 +18520,11 @@"node": ">= 10"}},+ "node_modules/jest-message-util/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ },"node_modules/jest-mock": {"version": "26.6.2","resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz",@@ -18719,6 +18752,11 @@"node": ">= 10"}},+ "node_modules/jest-snapshot/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ },"node_modules/jest-snapshot/node_modules/semver": {"version": "7.6.0","resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",@@ -18790,6 +18828,11 @@"node": ">= 10"}},+ "node_modules/jest-validate/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ },"node_modules/jest-watcher": {"version": "26.6.2","resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz",@@ -20575,9 +20618,9 @@}},"node_modules/mermaid": {- "version": "10.8.0",- "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.8.0.tgz",- "integrity": "sha512-9CzfSreRjdDJxX796+jW4zjEq0DVw5xVF0nWsqff8OTbrt+ml0TZ5PyYUjjUZJa2NYxYJZZXewEquxGiM8qZEA==",+ "version": "10.9.0",+ "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.9.0.tgz",+ "integrity": "sha512-swZju0hFox/B/qoLKK0rOxxgh8Cf7rJSfAUc1u8fezVihYMvrJAS45GzAxTVf4Q+xn9uMgitBcmWk7nWGXOs/g==","dependencies": {"@braintree/sanitize-url": "^6.0.1","@types/d3-scale": "^4.0.3",@@ -20590,6 +20633,7 @@"dayjs": "^1.11.7","dompurify": "^3.0.5","elkjs": "^0.9.0",+ "katex": "^0.16.9","khroma": "^2.0.0","lodash-es": "^4.17.21","mdast-util-from-markdown": "^1.3.0",@@ -21643,6 +21687,17 @@"node": ">=0.10.0"}},+ "node_modules/mixin-deep/node_modules/is-extendable": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",+ "dependencies": {+ "is-plain-object": "^2.0.4"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },"node_modules/mkdirp": {"version": "1.0.4","resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",@@ -21840,6 +21895,17 @@"node": ">=0.10.0"}},+ "node_modules/nanomatch/node_modules/is-extendable": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",+ "dependencies": {+ "is-plain-object": "^2.0.4"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },"node_modules/nanostores": {"version": "0.9.5","resolved": "https://registry.npmjs.org/nanostores/-/nanostores-0.9.5.tgz",@@ -22017,9 +22083,9 @@}},"node_modules/nextra": {- "version": "2.13.3",- "resolved": "https://registry.npmjs.org/nextra/-/nextra-2.13.3.tgz",- "integrity": "sha512-OBVuyQKh+oqrbVt0AosgNYnuReWuNrtJVEN7q18b/oEg2wEpuiq3UJfmIvGgOdNYc3zv3OYrzbcq7IhwtdHHEw==",+ "version": "2.13.4",+ "resolved": "https://registry.npmjs.org/nextra/-/nextra-2.13.4.tgz",+ "integrity": "sha512-7of2rSBxuUa3+lbMmZwG9cqgftcoNOVQLTT6Rxf3EhBR9t1EI7b43dted8YoqSNaigdE3j1CoyNkX8N/ZzlEpw==","dependencies": {"@headlessui/react": "^1.7.17","@mdx-js/mdx": "^2.3.0",@@ -22058,9 +22124,9 @@}},"node_modules/nextra-theme-docs": {- "version": "2.13.3",- "resolved": "https://registry.npmjs.org/nextra-theme-docs/-/nextra-theme-docs-2.13.3.tgz",- "integrity": "sha512-B6xrnR86Gg4GzV56AomSwtmvSyAvnJz1xKOGGav1XKxkwvC8QeI17jdt/CqiKyIObJ+5bLqSFiKhaAZ5DYQP3g==",+ "version": "2.13.4",+ "resolved": "https://registry.npmjs.org/nextra-theme-docs/-/nextra-theme-docs-2.13.4.tgz",+ "integrity": "sha512-2XOoMfwBCTYBt8ds4ZHftt9Wyf2XsykiNo02eir/XEYB+sGeUoE77kzqfidjEOKCSzOHYbK9BDMcg2+B/2vYRw==","dependencies": {"@headlessui/react": "^1.7.17","@popperjs/core": "^2.11.8",@@ -22078,7 +22144,7 @@},"peerDependencies": {"next": ">=9.5.3",- "nextra": "2.13.3",+ "nextra": "2.13.4","react": ">=16.13.1","react-dom": ">=16.13.1"}@@ -22835,9 +22901,9 @@}},"node_modules/npm-check-updates/node_modules/ini": {- "version": "4.1.1",- "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz",- "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==",+ "version": "4.1.2",+ "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.2.tgz",+ "integrity": "sha512-AMB1mvwR1pyBFY/nSevUX6y8nJWS63/SzUKD3JyQn97s4xgIdgQPT75IRouIiBAN4yLQBUShNYVW0+UG25daCw==","engines": {"node": "^14.17.0 || ^16.13.0 || >=18.0.0"}@@ -23492,17 +23558,6 @@"url": "https://github.com/sponsors/ljharb"}},- "node_modules/object.omit": {- "version": "3.0.0",- "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-3.0.0.tgz",- "integrity": "sha512-EO+BCv6LJfu+gBIF3ggLicFebFLN5zqzz/WWJlMFfkMyGth+oBkhxzDl0wx2W4GkLzuQs/FsSkXZb2IMWQqmBQ==",- "dependencies": {- "is-extendable": "^1.0.0"- },- "engines": {- "node": ">=0.10.0"- }- },"node_modules/object.pick": {"version": "1.3.0","resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",@@ -24591,9 +24646,9 @@}},"node_modules/postcss-load-config/node_modules/yaml": {- "version": "2.4.0",- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.0.tgz",- "integrity": "sha512-j9iR8g+/t0lArF4V6NE/QCfT+CO7iLqrXAHZbJdo+LfjqP1vR8Fg5bSiaq6Q2lOD1AUEVrEVIgABvBFYojJVYQ==",+ "version": "2.4.1",+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz",+ "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==","bin": {"yaml": "bin.mjs"},@@ -24796,6 +24851,11 @@"url": "https://github.com/chalk/ansi-styles?sponsor=1"}},+ "node_modules/pretty-format/node_modules/react-is": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ },"node_modules/pretty-ms": {"version": "7.0.1","resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz",@@ -24906,11 +24966,6 @@"react-is": "^16.13.1"}},- "node_modules/prop-types/node_modules/react-is": {- "version": "16.13.1",- "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",- "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="- },"node_modules/property-information": {"version": "6.4.1","resolved": "https://registry.npmjs.org/property-information/-/property-information-6.4.1.tgz",@@ -25053,9 +25108,9 @@}},"node_modules/prosemirror-tables": {- "version": "1.3.5",- "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.3.5.tgz",- "integrity": "sha512-JSZ2cCNlApu/ObAhdPyotrjBe2cimniniTpz60YXzbL0kZ+47nEYk2LWbfKU2lKpBkUNquta2PjteoNi4YCluQ==",+ "version": "1.3.7",+ "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.3.7.tgz",+ "integrity": "sha512-oEwX1wrziuxMtwFvdDWSFHVUWrFJWt929kVVfHvtTi8yvw+5ppxjXZkMG/fuTdFo+3DXyIPSKfid+Be1npKXDA==","dependencies": {"prosemirror-keymap": "^1.1.2","prosemirror-model": "^1.8.1",@@ -25065,12 +25120,11 @@}},"node_modules/prosemirror-trailing-node": {- "version": "2.0.7",- "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-2.0.7.tgz",- "integrity": "sha512-8zcZORYj/8WEwsGo6yVCRXFMOfBo0Ub3hCUvmoWIZYfMP26WqENU0mpEP27w7mt8buZWuGrydBewr0tOArPb1Q==",+ "version": "2.0.8",+ "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-2.0.8.tgz",+ "integrity": "sha512-ujRYhSuhQb1Jsarh1IHqb2KoSnRiD7wAMDGucP35DN7j5af6X7B18PfdPIrbwsPTqIAj0fyOvxbuPsWhNvylmA==","dependencies": {"@remirror/core-constants": "^2.0.2",- "@remirror/core-helpers": "^3.0.0","escape-string-regexp": "^4.0.0"},"peerDependencies": {@@ -25306,9 +25360,9 @@}},"node_modules/raw-body": {- "version": "2.5.1",- "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",- "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",+ "version": "2.5.2",+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",+ "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==","dependencies": {"bytes": "3.1.2","http-errors": "2.0.0",@@ -25466,14 +25520,6 @@"react": "^18.2.0"}},- "node_modules/react-dom/node_modules/scheduler": {- "version": "0.23.0",- "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",- "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",- "dependencies": {- "loose-envify": "^1.1.0"- }- },"node_modules/react-icons": {"version": "4.12.0","resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.12.0.tgz",@@ -25483,9 +25529,9 @@}},"node_modules/react-is": {- "version": "17.0.2",- "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",- "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="+ "version": "16.13.1",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",+ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="},"node_modules/react-phone-number-input": {"version": "3.3.9",@@ -26017,6 +26063,17 @@"node": ">=0.10.0"}},+ "node_modules/regex-not/node_modules/is-extendable": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",+ "dependencies": {+ "is-plain-object": "^2.0.4"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },"node_modules/regexp.prototype.flags": {"version": "1.5.2","resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz",@@ -26364,9 +26421,9 @@}},"node_modules/remeda": {- "version": "1.45.2",- "resolved": "https://registry.npmjs.org/remeda/-/remeda-1.45.2.tgz",- "integrity": "sha512-gTdjazj1ZBgAj3xhZ76J/um5hyTP7yy5Odl1Z5/idQZ4Q5SmcuHjkzYyCZ/Kh9EN1V3wlHeFQB9WWV9BCfyM3A=="+ "version": "1.47.0",+ "resolved": "https://registry.npmjs.org/remeda/-/remeda-1.47.0.tgz",+ "integrity": "sha512-NhB81y1itYfqF4AYnZW5nq/ukkVtuWrEmmowkkF6MSjSdjiQpYo0khK/h4mNSWjZX50WZHOU5sX80Bd2mw2RRQ=="},"node_modules/remix-flat-routes": {"version": "0.5.12",@@ -26402,43 +26459,6 @@"node": ">=10"}},- "node_modules/remix-validated-form": {- "version": "5.1.5",- "resolved": "https://registry.npmjs.org/remix-validated-form/-/remix-validated-form-5.1.5.tgz",- "integrity": "sha512-v27JGzhOMGREyvPIDAgjhywfVYahe3CC4EXGIzJbwZfXnq7GFju5f/yNmyUyQLeYcOmU6uhzq+vwDJDOiXjvBA==",- "dependencies": {- "immer": "^9.0.12",- "lodash.get": "^4.4.2",- "nanoid": "3.3.6",- "react": "^18.1.0",- "remeda": "^1.2.0",- "tiny-invariant": "^1.2.0",- "zustand": "^4.3.0"- },- "peerDependencies": {- "@remix-run/node": ">= 1.16.1",- "@remix-run/react": ">= 1.15.0",- "@remix-run/server-runtime": ">= 1.16.1",- "react": "^17.0.2 || ^18.0.0"- }- },- "node_modules/remix-validated-form/node_modules/nanoid": {- "version": "3.3.6",- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",- "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",- "funding": [- {- "type": "github",- "url": "https://github.com/sponsors/ai"- }- ],- "bin": {- "nanoid": "bin/nanoid.cjs"- },- "engines": {- "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"- }- },"node_modules/remote-git-tags": {"version": "3.0.0","resolved": "https://registry.npmjs.org/remote-git-tags/-/remote-git-tags-3.0.0.tgz",@@ -26958,6 +26978,17 @@"node": ">=6"}},+ "node_modules/sane/node_modules/is-extendable": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",+ "dependencies": {+ "is-plain-object": "^2.0.4"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },"node_modules/sane/node_modules/is-number": {"version": "3.0.0","resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",@@ -27116,12 +27147,11 @@}},"node_modules/scheduler": {- "version": "0.17.0",- "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.17.0.tgz",- "integrity": "sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA==",+ "version": "0.23.0",+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",+ "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==","dependencies": {- "loose-envify": "^1.1.0",- "object-assign": "^4.1.1"+ "loose-envify": "^1.1.0"}},"node_modules/scroll-into-view-if-needed": {@@ -27321,14 +27351,6 @@"node": ">=0.10.0"}},- "node_modules/set-value/node_modules/is-extendable": {- "version": "0.1.1",- "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",- "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",- "engines": {- "node": ">=0.10.0"- }- },"node_modules/setprototypeof": {"version": "1.2.0","resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",@@ -27380,11 +27402,11 @@}},"node_modules/side-channel": {- "version": "1.0.5",- "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz",- "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==",+ "version": "1.0.6",+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",+ "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==","dependencies": {- "call-bind": "^1.0.6",+ "call-bind": "^1.0.7","es-errors": "^1.3.0","get-intrinsic": "^1.2.4","object-inspect": "^1.13.1"@@ -27691,9 +27713,9 @@}},"node_modules/sonner": {- "version": "1.4.2",- "resolved": "https://registry.npmjs.org/sonner/-/sonner-1.4.2.tgz",- "integrity": "sha512-x3Kfzfhb56V/ErvUnH5dZcsu6QkZpyIlRAogO4vAbN+AkBsA/8CFqOV+5djqbE5pQCpejtO4JBWL1zRj2sO/Vg==",+ "version": "1.4.3",+ "resolved": "https://registry.npmjs.org/sonner/-/sonner-1.4.3.tgz",+ "integrity": "sha512-SArYlHbkjqRuLiR0iGY2ZSr09oOrxw081ZZkQPfXrs8aZQLIBOLOdzTYxGJB5yIZ7qL56UEPmrX1YqbODwG0Lw==","peerDependencies": {"react": "^18.0.0","react-dom": "^18.0.0"@@ -27839,6 +27861,17 @@"node": ">=0.10.0"}},+ "node_modules/split-string/node_modules/is-extendable": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",+ "dependencies": {+ "is-plain-object": "^2.0.4"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },"node_modules/sprintf-js": {"version": "1.1.3","resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",@@ -28639,14 +28672,6 @@"resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz","integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA=="},- "node_modules/throttle-debounce": {- "version": "3.0.1",- "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-3.0.1.tgz",- "integrity": "sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg==",- "engines": {- "node": ">=10"- }- },"node_modules/through2": {"version": "2.0.5","resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",@@ -28889,6 +28914,17 @@"node": ">=0.10.0"}},+ "node_modules/to-regex/node_modules/is-extendable": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",+ "dependencies": {+ "is-plain-object": "^2.0.4"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },"node_modules/toidentifier": {"version": "1.0.1","resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",@@ -29002,6 +29038,12 @@"resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz","integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="},+ "node_modules/ts-toolbelt": {+ "version": "9.6.0",+ "resolved": "https://registry.npmjs.org/ts-toolbelt/-/ts-toolbelt-9.6.0.tgz",+ "integrity": "sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w==",+ "dev": true+ },"node_modules/tsafe": {"version": "1.6.6","resolved": "https://registry.npmjs.org/tsafe/-/tsafe-1.6.6.tgz",@@ -29026,6 +29068,18 @@}}},+ "node_modules/tsconfig": {+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz",+ "integrity": "sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==",+ "dev": true,+ "dependencies": {+ "@types/strip-bom": "^3.0.0",+ "@types/strip-json-comments": "0.0.30",+ "strip-bom": "^3.0.0",+ "strip-json-comments": "^2.0.0"+ }+ },"node_modules/tsconfig-paths": {"version": "4.2.0","resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz",@@ -29039,6 +29093,15 @@"node": ">=6"}},+ "node_modules/tsconfig/node_modules/strip-json-comments": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",+ "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",+ "dev": true,+ "engines": {+ "node": ">=0.10.0"+ }+ },"node_modules/tslib": {"version": "2.6.2","resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",@@ -29702,26 +29765,26 @@}},"node_modules/turbo": {- "version": "1.12.4",- "resolved": "https://registry.npmjs.org/turbo/-/turbo-1.12.4.tgz",- "integrity": "sha512-yUJ7elEUSToiGwFZogXpYKJpQ0BvaMbkEuQECIWtkBLcmWzlMOt6bActsIm29oN83mRU0WbzGt4e8H1KHWedhg==",+ "version": "1.12.5",+ "resolved": "https://registry.npmjs.org/turbo/-/turbo-1.12.5.tgz",+ "integrity": "sha512-FATU5EnhrYG8RvQJYFJnDd18DpccDjyvd53hggw9T9JEg9BhWtIEoeaKtBjYbpXwOVrJQMDdXcIB4f2nD3QPPg==","dev": true,"bin": {"turbo": "bin/turbo"},"optionalDependencies": {- "turbo-darwin-64": "1.12.4",- "turbo-darwin-arm64": "1.12.4",- "turbo-linux-64": "1.12.4",- "turbo-linux-arm64": "1.12.4",- "turbo-windows-64": "1.12.4",- "turbo-windows-arm64": "1.12.4"+ "turbo-darwin-64": "1.12.5",+ "turbo-darwin-arm64": "1.12.5",+ "turbo-linux-64": "1.12.5",+ "turbo-linux-arm64": "1.12.5",+ "turbo-windows-64": "1.12.5",+ "turbo-windows-arm64": "1.12.5"}},"node_modules/turbo-darwin-64": {- "version": "1.12.4",- "resolved": "https://registry.npmjs.org/turbo-darwin-64/-/turbo-darwin-64-1.12.4.tgz",- "integrity": "sha512-dBwFxhp9isTa9RS/fz2gDVk5wWhKQsPQMozYhjM7TT4jTrnYn0ZJMzr7V3B/M/T8QF65TbniW7w1gtgxQgX5Zg==",+ "version": "1.12.5",+ "resolved": "https://registry.npmjs.org/turbo-darwin-64/-/turbo-darwin-64-1.12.5.tgz",+ "integrity": "sha512-0GZ8reftwNQgIQLHkHjHEXTc/Z1NJm+YjsrBP+qhM/7yIZ3TEy9gJhuogDt2U0xIWwFgisTyzbtU7xNaQydtoA==","cpu": ["x64"],@@ -29732,9 +29795,9 @@]},"node_modules/turbo-darwin-arm64": {- "version": "1.12.4",- "resolved": "https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-1.12.4.tgz",- "integrity": "sha512-1Uo5iI6xsJ1j9ObsqxYRsa3W26mEbUe6fnj4rQYV6kDaqYD54oAMJ6hM53q9rB8JvFxwdrUXGp3PwTw9A0qqkA==",+ "version": "1.12.5",+ "resolved": "https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-1.12.5.tgz",+ "integrity": "sha512-8WpOLNNzvH6kohQOjihD+gaWL+ZFNfjvBwhOF0rjEzvW+YR3Pa7KjhulrjWyeN2yMFqAPubTbZIGOz1EVXLuQA==","cpu": ["arm64"],@@ -29745,9 +29808,9 @@]},"node_modules/turbo-linux-64": {- "version": "1.12.4",- "resolved": "https://registry.npmjs.org/turbo-linux-64/-/turbo-linux-64-1.12.4.tgz",- "integrity": "sha512-ONg2aSqKP7LAQOg7ysmU5WpEQp4DGNxSlAiR7um+LKtbmC/UxogbR5+T+Uuq6zGuQ5kJyKjWJ4NhtvUswOqBsA==",+ "version": "1.12.5",+ "resolved": "https://registry.npmjs.org/turbo-linux-64/-/turbo-linux-64-1.12.5.tgz",+ "integrity": "sha512-INit73+bNUpwqGZCxgXCR3I+cQsdkQ3/LkfkgSOibkpg+oGqxJRzeXw3sp990d7SCoE8QOcs3iw+PtiFX/LDAA==","cpu": ["x64"],@@ -29758,9 +29821,9 @@]},"node_modules/turbo-linux-arm64": {- "version": "1.12.4",- "resolved": "https://registry.npmjs.org/turbo-linux-arm64/-/turbo-linux-arm64-1.12.4.tgz",- "integrity": "sha512-9FPufkwdgfIKg/9jj87Cdtftw8o36y27/S2vLN7FTR2pp9c0MQiTBOLVYadUr1FlShupddmaMbTkXEhyt9SdrA==",+ "version": "1.12.5",+ "resolved": "https://registry.npmjs.org/turbo-linux-arm64/-/turbo-linux-arm64-1.12.5.tgz",+ "integrity": "sha512-6lkRBvxtI/GQdGtaAec9LvVQUoRw6nXFp0kM+Eu+5PbZqq7yn6cMkgDJLI08zdeui36yXhone8XGI8pHg8bpUQ==","cpu": ["arm64"],@@ -29771,9 +29834,9 @@]},"node_modules/turbo-windows-64": {- "version": "1.12.4",- "resolved": "https://registry.npmjs.org/turbo-windows-64/-/turbo-windows-64-1.12.4.tgz",- "integrity": "sha512-2mOtxHW5Vjh/5rDVu/aFwsMzI+chs8XcEuJHlY1sYOpEymYTz+u6AXbnzRvwZFMrLKr7J7fQOGl+v96sLKbNdA==",+ "version": "1.12.5",+ "resolved": "https://registry.npmjs.org/turbo-windows-64/-/turbo-windows-64-1.12.5.tgz",+ "integrity": "sha512-gQYbOhZg5Ww0bQ/bC0w/4W6yQRwBumUUnkB+QPo15VznwxZe2a7bo6JM+9Xy9dKLa/kn+p7zTqme4OEp6M3/Yg==","cpu": ["x64"],@@ -29784,9 +29847,9 @@]},"node_modules/turbo-windows-arm64": {- "version": "1.12.4",- "resolved": "https://registry.npmjs.org/turbo-windows-arm64/-/turbo-windows-arm64-1.12.4.tgz",- "integrity": "sha512-nOY5wae9qnxPOpT1fRuYO0ks6dTwpKMPV6++VkDkamFDLFHUDVM/9kmD2UTeh1yyrKnrZksbb9zmShhmfj1wog==",+ "version": "1.12.5",+ "resolved": "https://registry.npmjs.org/turbo-windows-arm64/-/turbo-windows-arm64-1.12.5.tgz",+ "integrity": "sha512-auvhZ9FrhnvQ4mgBlY9O68MT4dIfprYGvd2uPICba/mHUZZvVy5SGgbHJ0KbMwaJfnnFoPgLJO6M+3N2gDprKw==","cpu": ["arm64"],@@ -29916,9 +29979,9 @@}},"node_modules/typescript": {- "version": "5.3.3",- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",- "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",+ "version": "5.4.2",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz",+ "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==","bin": {"tsc": "bin/tsc","tsserver": "bin/tsserver"@@ -29928,9 +29991,9 @@}},"node_modules/uc.micro": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.0.0.tgz",- "integrity": "sha512-DffL94LsNOccVn4hyfRe5rdKa273swqeA5DJpMOeFmEn1wCDc7nAbbB0gXlgBCL7TNzeTv6G7XVWzan7iJtfig=="+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz",+ "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A=="},"node_modules/ufo": {"version": "1.4.0",@@ -30069,14 +30132,6 @@"node": ">=0.10.0"}},- "node_modules/union-value/node_modules/is-extendable": {- "version": "0.1.1",- "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",- "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",- "engines": {- "node": ">=0.10.0"- }- },"node_modules/unique-filename": {"version": "3.0.0","resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz",@@ -30560,11 +30615,11 @@"integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ=="},"node_modules/url/node_modules/qs": {- "version": "6.11.2",- "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz",- "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==",+ "version": "6.12.0",+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz",+ "integrity": "sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==","dependencies": {- "side-channel": "^1.0.4"+ "side-channel": "^1.0.6"},"engines": {"node": ">=0.6"@@ -30903,9 +30958,9 @@}},"node_modules/vite": {- "version": "5.1.4",- "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz",- "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==",+ "version": "5.1.5",+ "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz",+ "integrity": "sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==","dependencies": {"esbuild": "^0.19.3","postcss": "^8.4.35",@@ -31358,9 +31413,9 @@}},"node_modules/vite/node_modules/rollup": {- "version": "4.12.0",- "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz",- "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==",+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.1.tgz",+ "integrity": "sha512-ggqQKvx/PsB0FaWXhIvVkSWh7a/PCLQAsMjBc+nA2M8Rv2/HG0X6zvixAB7KyZBRtifBUhy5k8voQX/mRnABPg==","dependencies": {"@types/estree": "1.0.5"},@@ -31372,19 +31427,19 @@"npm": ">=8.0.0"},"optionalDependencies": {- "@rollup/rollup-android-arm-eabi": "4.12.0",- "@rollup/rollup-android-arm64": "4.12.0",- "@rollup/rollup-darwin-arm64": "4.12.0",- "@rollup/rollup-darwin-x64": "4.12.0",- "@rollup/rollup-linux-arm-gnueabihf": "4.12.0",- "@rollup/rollup-linux-arm64-gnu": "4.12.0",- "@rollup/rollup-linux-arm64-musl": "4.12.0",- "@rollup/rollup-linux-riscv64-gnu": "4.12.0",- "@rollup/rollup-linux-x64-gnu": "4.12.0",- "@rollup/rollup-linux-x64-musl": "4.12.0",- "@rollup/rollup-win32-arm64-msvc": "4.12.0",- "@rollup/rollup-win32-ia32-msvc": "4.12.0",- "@rollup/rollup-win32-x64-msvc": "4.12.0",+ "@rollup/rollup-android-arm-eabi": "4.12.1",+ "@rollup/rollup-android-arm64": "4.12.1",+ "@rollup/rollup-darwin-arm64": "4.12.1",+ "@rollup/rollup-darwin-x64": "4.12.1",+ "@rollup/rollup-linux-arm-gnueabihf": "4.12.1",+ "@rollup/rollup-linux-arm64-gnu": "4.12.1",+ "@rollup/rollup-linux-arm64-musl": "4.12.1",+ "@rollup/rollup-linux-riscv64-gnu": "4.12.1",+ "@rollup/rollup-linux-x64-gnu": "4.12.1",+ "@rollup/rollup-linux-x64-musl": "4.12.1",+ "@rollup/rollup-win32-arm64-msvc": "4.12.1",+ "@rollup/rollup-win32-ia32-msvc": "4.12.1",+ "@rollup/rollup-win32-x64-msvc": "4.12.1","fsevents": "~2.3.2"}},@@ -32038,9 +32093,9 @@}},"node_modules/zustand": {- "version": "4.5.1",- "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.1.tgz",- "integrity": "sha512-XlauQmH64xXSC1qGYNv00ODaQ3B+tNPoy22jv2diYiP4eoDKr9LA+Bh5Bc3gplTrFdb6JVI+N4kc1DZ/tbtfPg==",+ "version": "4.5.2",+ "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.2.tgz",+ "integrity": "sha512-2cN1tPkDVkwCy5ickKrI7vijSjPksFRfqS6237NzT0vqSsztTNnQdHw9mmN7uBdk3gceVXU0a+21jFzFzAc9+g==","dependencies": {"use-sync-external-store": "1.2.0"},@@ -32351,6 +32406,64 @@"typescript": "^5.2.2"}},+ "packages/remix-validated-form": {+ "name": "@carbon/remix-validated-form",+ "version": "*",+ "license": "MIT",+ "dependencies": {+ "immer": "^9.0.12",+ "lodash.get": "^4.4.2",+ "nanoid": "3.3.6",+ "remeda": "^1.2.0",+ "tiny-invariant": "^1.2.0",+ "zustand": "^4.3.0"+ },+ "devDependencies": {+ "@testing-library/react": "^13.3.0",+ "@types/lodash.get": "^4.4.7",+ "@types/react": "^18.0.9",+ "fetch-blob": "^3.1.3",+ "ts-toolbelt": "^9.6.0",+ "tsconfig": "*",+ "typescript": "^4.8.4"+ },+ "peerDependencies": {+ "@remix-run/node": ">= 1.16.1 <3.0.0",+ "@remix-run/react": ">= 1.15.0 <3.0.0",+ "@remix-run/server-runtime": ">= 1.16.1 <3.0.0",+ "react": "^17.0.2 || ^18.0.0"+ }+ },+ "packages/remix-validated-form/node_modules/nanoid": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",+ "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "packages/remix-validated-form/node_modules/typescript": {+ "version": "4.9.5",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",+ "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",+ "dev": true,+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=4.2.0"+ }+ },"packages/tailwind": {"name": "@carbon/tailwind","version": "*",diff --git a/packages/database/package.json b/packages/database/package.jsonindex dee8a5e128..198384d60c 100644--- a/packages/database/package.json+++ b/packages/database/package.json@@ -28,7 +28,7 @@"clean": "rimraf .turbo node_modules dist","db:function:new": "supabase functions new","db:init": "supabase init",- "db:kill": "npx supabase@beta stop --no-backup",+ "db:kill": "npx --yes supabase@beta stop --no-backup","db:migrate": "supabase db reset","db:migrate:new": "supabase migration new","db:seed": "tsx src/seed.ts",diff --git a/packages/remix-validated-form/.eslintrc.js b/packages/remix-validated-form/.eslintrc.jsnew file mode 100644index 0000000000..1308cba140--- /dev/null+++ b/packages/remix-validated-form/.eslintrc.js@@ -0,0 +1,4 @@+module.exports = {+ root: true,+ extends: ["carbon"],+};diff --git a/packages/remix-validated-form/LICENSE b/packages/remix-validated-form/LICENSEnew file mode 100644index 0000000000..be404fc497--- /dev/null+++ b/packages/remix-validated-form/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2021 Aaron Pettengill++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/packages/remix-validated-form/package.json b/packages/remix-validated-form/package.jsonnew file mode 100644index 0000000000..e132bbf94b--- /dev/null+++ b/packages/remix-validated-form/package.json@@ -0,0 +1,46 @@+{+ "name": "@carbon/remix-validated-form",+ "peerDependencies": {+ "@remix-run/node": ">= 1.16.1 <3.0.0",+ "@remix-run/react": ">= 1.15.0 <3.0.0",+ "@remix-run/server-runtime": ">= 1.16.1 <3.0.0",+ "react": "^17.0.2 || ^18.0.0"+ },+ "devDependencies": {+ "@testing-library/react": "^13.3.0",+ "@types/lodash.get": "^4.4.7",+ "@types/react": "^18.0.9",+ "fetch-blob": "^3.1.3",+ "ts-toolbelt": "^9.6.0",+ "tsconfig": "*",+ "typescript": "^4.8.4"+ },+ "dependencies": {+ "immer": "^9.0.12",+ "lodash.get": "^4.4.2",+ "nanoid": "3.3.6",+ "remeda": "^1.2.0",+ "tiny-invariant": "^1.2.0",+ "zustand": "^4.3.0"+ },+ "files": [+ "dist/**"+ ],+ "jest": {+ "preset": "@carbon/jest/node"+ },+ "license": "MIT",+ "main": "./dist/index.js",+ "module": "./dist/index.mjs",+ "private": true,+ "scripts": {+ "build": "tsup src/index.tsx --format esm,cjs --dts --external react",+ "clean": "rimraf .turbo node_modules dist",+ "dev": "tsup src/index.tsx --format esm,cjs --watch --dts --external react",+ "lint": "TIMING=1 eslint \"src/**/*.ts*\"",+ "test": "jest"+ },+ "sideEffects": false,+ "types": "./dist/index.d.ts",+ "version": "*"+}diff --git a/packages/remix-validated-form/src/ValidatedForm.tsx b/packages/remix-validated-form/src/ValidatedForm.tsxnew file mode 100644index 0000000000..20987b53fc--- /dev/null+++ b/packages/remix-validated-form/src/ValidatedForm.tsx@@ -0,0 +1,439 @@+import type {+ FetcherWithComponents,+ FormEncType,+ FormMethod,+ SubmitOptions,+} from "@remix-run/react";+import { Form as RemixForm, useSubmit } from "@remix-run/react";+import type { ComponentProps, FormEvent, RefObject } from "react";+import React, {+ useCallback,+ useEffect,+ useMemo,+ useRef,+ useState,+} from "react";+import * as R from "remeda";+import { useIsSubmitting, useIsValid } from "./hooks";+import type { MultiValueMap } from "./internal/MultiValueMap";+import { useMultiValueMap } from "./internal/MultiValueMap";+import { FORM_ID_FIELD } from "./internal/constants";+import type { InternalFormContextValue } from "./internal/formContext";+import { InternalFormContext } from "./internal/formContext";+import {+ useDefaultValuesFromLoader,+ useErrorResponseForForm,+ useHasActiveFormSubmit,+ useSetFieldErrors,+} from "./internal/hooks";+import type { SyncedFormProps } from "./internal/state/createFormStore";+import { useRootFormStore } from "./internal/state/createFormStore";+import { useFormStore } from "./internal/state/storeHooks";+import { useSubmitComplete } from "./internal/submissionCallbacks";+import {+ mergeRefs,+ useDeepEqualsMemo,+ useIsomorphicLayoutEffect as useLayoutEffect,+} from "./internal/util";+import type { FieldErrors, Validator } from "./validation/types";++type DeepPartial<T> = T extends object+ ? {+ [P in keyof T]?: DeepPartial<T[P]>;+ }+ : T;++type SubactionData<+ DataType,+ Subaction extends string | undefined+> = DataType & { subaction: Subaction };++// Not all validation libraries support encoding a literal value in the schema type (e.g. yup).+// This condition here allows us to provide strictness for users who are using a validation library that does support it,+// but also allows us to support users who are using a validation library that doesn't support it.+type DataForSubaction<+ DataType,+ Subaction extends string | undefined+> = Subaction extends string // Not all validation libraries support encoding a literal value in the schema type.+ ? SubactionData<DataType, Subaction> extends undefined+ ? DataType+ : SubactionData<DataType, Subaction>+ : DataType;++export type FormProps<DataType, Subaction extends string | undefined> = {+ /**+ * A `Validator` object that describes how to validate the form.+ */+ validator: Validator<DataType>;+ /**+ * A submit callback that gets called when the form is submitted+ * after all validations have been run.+ */+ onSubmit?: (+ data: DataForSubaction<DataType, Subaction>,+ event: React.FormEvent<HTMLFormElement>+ ) => void | Promise<void>;+ /**+ * Allows you to provide a `fetcher` from Remix's `useFetcher` hook.+ * The form will use the fetcher for loading states, action data, etc+ * instead of the default form action.+ */+ fetcher?: FetcherWithComponents<any>;+ /**+ * Accepts an object of default values for the form+ * that will automatically be propagated to the form fields via `useField`.+ */+ defaultValues?: DeepPartial<DataForSubaction<DataType, Subaction>>;+ /**+ * A ref to the form element.+ */+ formRef?: React.RefObject<HTMLFormElement>;+ /**+ * An optional sub-action to use for the form.+ * Setting a value here will cause the form to be submitted with an extra `subaction` value.+ * This can be useful when there are multiple forms on the screen handled by the same action.+ */+ subaction?: Subaction;+ /**+ * Reset the form to the default values after the form has been successfully submitted.+ * This is useful if you want to submit the same form multiple times,+ * and don't redirect in-between submissions.+ */+ resetAfterSubmit?: boolean;+ /**+ * Normally, the first invalid input will be focused when the validation fails on form submit.+ * Set this to `false` to disable this behavior.+ */+ disableFocusOnError?: boolean;+} & Omit<ComponentProps<typeof RemixForm>, "onSubmit">;++const getDataFromForm = (el: HTMLFormElement) => new FormData(el);++function nonNull<T>(value: T | null | undefined): value is T {+ return value !== null;+}++const focusFirstInvalidInput = (+ fieldErrors: FieldErrors,+ customFocusHandlers: MultiValueMap<string, () => void>,+ formElement: HTMLFormElement+) => {+ // @ts-ignore+ const namesInOrder = [...formElement.elements]+ .map((el) => {+ const input = el instanceof RadioNodeList ? el[0] : el;+ if (input instanceof HTMLElement && "name" in input)+ return (input as any).name;+ return null;+ })+ .filter(nonNull)+ .filter((name) => name in fieldErrors);+ const uniqueNamesInOrder = R.uniq(namesInOrder);++ for (const fieldName of uniqueNamesInOrder) {+ if (customFocusHandlers.has(fieldName)) {+ customFocusHandlers.getAll(fieldName).forEach((handler) => {+ handler();+ });+ break;+ }++ const elem = formElement.elements.namedItem(fieldName);+ if (!elem) continue;++ if (elem instanceof RadioNodeList) {+ const selectedRadio =+ // @ts-ignore+ [...elem]+ .filter(+ (item): item is HTMLInputElement => item instanceof HTMLInputElement+ )+ .find((item) => item.value === elem.value) ?? elem[0];+ if (selectedRadio && selectedRadio instanceof HTMLInputElement) {+ selectedRadio.focus();+ break;+ }+ }++ if (elem instanceof HTMLElement) {+ if (elem instanceof HTMLInputElement && elem.type === "hidden") {+ continue;+ }++ elem.focus();+ break;+ }+ }+};++const useFormId = (providedId?: string): string | symbol => {+ // We can use a `Symbol` here because we only use it after hydration+ const [symbolId] = useState(() => Symbol("remix-validated-form-id"));+ return providedId ?? symbolId;+};++/**+ * Use a component to access the state so we don't cause+ * any extra rerenders of the whole form.+ */+const FormResetter = ({+ resetAfterSubmit,+ formRef,+}: {+ resetAfterSubmit: boolean;+ formRef: RefObject<HTMLFormElement>;+}) => {+ const isSubmitting = useIsSubmitting();+ const isValid = useIsValid();+ useSubmitComplete(isSubmitting, () => {+ if (isValid && resetAfterSubmit) {+ formRef.current?.reset();+ }+ });+ return null;+};++function formEventProxy<T extends object>(event: T): T {+ let defaultPrevented = false;+ return new Proxy(event, {+ get: (target, prop) => {+ if (prop === "preventDefault") {+ return () => {+ defaultPrevented = true;+ };+ }++ if (prop === "defaultPrevented") {+ return defaultPrevented;+ }++ return target[prop as keyof T];+ },+ }) as T;+}++type HTMLSubmitEvent = React.BaseSyntheticEvent<+ SubmitEvent,+ Event,+ HTMLFormElement+>;++type HTMLFormSubmitter = HTMLButtonElement | HTMLInputElement;++/**+ * The primary form component of `remix-validated-form`.+ */+export function ValidatedForm<+ DataType extends { [fieldName: string]: any },+ Subaction extends string | undefined+>({+ validator,+ onSubmit,+ children,+ fetcher,+ action,+ defaultValues: unMemoizedDefaults,+ formRef: formRefProp,+ onReset,+ subaction,+ resetAfterSubmit = false,+ disableFocusOnError,+ method,+ replace,+ id,+ preventScrollReset,+ relative,+ encType,+ ...rest+}: FormProps<DataType, Subaction>) {+ const formId = useFormId(id);+ const providedDefaultValues = useDeepEqualsMemo(unMemoizedDefaults);+ const contextValue = useMemo<InternalFormContextValue>(+ () => ({+ formId,+ action,+ subaction,+ defaultValuesProp: providedDefaultValues,+ fetcher,+ }),+ [action, fetcher, formId, providedDefaultValues, subaction]+ );+ const backendError = useErrorResponseForForm(contextValue);+ const backendDefaultValues = useDefaultValuesFromLoader(contextValue);+ const hasActiveSubmission = useHasActiveFormSubmit(contextValue);+ const formRef = useRef<HTMLFormElement>(null);+ const Form = fetcher?.Form ?? RemixForm;++ const submit = useSubmit();+ const setFieldErrors = useSetFieldErrors(formId);+ const setFieldError = useFormStore(formId, (state) => state.setFieldError);+ const reset = useFormStore(formId, (state) => state.reset);+ const startSubmit = useFormStore(formId, (state) => state.startSubmit);+ const endSubmit = useFormStore(formId, (state) => state.endSubmit);+ const syncFormProps = useFormStore(formId, (state) => state.syncFormProps);+ const setFormElementInState = useFormStore(+ formId,+ (state) => state.setFormElement+ );+ const cleanupForm = useRootFormStore((state) => state.cleanupForm);+ const registerForm = useRootFormStore((state) => state.registerForm);++ const customFocusHandlers = useMultiValueMap<string, () => void>();+ const registerReceiveFocus: SyncedFormProps["registerReceiveFocus"] =+ useCallback(+ (fieldName, handler) => {+ customFocusHandlers().add(fieldName, handler);+ return () => {+ customFocusHandlers().remove(fieldName, handler);+ };+ },+ [customFocusHandlers]+ );++ // TODO: all these hooks running at startup cause extra, unnecessary renders+ // There must be a nice way to avoid this.+ useLayoutEffect(() => {+ registerForm(formId);+ return () => cleanupForm(formId);+ }, [cleanupForm, formId, registerForm]);++ useLayoutEffect(() => {+ syncFormProps({+ action,+ defaultValues: providedDefaultValues ?? backendDefaultValues ?? {},+ subaction,+ registerReceiveFocus,+ validator,+ });+ }, [+ action,+ providedDefaultValues,+ registerReceiveFocus,+ subaction,+ syncFormProps,+ backendDefaultValues,+ validator,+ ]);++ useLayoutEffect(() => {+ setFormElementInState(formRef.current);+ }, [setFormElementInState]);++ useEffect(() => {+ setFieldErrors(backendError?.fieldErrors ?? {});+ if (!disableFocusOnError && backendError?.fieldErrors) {+ focusFirstInvalidInput(+ backendError.fieldErrors,+ customFocusHandlers(),+ formRef.current!+ );+ }+ }, [+ backendError?.fieldErrors,+ customFocusHandlers,+ disableFocusOnError,+ setFieldErrors,+ setFieldError,+ ]);++ useSubmitComplete(hasActiveSubmission, () => {+ endSubmit();+ });++ const handleSubmit = async (+ e: FormEvent<HTMLFormElement>,+ target: typeof e.currentTarget,+ nativeEvent: HTMLSubmitEvent["nativeEvent"]+ ) => {+ startSubmit();+ const submitter = nativeEvent.submitter as HTMLFormSubmitter | null;++ const isValidSubmit = submitter?.form === target;+ if (!isValidSubmit) {+ endSubmit();+ return;+ }++ const formMethod = (submitter?.formMethod as FormMethod) || method;+ const formData = getDataFromForm(target);+ if (submitter?.name) {+ formData.append(submitter.name, submitter.value);+ }++ const result = await validator.validate(formData);+ if (result.error) {+ setFieldErrors(result.error.fieldErrors);+ endSubmit();+ if (!disableFocusOnError) {+ focusFirstInvalidInput(+ result.error.fieldErrors,+ customFocusHandlers(),+ formRef.current!+ );+ }+ } else {+ setFieldErrors({});+ const eventProxy = formEventProxy(e);+ await onSubmit?.(result.data as any, eventProxy);+ if (eventProxy.defaultPrevented) {+ endSubmit();+ return;+ }++ const opts: SubmitOptions = {+ method: formMethod,+ replace,+ preventScrollReset,+ relative,+ action,+ encType: encType as FormEncType | undefined,+ };++ // We deviate from the Remix code here a bit because of our async submit.+ // In Remix's `FormImpl`, they use `event.currentTarget` to get the form,+ // but we already have the form in `formRef.current` so we can just use that.+ // If we use `event.currentTarget` here, it will break because `currentTarget`+ // will have changed since the start of the submission.+ if (fetcher) fetcher.submit(formData, opts);+ else submit(formData, opts);+ }+ };++ return (+ <Form+ ref={mergeRefs([formRef, formRefProp])}+ {...rest}+ id={id}+ action={action}+ method={method}+ encType={encType}+ replace={replace}+ preventScrollReset={preventScrollReset}+ relative={relative}+ onSubmit={(e) => {+ e.preventDefault();+ handleSubmit(+ e,+ e.currentTarget,+ (e as unknown as HTMLSubmitEvent).nativeEvent+ );+ }}+ onReset={(event) => {+ onReset?.(event);+ if (event.defaultPrevented) return;+ reset();+ }}+ >+ <InternalFormContext.Provider value={contextValue}>+ <>+ <FormResetter formRef={formRef} resetAfterSubmit={resetAfterSubmit} />+ {subaction && (+ <input type="hidden" value={subaction} name="subaction" />+ )}+ {id && <input type="hidden" value={id} name={FORM_ID_FIELD} />}+ {children}+ </>+ </InternalFormContext.Provider>+ </Form>+ );+}diff --git a/packages/remix-validated-form/src/hooks.ts b/packages/remix-validated-form/src/hooks.tsnew file mode 100644index 0000000000..3c1f429252--- /dev/null+++ b/packages/remix-validated-form/src/hooks.ts@@ -0,0 +1,160 @@+import { useEffect, useMemo } from "react";+import type {+ GetInputProps,+ ValidationBehaviorOptions,+} from "./internal/getInputProps";+import { createGetInputProps } from "./internal/getInputProps";+import {+ useClearError,+ useFieldDefaultValue,+ useFieldError,+ useFieldTouched,+ useInternalFormContext,+ useInternalHasBeenSubmitted,+ useInternalIsSubmitting,+ useInternalIsValid,+ useRegisterReceiveFocus,+ useSmartValidate,+} from "./internal/hooks";+import {+ useControllableValue,+ useUpdateControllableValue,+} from "./internal/state/controlledFields";++/**+ * Returns whether or not the parent form is currently being submitted.+ * This is different from Remix's `useNavigation()` in that it+ * is aware of what form it's in and when _that_ form is being submitted.+ *+ * @param formId+ */+export const useIsSubmitting = (formId?: string) => {+ const formContext = useInternalFormContext(formId, "useIsSubmitting");+ return useInternalIsSubmitting(formContext.formId);+};++/**+ * Returns whether or not the current form is valid.+ *+ * @param formId the id of the form. Only necessary if being used outside a ValidatedForm.+ */+export const useIsValid = (formId?: string) => {+ const formContext = useInternalFormContext(formId, "useIsValid");+ return useInternalIsValid(formContext.formId);+};++export type FieldProps = {+ /**+ * The validation error message if there is one.+ */+ error?: string;+ /**+ * Clears the error message.+ */+ clearError: () => void;+ /**+ * Validates the field.+ */+ validate: () => void;+ /**+ * The default value of the field, if there is one.+ */+ defaultValue?: any;+ /**+ * Whether or not the field has been touched.+ */+ touched: boolean;+ /**+ * Helper to set the touched state of the field.+ */+ setTouched: (touched: boolean) => void;+ /**+ * Helper to get all the props necessary for a regular input.+ */+ getInputProps: GetInputProps;+};++/**+ * Provides the data and helpers necessary to set up a field.+ */+export const useField = (+ name: string,+ options?: {+ /**+ * Allows you to configure a custom function that will be called+ * when the input needs to receive focus due to a validation error.+ * This is useful for custom components that use a hidden input.+ */+ handleReceiveFocus?: () => void;+ /**+ * Allows you to specify when a field gets validated (when using getInputProps)+ */+ validationBehavior?: Partial<ValidationBehaviorOptions>;+ /**+ * The formId of the form you want to use.+ * This is not necesary if the input is used inside a form.+ */+ formId?: string;+ }+): FieldProps => {+ const { formId: providedFormId, handleReceiveFocus } = options ?? {};+ const formContext = useInternalFormContext(providedFormId, "useField");++ const defaultValue = useFieldDefaultValue(name, formContext);+ const [touched, setTouched] = useFieldTouched(name, formContext);+ const error = useFieldError(name, formContext);+ const clearError = useClearError(formContext);++ const hasBeenSubmitted = useInternalHasBeenSubmitted(formContext.formId);+ const smartValidate = useSmartValidate(formContext.formId);+ const registerReceiveFocus = useRegisterReceiveFocus(formContext.formId);++ useEffect(() => {+ if (handleReceiveFocus)+ return registerReceiveFocus(name, handleReceiveFocus);+ }, [handleReceiveFocus, name, registerReceiveFocus]);++ const field = useMemo<FieldProps>(() => {+ const helpers = {+ error,+ clearError: () => clearError(name),+ validate: () => smartValidate({ alwaysIncludeErrorsFromFields: [name] }),+ defaultValue,+ touched,+ setTouched,+ };+ const getInputProps = createGetInputProps({+ ...helpers,+ name,+ hasBeenSubmitted,+ validationBehavior: options?.validationBehavior,+ });+ return {+ ...helpers,+ getInputProps,+ };+ }, [+ error,+ clearError,+ defaultValue,+ touched,+ setTouched,+ name,+ hasBeenSubmitted,+ options?.validationBehavior,+ smartValidate,+ ]);++ return field;+};++export const useControlField = <T>(name: string, formId?: string) => {+ const context = useInternalFormContext(formId, "useControlField");+ const [value, setValue] = useControllableValue(context, name);+ return [value as T, setValue as (value: T) => void] as const;+};++export const useUpdateControlledField = (formId?: string) => {+ const context = useInternalFormContext(formId, "useControlField");+ return useUpdateControllableValue(context.formId);+};diff --git a/packages/remix-validated-form/src/index.tsx b/packages/remix-validated-form/src/index.tsxnew file mode 100644index 0000000000..a53730ce9f--- /dev/null+++ b/packages/remix-validated-form/src/index.tsx@@ -0,0 +1,13 @@+export * from "./ValidatedForm";+export * from "./hooks";+export {+ FieldArray,+ useFieldArray,+ type FieldArrayHelpers,+ type FieldArrayProps,+} from "./internal/state/fieldArray";+export * from "./server";+export * from "./userFacingFormContext";+export * from "./validation/createValidator";+export * from "./validation/types";+export * from "./withZod";diff --git a/packages/remix-validated-form/src/internal/MultiValueMap.ts b/packages/remix-validated-form/src/internal/MultiValueMap.tsnew file mode 100644index 0000000000..98df609a23--- /dev/null+++ b/packages/remix-validated-form/src/internal/MultiValueMap.ts@@ -0,0 +1,44 @@+import { useCallback, useRef } from "react";++export class MultiValueMap<Key, Value> {+ private dict: Map<Key, Value[]> = new Map();++ add = (key: Key, value: Value) => {+ if (this.dict.has(key)) {+ this.dict.get(key)!.push(value);+ } else {+ this.dict.set(key, [value]);+ }+ };++ delete = (key: Key) => {+ this.dict.delete(key);+ };++ remove = (key: Key, value: Value) => {+ if (!this.dict.has(key)) return;+ const array = this.dict.get(key)!;+ const index = array.indexOf(value);+ if (index !== -1) array.splice(index, 1);+ if (array.length === 0) this.dict.delete(key);+ };++ getAll = (key: Key): Value[] => {+ return this.dict.get(key) ?? [];+ };++ entries = (): IterableIterator<[Key, Value[]]> => this.dict.entries();++ values = (): IterableIterator<Value[]> => this.dict.values();++ has = (key: Key): boolean => this.dict.has(key);+}++export const useMultiValueMap = <Key, Value>() => {+ const ref = useRef<MultiValueMap<Key, Value> | null>(null);+ return useCallback(() => {+ if (ref.current) return ref.current;+ ref.current = new MultiValueMap();+ return ref.current;+ }, []);+};diff --git a/packages/remix-validated-form/src/internal/constants.ts b/packages/remix-validated-form/src/internal/constants.tsnew file mode 100644index 0000000000..f6479a19ee--- /dev/null+++ b/packages/remix-validated-form/src/internal/constants.ts@@ -0,0 +1,4 @@+export const FORM_ID_FIELD = "__rvfInternalFormId" as const;+export const FORM_DEFAULTS_FIELD = "__rvfInternalFormDefaults" as const;+export const formDefaultValuesKey = (formId: string) =>+ `${FORM_DEFAULTS_FIELD}_${formId}`;diff --git a/packages/remix-validated-form/src/internal/flatten.ts b/packages/remix-validated-form/src/internal/flatten.tsnew file mode 100644index 0000000000..f052225384--- /dev/null+++ b/packages/remix-validated-form/src/internal/flatten.ts@@ -0,0 +1,12 @@+import { setPath } from "../utils";+import { MultiValueMap } from "./MultiValueMap";++export const objectFromPathEntries = (entries: [string, any][]) => {+ const map = new MultiValueMap<string, any>();+ entries.forEach(([key, value]) => map.add(key, value));+ return [...map.entries()].reduce(+ (acc, [key, value]) =>+ setPath(acc, key, value.length === 1 ? value[0] : value),+ {} as Record<string, any>+ );+};diff --git a/packages/remix-validated-form/src/internal/formContext.ts b/packages/remix-validated-form/src/internal/formContext.tsnew file mode 100644index 0000000000..c5b3e1515f--- /dev/null+++ b/packages/remix-validated-form/src/internal/formContext.ts@@ -0,0 +1,13 @@+import type { FetcherWithComponents } from "@remix-run/react";+import { createContext } from "react";++export type InternalFormContextValue = {+ formId: string | symbol;+ action?: string;+ subaction?: string;+ defaultValuesProp?: { [fieldName: string]: any };+ fetcher?: FetcherWithComponents<unknown>;+};++export const InternalFormContext =+ createContext<InternalFormContextValue | null>(null);diff --git a/packages/remix-validated-form/src/internal/getInputProps.test.ts b/packages/remix-validated-form/src/internal/getInputProps.test.tsnew file mode 100644index 0000000000..51ca91bf4d--- /dev/null+++ b/packages/remix-validated-form/src/internal/getInputProps.test.ts@@ -0,0 +1,252 @@+import { describe, it, expect, vi } from "vitest";+import type {+ CreateGetInputPropsOptions} from "./getInputProps";+import {+ createGetInputProps+} from "./getInputProps";++const fakeEvent = { fake: "event" } as any;++describe("getInputProps", () => {+ describe("initial", () => {+ it("should validate on blur by default", () => {+ const options: CreateGetInputPropsOptions = {+ name: "some-field",+ defaultValue: "test default value",+ touched: false,+ hasBeenSubmitted: false,+ setTouched: vi.fn(),+ clearError: vi.fn(),+ validate: vi.fn(),+ };+ const getInputProps = createGetInputProps(options);++ const provided = {+ onBlur: vi.fn(),+ onChange: vi.fn(),+ };+ const { onChange, onBlur } = getInputProps(provided);++ onChange!(fakeEvent);+ expect(provided.onChange).toBeCalledTimes(1);+ expect(provided.onChange).toBeCalledWith(fakeEvent);+ expect(options.setTouched).not.toBeCalled();+ expect(options.validate).not.toBeCalled();++ onBlur!(fakeEvent);+ expect(provided.onBlur).toBeCalledTimes(1);+ expect(provided.onBlur).toBeCalledWith(fakeEvent);+ expect(options.setTouched).toBeCalledTimes(1);+ expect(options.setTouched).toBeCalledWith(true);+ expect(options.validate).toBeCalledTimes(1);+ });++ it("should respect provided validation behavior", () => {+ const options: CreateGetInputPropsOptions = {+ name: "some-field",+ defaultValue: "test default value",+ touched: false,+ hasBeenSubmitted: false,+ setTouched: vi.fn(),+ clearError: vi.fn(),+ validate: vi.fn(),+ validationBehavior: {+ initial: "onChange",+ },+ };+ const getInputProps = createGetInputProps(options);++ const provided = {+ onBlur: vi.fn(),+ onChange: vi.fn(),+ };+ const { onChange, onBlur } = getInputProps(provided);++ onChange!(fakeEvent);+ expect(provided.onChange).toBeCalledTimes(1);+ expect(provided.onChange).toBeCalledWith(fakeEvent);+ expect(options.setTouched).not.toBeCalled();+ expect(options.validate).toBeCalledTimes(1);++ onBlur!(fakeEvent);+ expect(provided.onBlur).toBeCalledTimes(1);+ expect(provided.onBlur).toBeCalledWith(fakeEvent);+ expect(options.setTouched).toBeCalledTimes(1);+ expect(options.setTouched).toBeCalledWith(true);+ expect(options.validate).toBeCalledTimes(1);+ });++ it("should not validate when behavior is onSubmit", () => {+ const options: CreateGetInputPropsOptions = {+ name: "some-field",+ defaultValue: "test default value",+ touched: false,+ hasBeenSubmitted: false,+ setTouched: vi.fn(),+ clearError: vi.fn(),+ validate: vi.fn(),+ validationBehavior: {+ initial: "onSubmit",+ },+ };+ const getInputProps = createGetInputProps(options);++ const provided = {+ onBlur: vi.fn(),+ onChange: vi.fn(),+ };+ const { onChange, onBlur } = getInputProps(provided);++ onChange!(fakeEvent);+ expect(provided.onChange).toBeCalledTimes(1);+ expect(provided.onChange).toBeCalledWith(fakeEvent);+ expect(options.setTouched).not.toBeCalled();+ expect(options.validate).not.toBeCalled();++ onBlur!(fakeEvent);+ expect(provided.onBlur).toBeCalledTimes(1);+ expect(provided.onBlur).toBeCalledWith(fakeEvent);+ expect(options.setTouched).toBeCalledTimes(1);+ expect(options.setTouched).toBeCalledWith(true);+ expect(options.validate).not.toBeCalled();+ });+ });++ describe("whenTouched", () => {+ it("should validate on change by default", () => {+ const options: CreateGetInputPropsOptions = {+ name: "some-field",+ defaultValue: "test default value",+ touched: true,+ hasBeenSubmitted: false,+ setTouched: vi.fn(),+ clearError: vi.fn(),+ validate: vi.fn(),+ };+ const getInputProps = createGetInputProps(options);++ const provided = {+ onBlur: vi.fn(),+ onChange: vi.fn(),+ };+ const { onChange, onBlur } = getInputProps(provided);++ onChange!(fakeEvent);+ expect(provided.onChange).toBeCalledTimes(1);+ expect(provided.onChange).toBeCalledWith(fakeEvent);+ expect(options.setTouched).not.toBeCalled();+ expect(options.validate).toBeCalledTimes(1);++ onBlur!(fakeEvent);+ expect(provided.onBlur).toBeCalledTimes(1);+ expect(provided.onBlur).toBeCalledWith(fakeEvent);+ expect(options.setTouched).toBeCalledTimes(1);+ expect(options.setTouched).toBeCalledWith(true);+ expect(options.validate).toBeCalledTimes(1);+ });++ it("should respect provided validation behavior", () => {+ const options: CreateGetInputPropsOptions = {+ name: "some-field",+ defaultValue: "test default value",+ touched: true,+ hasBeenSubmitted: false,+ setTouched: vi.fn(),+ clearError: vi.fn(),+ validate: vi.fn(),+ validationBehavior: {+ whenTouched: "onBlur",+ },+ };+ const getInputProps = createGetInputProps(options);++ const provided = {+ onBlur: vi.fn(),+ onChange: vi.fn(),+ };+ const { onChange, onBlur } = getInputProps(provided);++ onChange!(fakeEvent);+ expect(provided.onChange).toBeCalledTimes(1);+ expect(provided.onChange).toBeCalledWith(fakeEvent);+ expect(options.setTouched).not.toBeCalled();+ expect(options.validate).not.toBeCalled();++ onBlur!(fakeEvent);+ expect(provided.onBlur).toBeCalledTimes(1);+ expect(provided.onBlur).toBeCalledWith(fakeEvent);+ expect(options.setTouched).toBeCalledTimes(1);+ expect(options.setTouched).toBeCalledWith(true);+ expect(options.validate).toBeCalledTimes(1);+ });+ });++ describe("whenSubmitted", () => {+ it("should validate on change by default", () => {+ const options: CreateGetInputPropsOptions = {+ name: "some-field",+ defaultValue: "test default value",+ touched: true,+ hasBeenSubmitted: true,+ setTouched: vi.fn(),+ clearError: vi.fn(),+ validate: vi.fn(),+ };+ const getInputProps = createGetInputProps(options);++ const provided = {+ onBlur: vi.fn(),+ onChange: vi.fn(),+ };+ const { onChange, onBlur } = getInputProps(provided);++ onChange!(fakeEvent);+ expect(provided.onChange).toBeCalledTimes(1);+ expect(provided.onChange).toBeCalledWith(fakeEvent);+ expect(options.setTouched).not.toBeCalled();+ expect(options.validate).toBeCalledTimes(1);++ onBlur!(fakeEvent);+ expect(provided.onBlur).toBeCalledTimes(1);+ expect(provided.onBlur).toBeCalledWith(fakeEvent);+ expect(options.setTouched).toBeCalledTimes(1);+ expect(options.setTouched).toBeCalledWith(true);+ expect(options.validate).toBeCalledTimes(1);+ });++ it("should respect provided validation behavior", () => {+ const options: CreateGetInputPropsOptions = {+ name: "some-field",+ defaultValue: "test default value",+ touched: true,+ hasBeenSubmitted: true,+ setTouched: vi.fn(),+ clearError: vi.fn(),+ validate: vi.fn(),+ validationBehavior: {+ whenSubmitted: "onBlur",+ },+ };+ const getInputProps = createGetInputProps(options);++ const provided = {+ onBlur: vi.fn(),+ onChange: vi.fn(),+ };+ const { onChange, onBlur } = getInputProps(provided);++ onChange!(fakeEvent);+ expect(provided.onChange).toBeCalledTimes(1);+ expect(provided.onChange).toBeCalledWith(fakeEvent);+ expect(options.setTouched).not.toBeCalled();+ expect(options.validate).not.toBeCalled();++ onBlur!(fakeEvent);+ expect(provided.onBlur).toBeCalledTimes(1);+ expect(provided.onBlur).toBeCalledWith(fakeEvent);+ expect(options.setTouched).toBeCalledTimes(1);+ expect(options.setTouched).toBeCalledWith(true);+ expect(options.validate).toBeCalledTimes(1);+ });+ });+});diff --git a/packages/remix-validated-form/src/internal/getInputProps.ts b/packages/remix-validated-form/src/internal/getInputProps.tsnew file mode 100644index 0000000000..b433801463--- /dev/null+++ b/packages/remix-validated-form/src/internal/getInputProps.ts@@ -0,0 +1,94 @@+import * as R from "remeda";+import { getCheckboxChecked } from "./logic/getCheckboxChecked";+import { getRadioChecked } from "./logic/getRadioChecked";++export type ValidationBehavior = "onBlur" | "onChange" | "onSubmit";++export type ValidationBehaviorOptions = {+ initial: ValidationBehavior;+ whenTouched: ValidationBehavior;+ whenSubmitted: ValidationBehavior;+};++export type CreateGetInputPropsOptions = {+ clearError: () => void;+ validate: () => void;+ defaultValue?: any;+ touched: boolean;+ setTouched: (touched: boolean) => void;+ hasBeenSubmitted: boolean;+ validationBehavior?: Partial<ValidationBehaviorOptions>;+ name: string;+};++type HandledProps = "name" | "defaultValue" | "defaultChecked";+type Callbacks = "onChange" | "onBlur";++type MinimalInputProps = {+ onChange?: ((...args: any[]) => void) | undefined;+ onBlur?: ((...args: any[]) => void) | undefined;+ defaultValue?: any;+ defaultChecked?: boolean | undefined;+ name?: string | undefined;+ type?: string | undefined;+};++export type GetInputProps = <T extends MinimalInputProps>(+ props?: Omit<T, HandledProps | Callbacks> & Partial<Pick<T, Callbacks>>+) => T;++const defaultValidationBehavior: ValidationBehaviorOptions = {+ initial: "onBlur",+ whenTouched: "onChange",+ whenSubmitted: "onChange",+};++export const createGetInputProps = ({+ clearError,+ validate,+ defaultValue,+ touched,+ setTouched,+ hasBeenSubmitted,+ validationBehavior,+ name,+}: CreateGetInputPropsOptions): GetInputProps => {+ const validationBehaviors = {+ ...defaultValidationBehavior,+ ...validationBehavior,+ };++ return <T extends MinimalInputProps>(props = {} as any) => {+ const behavior = hasBeenSubmitted+ ? validationBehaviors.whenSubmitted+ : touched+ ? validationBehaviors.whenTouched+ : validationBehaviors.initial;++ const inputProps: MinimalInputProps = {+ ...props,+ onChange: (...args: unknown[]) => {+ if (behavior === "onChange") validate();+ else clearError();+ return props?.onChange?.(...args);+ },+ onBlur: (...args: unknown[]) => {+ if (behavior === "onBlur") validate();+ setTouched(true);+ return props?.onBlur?.(...args);+ },+ name,+ };++ if (props.type === "checkbox") {+ inputProps.defaultChecked = getCheckboxChecked(props.value, defaultValue);+ } else if (props.type === "radio") {+ inputProps.defaultChecked = getRadioChecked(props.value, defaultValue);+ } else if (props.value === undefined) {+ // We should only set the defaultValue if the input is uncontrolled.+ inputProps.defaultValue = defaultValue;+ }++ return R.omitBy(inputProps, (value) => value === undefined) as T;+ };+};diff --git a/packages/remix-validated-form/src/internal/hooks.ts b/packages/remix-validated-form/src/internal/hooks.tsnew file mode 100644index 0000000000..fd0c41215e--- /dev/null+++ b/packages/remix-validated-form/src/internal/hooks.ts@@ -0,0 +1,219 @@+import { useActionData, useMatches, useNavigation } from "@remix-run/react";+import { useCallback, useContext } from "react";+import invariant from "tiny-invariant";+import type { FieldErrors, ValidationErrorResponseData } from "..";+import { getPath } from "../utils";+import { formDefaultValuesKey } from "./constants";+import type { InternalFormContextValue } from "./formContext";+import { InternalFormContext } from "./formContext";+import type { Hydratable } from "./hydratable";+import { hydratable } from "./hydratable";+import { useFormStore } from "./state/storeHooks";+import type { InternalFormId } from "./state/types";++export const useInternalFormContext = (+ formId?: string | symbol,+ hookName?: string+) => {+ const formContext = useContext(InternalFormContext);++ if (formId) return { formId };+ if (formContext) return formContext;++ throw new Error(+ `Unable to determine form for ${hookName}. Please use it inside a ValidatedForm or pass a 'formId'.`+ );+};++export function useErrorResponseForForm({+ fetcher,+ subaction,+ formId,+}: InternalFormContextValue): ValidationErrorResponseData | null {+ const actionData = useActionData<any>();+ if (fetcher) {+ if ((fetcher.data as any)?.fieldErrors) return fetcher.data as any;+ return null;+ }++ if (!actionData?.fieldErrors) return null;++ // If there's an explicit id, we should ignore data that has the wrong id+ if (typeof formId === "string" && actionData.formId)+ return actionData.formId === formId ? actionData : null;++ if (+ (!subaction && !actionData.subaction) ||+ actionData.subaction === subaction+ )+ return actionData;++ return null;+}++export const useFieldErrorsForForm = (+ context: InternalFormContextValue+): Hydratable<FieldErrors | undefined> => {+ const response = useErrorResponseForForm(context);+ const hydrated = useFormStore(context.formId, (state) => state.isHydrated);+ return hydratable.from(response?.fieldErrors, hydrated);+};++export const useDefaultValuesFromLoader = ({+ formId,+}: InternalFormContextValue) => {+ const matches = useMatches();+ if (typeof formId === "string") {+ const dataKey = formDefaultValuesKey(formId);+ // If multiple loaders declare the same default values,+ // we should use the data from the deepest route.+ const match = matches+ .reverse()+ .find(+ (match) =>+ match.data && typeof match.data === "object" && dataKey in match.data+ );+ return (match as any)?.data[dataKey];+ }++ return null;+};++export const useDefaultValuesForForm = (+ context: InternalFormContextValue+): Hydratable<{ [fieldName: string]: any }> => {+ const { formId, defaultValuesProp } = context;+ const hydrated = useFormStore(formId, (state) => state.isHydrated);+ const errorResponse = useErrorResponseForForm(context);+ const defaultValuesFromLoader = useDefaultValuesFromLoader(context);++ // Typical flow is:+ // - Default values only available from props or server+ // - Props have a higher priority than server+ // - State gets hydrated with default values+ // - After submit, we may need to use values from the error++ if (hydrated) return hydratable.hydratedData();+ if (errorResponse?.repopulateFields) {+ invariant(+ typeof errorResponse.repopulateFields === "object",+ "repopulateFields returned something other than an object"+ );+ return hydratable.serverData(errorResponse.repopulateFields);+ }+ if (defaultValuesProp) return hydratable.serverData(defaultValuesProp);++ return hydratable.serverData(defaultValuesFromLoader);+};++export const useHasActiveFormSubmit = ({+ fetcher,+}: InternalFormContextValue): boolean => {+ let navigation = useNavigation();+ const hasActiveSubmission = fetcher+ ? fetcher.state === "submitting"+ : navigation.state === "submitting" || navigation.state === "loading";+ return hasActiveSubmission;+};++export const useFieldTouched = (+ field: string,+ { formId }: InternalFormContextValue+) => {+ const touched = useFormStore(formId, (state) => state.touchedFields[field]);+ const setFieldTouched = useFormStore(formId, (state) => state.setTouched);+ const setTouched = useCallback(+ (touched: boolean) => setFieldTouched(field, touched),+ [field, setFieldTouched]+ );+ return [touched, setTouched] as const;+};++export const useFieldError = (+ name: string,+ context: InternalFormContextValue+) => {+ const fieldErrors = useFieldErrorsForForm(context);+ const state = useFormStore(+ context.formId,+ (state) => state.fieldErrors[name]+ );+ return fieldErrors.map((fieldErrors) => fieldErrors?.[name]).hydrateTo(state);+};++export const useClearError = (context: InternalFormContextValue) => {+ const { formId } = context;+ return useFormStore(formId, (state) => state.clearFieldError);+};++export const useCurrentDefaultValueForField = (+ formId: InternalFormId,+ field: string+) =>+ useFormStore(formId, (state) => getPath(state.currentDefaultValues, field));++export const useFieldDefaultValue = (+ name: string,+ context: InternalFormContextValue+) => {+ const defaultValues = useDefaultValuesForForm(context);+ const state = useCurrentDefaultValueForField(context.formId, name);++ return defaultValues.map((val) => getPath(val, name)).hydrateTo(state);+};++export const useInternalIsSubmitting = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.isSubmitting);++export const useInternalIsValid = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.isValid());++export const useInternalHasBeenSubmitted = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.hasBeenSubmitted);++export const useSmartValidate = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.smartValidate);++export const useValidate = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.validate);++const noOpReceiver = () => () => {};+export const useRegisterReceiveFocus = (formId: InternalFormId) =>+ useFormStore(+ formId,+ (state) => state.formProps?.registerReceiveFocus ?? noOpReceiver+ );++const defaultDefaultValues = {};+export const useSyncedDefaultValues = (formId: InternalFormId) =>+ useFormStore(+ formId,+ (state) => state.formProps?.defaultValues ?? defaultDefaultValues+ );++export const useSetTouched = ({ formId }: InternalFormContextValue) =>+ useFormStore(formId, (state) => state.setTouched);++export const useTouchedFields = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.touchedFields);++export const useFieldErrors = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.fieldErrors);++export const useSetFieldErrors = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.setFieldErrors);++export const useResetFormElement = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.resetFormElement);++export const useSubmitForm = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.submit);++export const useFormActionProp = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.formProps?.action);++export const useFormSubactionProp = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.formProps?.subaction);++export const useFormValues = (formId: InternalFormId) =>+ useFormStore(formId, (state) => state.getValues);diff --git a/packages/remix-validated-form/src/internal/hydratable.ts b/packages/remix-validated-form/src/internal/hydratable.tsnew file mode 100644index 0000000000..e8276e2930--- /dev/null+++ b/packages/remix-validated-form/src/internal/hydratable.ts@@ -0,0 +1,28 @@+/**+ * The purpose of this type is to simplify the logic+ * around data that needs to come from the server initially,+ * but from the internal state after hydration.+ */+export type Hydratable<T> = {+ hydrateTo: (data: T) => T;+ map: <U>(fn: (data: T) => U) => Hydratable<U>;+};++const serverData = <T>(data: T): Hydratable<T> => ({+ hydrateTo: () => data,+ map: (fn) => serverData(fn(data)),+});++const hydratedData = <T>(): Hydratable<T> => ({+ hydrateTo: (hydratedData: T) => hydratedData,+ map: <U>() => hydratedData<U>(),+});++const from = <T>(data: T, hydrated: boolean): Hydratable<T> =>+ hydrated ? hydratedData<T>() : serverData<T>(data);++export const hydratable = {+ serverData,+ hydratedData,+ from,+};diff --git a/packages/remix-validated-form/src/internal/logic/getCheckboxChecked.ts b/packages/remix-validated-form/src/internal/logic/getCheckboxChecked.tsnew file mode 100644index 0000000000..c504ff1b7f--- /dev/null+++ b/packages/remix-validated-form/src/internal/logic/getCheckboxChecked.ts@@ -0,0 +1,10 @@+export const getCheckboxChecked = (+ checkboxValue: string | undefined = "on",+ newValue: unknown+): boolean | undefined => {+ if (Array.isArray(newValue))+ return newValue.some((val) => val === true || val === checkboxValue);+ if (typeof newValue === "boolean") return newValue;+ if (typeof newValue === "string") return newValue === checkboxValue;+ return undefined;+};diff --git a/packages/remix-validated-form/src/internal/logic/getRadioChecked.ts b/packages/remix-validated-form/src/internal/logic/getRadioChecked.tsnew file mode 100644index 0000000000..e9cafad389--- /dev/null+++ b/packages/remix-validated-form/src/internal/logic/getRadioChecked.ts@@ -0,0 +1,7 @@+export const getRadioChecked = (+ radioValue: string | undefined = "on",+ newValue: unknown+) => {+ if (typeof newValue === "string") return newValue === radioValue;+ return undefined;+};diff --git a/packages/remix-validated-form/src/internal/logic/nestedObjectToPathObject.ts b/packages/remix-validated-form/src/internal/logic/nestedObjectToPathObject.tsnew file mode 100644index 0000000000..4927eebcdc--- /dev/null+++ b/packages/remix-validated-form/src/internal/logic/nestedObjectToPathObject.ts@@ -0,0 +1,26 @@+export const nestedObjectToPathObject = (+ val: any,+ acc: Record<string, any>,+ path: string+): any => {+ if (Array.isArray(val)) {+ val.forEach((v, index) =>+ nestedObjectToPathObject(v, acc, `${path}[${index}]`)+ );+ return acc;+ }++ if (typeof val === "object") {+ Object.entries(val).forEach(([key, value]) => {+ const nextPath = path ? `${path}.${key}` : key;+ nestedObjectToPathObject(value, acc, nextPath);+ });+ return acc;+ }++ if (val !== undefined) {+ acc[path] = val;+ }++ return acc;+};diff --git a/packages/remix-validated-form/src/internal/logic/requestSubmit.ts b/packages/remix-validated-form/src/internal/logic/requestSubmit.tsnew file mode 100644index 0000000000..c1c569452b--- /dev/null+++ b/packages/remix-validated-form/src/internal/logic/requestSubmit.ts@@ -0,0 +1,65 @@+/**+ * Ponyfill of the HTMLFormElement.requestSubmit() method.+ * Based on polyfill from: https://github.com/javan/form-request-submit-polyfill/blob/main/form-request-submit-polyfill.js+ */+export const requestSubmit = (+ element: HTMLFormElement,+ submitter?: HTMLElement+) => {+ // In vitest, let's test the polyfill.+ // Cypress will test the native implementation by nature of using chrome.+ if (typeof Object.getPrototypeOf(element).requestSubmit === "function") {+ element.requestSubmit(submitter);+ return;+ }++ if (submitter) {+ validateSubmitter(element, submitter);+ submitter.click();+ return;+ }++ const dummySubmitter = document.createElement("input");+ dummySubmitter.type = "submit";+ dummySubmitter.hidden = true;+ element.appendChild(dummySubmitter);+ dummySubmitter.click();+ element.removeChild(dummySubmitter);+};++function validateSubmitter(element: HTMLFormElement, submitter: HTMLElement) {+ // Should be redundant, but here for completeness+ const isHtmlElement = submitter instanceof HTMLElement;+ if (!isHtmlElement) {+ raise(TypeError, "parameter 1 is not of type 'HTMLElement'");+ }++ const hasSubmitType =+ "type" in submitter && (submitter as HTMLInputElement).type === "submit";+ if (!hasSubmitType)+ raise(TypeError, "The specified element is not a submit button");++ const isForCorrectForm =+ "form" in submitter && (submitter as HTMLInputElement).form === element;+ if (!isForCorrectForm)+ raise(+ DOMException,+ "The specified element is not owned by this form element",+ "NotFoundError"+ );+}++interface ErrorConstructor {+ new (message: string, name?: string): Error;+}++function raise(+ errorConstructor: ErrorConstructor,+ message: string,+ name?: string+): never {+ throw new errorConstructor(+ "Failed to execute 'requestSubmit' on 'HTMLFormElement': " + message + ".",+ name+ );+}diff --git a/packages/remix-validated-form/src/internal/state/arrayUtil.ts b/packages/remix-validated-form/src/internal/state/arrayUtil.tsnew file mode 100644index 0000000000..d5120c9421--- /dev/null+++ b/packages/remix-validated-form/src/internal/state/arrayUtil.ts@@ -0,0 +1,141 @@+import invariant from "tiny-invariant";+import { getPath, setPath } from "../../utils";++////+// All of these array helpers are written in a way that mutates the original array.+// This is because we're working with immer.+////++export const getArray = (values: any, field: string): unknown[] => {+ const value = getPath(values, field);+ if (value === undefined || value === null) {+ const newValue: unknown[] = [];+ setPath(values, field, newValue);+ return newValue;+ }+ invariant(+ Array.isArray(value),+ `FieldArray: defaultValue value for ${field} must be an array, null, or undefined`+ );+ return value;+};++export const sparseCopy = <T>(array: T[]): T[] => array.slice();++export const swap = (array: unknown[], indexA: number, indexB: number) => {+ const itemA = array[indexA];+ const itemB = array[indexB];++ const hasItemA = indexA in array;+ const hasItemB = indexB in array;++ // If we're dealing with a sparse array (i.e. one of the indeces doesn't exist),+ // we should keep it sparse+ if (hasItemA) {+ array[indexB] = itemA;+ } else {+ delete array[indexB];+ }++ if (hasItemB) {+ array[indexA] = itemB;+ } else {+ delete array[indexA];+ }+};++// A splice that can handle sparse arrays+function sparseSplice(+ array: unknown[],+ start: number,+ deleteCount?: number,+ item?: unknown+) {+ // Inserting an item into an array won't behave as we need it to if the array isn't+ // at least as long as the start index. We can force the array to be long enough like this.+ if (array.length < start && item) {+ array.length = start;+ }++ // If we just pass item in, it'll be undefined and splice will delete the item.+ if (arguments.length === 4) return array.splice(start, deleteCount!, item);+ else if (arguments.length === 3) return array.splice(start, deleteCount);+ return array.splice(start);+}++export const move = (array: unknown[], from: number, to: number) => {+ const [item] = sparseSplice(array, from, 1);+ sparseSplice(array, to, 0, item);+};++export const insert = (array: unknown[], index: number, value: unknown) => {+ sparseSplice(array, index, 0, value);+};++export const insertEmpty = (array: unknown[], index: number) => {+ const tail = sparseSplice(array, index);+ tail.forEach((item, i) => {+ sparseSplice(array, index + i + 1, 0, item);+ });+};++export const remove = (array: unknown[], index: number) => {+ sparseSplice(array, index, 1);+};++export const replace = (array: unknown[], index: number, value: unknown) => {+ sparseSplice(array, index, 1, value);+};++/**+ * The purpose of this helper is to make it easier to update `fieldErrors` and `touchedFields`.+ * We key those objects by full paths to the fields.+ * When we're doing array mutations, that makes it difficult to update those objects.+ */+export const mutateAsArray = (+ field: string,+ obj: Record<string, any>,+ mutate: (arr: any[]) => void+) => {+ const beforeKeys = new Set<string>();+ const arr: any[] = [];++ for (const [key, value] of Object.entries(obj)) {+ if (key.startsWith(field) && key !== field) {+ beforeKeys.add(key);+ setPath(arr, key.substring(field.length), value);+ }+ }++ mutate(arr);+ for (const key of beforeKeys) {+ delete obj[key];+ }++ const newKeys = getDeepArrayPaths(arr);+ for (const key of newKeys) {+ const val = getPath(arr, key);+ if (val !== undefined) {+ obj[`${field}${key}`] = val;+ }+ }+};++const getDeepArrayPaths = (obj: any, basePath: string = ""): string[] => {+ // This only needs to handle arrays and plain objects+ // and we can assume the first call is always an array.++ if (Array.isArray(obj)) {+ return obj.flatMap((item, index) =>+ getDeepArrayPaths(item, `${basePath}[${index}]`)+ );+ }++ if (typeof obj === "object") {+ return Object.keys(obj).flatMap((key) =>+ getDeepArrayPaths(obj[key], `${basePath}.${key}`)+ );+ }++ return [basePath];+};diff --git a/packages/remix-validated-form/src/internal/state/controlledFields.ts b/packages/remix-validated-form/src/internal/state/controlledFields.tsnew file mode 100644index 0000000000..19029b3620--- /dev/null+++ b/packages/remix-validated-form/src/internal/state/controlledFields.ts@@ -0,0 +1,86 @@+import { useCallback, useEffect } from "react";+import type { InternalFormContextValue } from "../formContext";+import { useFieldDefaultValue } from "../hooks";+import { useFormStore } from "./storeHooks";+import type { InternalFormId } from "./types";++export const useControlledFieldValue = (+ context: InternalFormContextValue,+ field: string+) => {+ const value = useFormStore(context.formId, (state) =>+ state.controlledFields.getValue(field)+ );+ const isFormHydrated = useFormStore(+ context.formId,+ (state) => state.isHydrated+ );+ const defaultValue = useFieldDefaultValue(field, context);++ return isFormHydrated ? value : defaultValue;+};++export const useRegisterControlledField = (+ context: InternalFormContextValue,+ field: string+) => {+ const resolveUpdate = useFormStore(+ context.formId,+ (state) => state.controlledFields.valueUpdateResolvers[field]+ );+ useEffect(() => {+ resolveUpdate?.();+ }, [resolveUpdate]);++ const register = useFormStore(+ context.formId,+ (state) => state.controlledFields.register+ );+ const unregister = useFormStore(+ context.formId,+ (state) => state.controlledFields.unregister+ );+ useEffect(() => {+ register(field);+ return () => unregister(field);+ }, [context.formId, field, register, unregister]);+};++export const useControllableValue = (+ context: InternalFormContextValue,+ field: string+) => {+ useRegisterControlledField(context, field);++ const setControlledFieldValue = useFormStore(+ context.formId,+ (state) => state.controlledFields.setValue+ );+ const setValue = useCallback(+ (value: unknown) => setControlledFieldValue(field, value),+ [field, setControlledFieldValue]+ );++ const value = useControlledFieldValue(context, field);++ return [value, setValue] as const;+};++export const useUpdateControllableValue = (formId: InternalFormId) => {+ const setValue = useFormStore(+ formId,+ (state) => state.controlledFields.setValue+ );+ return useCallback(+ (field: string, value: unknown) => setValue(field, value),+ [setValue]+ );+};++export const useAwaitValue = (formId: InternalFormId) => {+ const awaitValue = useFormStore(+ formId,+ (state) => state.controlledFields.awaitValueUpdate+ );+ return useCallback((field: string) => awaitValue(field), [awaitValue]);+};diff --git a/packages/remix-validated-form/src/internal/state/createFormStore.ts b/packages/remix-validated-form/src/internal/state/createFormStore.tsnew file mode 100644index 0000000000..12b5aa24de--- /dev/null+++ b/packages/remix-validated-form/src/internal/state/createFormStore.ts@@ -0,0 +1,592 @@+import type { WritableDraft } from "immer/dist/internal";+import invariant from "tiny-invariant";+import type { GetState } from "zustand";+import { create } from "zustand";+import { immer } from "zustand/middleware/immer";+import { getPath, setPath } from "../../utils";+import type {+ FieldErrors,+ TouchedFields,+ ValidationResult,+ Validator,+} from "../../validation/types";+import { requestSubmit } from "../logic/requestSubmit";+import * as arrayUtil from "./arrayUtil";+import type { InternalFormId } from "./types";++export type SyncedFormProps = {+ formId?: string;+ action?: string;+ subaction?: string;+ defaultValues: { [fieldName: string]: any };+ registerReceiveFocus: (fieldName: string, handler: () => void) => () => void;+ validator: Validator<unknown>;+};++export type SmartValidateOpts = {+ alwaysIncludeErrorsFromFields?: string[];+};++export type FormStoreState = {+ forms: { [formId: InternalFormId]: FormState };+ form: (formId: InternalFormId) => FormState;+ registerForm: (formId: InternalFormId) => void;+ cleanupForm: (formId: InternalFormId) => void;+};++export type FormState = {+ isHydrated: boolean;+ isSubmitting: boolean;+ hasBeenSubmitted: boolean;+ fieldErrors: FieldErrors;+ touchedFields: TouchedFields;+ formProps?: SyncedFormProps;+ formElement: HTMLFormElement | null;+ currentDefaultValues: Record<string, any>;++ isValid: () => boolean;+ startSubmit: () => void;+ endSubmit: () => void;+ setTouched: (field: string, touched: boolean) => void;+ setFieldError: (field: string, error: string) => void;+ setFieldErrors: (errors: FieldErrors) => void;+ clearFieldError: (field: string) => void;+ reset: () => void;+ syncFormProps: (props: SyncedFormProps) => void;+ setFormElement: (formElement: HTMLFormElement | null) => void;+ validate: () => Promise<ValidationResult<unknown>>;+ smartValidate: (+ opts?: SmartValidateOpts+ ) => Promise<ValidationResult<unknown>>;+ resetFormElement: () => void;+ submit: () => void;+ getValues: () => FormData;++ controlledFields: {+ values: { [fieldName: string]: any };+ refCounts: { [fieldName: string]: number };+ valueUpdatePromises: { [fieldName: string]: Promise<void> };+ valueUpdateResolvers: { [fieldName: string]: () => void };++ register: (fieldName: string) => void;+ unregister: (fieldName: string) => void;+ setValue: (fieldName: string, value: unknown) => void;+ kickoffValueUpdate: (fieldName: string) => void;+ getValue: (fieldName: string) => unknown;+ awaitValueUpdate: (fieldName: string) => Promise<void>;++ array: {+ push: (fieldName: string, value: unknown) => void;+ swap: (fieldName: string, indexA: number, indexB: number) => void;+ move: (fieldName: string, fromIndex: number, toIndex: number) => void;+ insert: (fieldName: string, index: number, value: unknown) => void;+ unshift: (fieldName: string, value: unknown) => void;+ remove: (fieldName: string, index: number) => void;+ pop: (fieldName: string) => void;+ replace: (fieldName: string, index: number, value: unknown) => void;+ };+ };+};++const noOp = () => {};+const defaultFormState: FormState = {+ isHydrated: false,+ isSubmitting: false,+ hasBeenSubmitted: false,+ touchedFields: {},+ fieldErrors: {},+ formElement: null,+ isValid: () => true,+ startSubmit: noOp,+ endSubmit: noOp,+ setTouched: noOp,+ setFieldError: noOp,+ setFieldErrors: noOp,+ clearFieldError: noOp,+ currentDefaultValues: {},++ reset: () => noOp,+ syncFormProps: noOp,+ setFormElement: noOp,++ validate: async () => {+ throw new Error("Validate called before form was initialized.");+ },++ smartValidate: async () => {+ throw new Error("Validate called before form was initialized.");+ },++ submit: async () => {+ throw new Error("Submit called before form was initialized.");+ },++ resetFormElement: noOp,+ getValues: () => new FormData(),++ controlledFields: {+ values: {},+ refCounts: {},+ valueUpdatePromises: {},+ valueUpdateResolvers: {},++ register: noOp,+ unregister: noOp,+ setValue: noOp,+ getValue: noOp,+ kickoffValueUpdate: noOp,+ awaitValueUpdate: async () => {+ throw new Error("AwaitValueUpdate called before form was initialized.");+ },++ array: {+ push: noOp,+ swap: noOp,+ move: noOp,+ insert: noOp,+ unshift: noOp,+ remove: noOp,+ pop: noOp,+ replace: noOp,+ },+ },+};++const createFormState = (+ set: (setter: (draft: WritableDraft<FormState>) => void) => void,+ get: GetState<FormState>+): FormState => ({+ // It's not "hydrated" until the form props are synced+ isHydrated: false,+ isSubmitting: false,+ hasBeenSubmitted: false,+ touchedFields: {},+ fieldErrors: {},+ formElement: null,+ currentDefaultValues: {},++ isValid: () => Object.keys(get().fieldErrors).length === 0,+ startSubmit: () =>+ set((state) => {+ state.isSubmitting = true;+ state.hasBeenSubmitted = true;+ }),+ endSubmit: () =>+ set((state) => {+ state.isSubmitting = false;+ }),+ setTouched: (fieldName, touched) =>+ set((state) => {+ state.touchedFields[fieldName] = touched;+ }),+ setFieldError: (fieldName: string, error: string) =>+ set((state) => {+ state.fieldErrors[fieldName] = error;+ }),+ setFieldErrors: (errors: FieldErrors) =>+ set((state) => {+ state.fieldErrors = errors;+ }),+ clearFieldError: (fieldName: string) =>+ set((state) => {+ delete state.fieldErrors[fieldName];+ }),+ reset: () =>+ set((state) => {+ state.fieldErrors = {};+ state.touchedFields = {};+ state.hasBeenSubmitted = false;+ const nextDefaults = state.formProps?.defaultValues ?? {};+ state.controlledFields.values = nextDefaults;+ state.currentDefaultValues = nextDefaults;+ }),+ syncFormProps: (props: SyncedFormProps) =>+ set((state) => {+ if (!state.isHydrated) {+ state.controlledFields.values = props.defaultValues;+ state.currentDefaultValues = props.defaultValues;+ }++ state.formProps = props;+ state.isHydrated = true;+ }),+ setFormElement: (formElement: HTMLFormElement | null) => {+ // This gets called frequently, so we want to avoid calling set() every time+ // Or else we wind up with an infinite loop+ if (get().formElement === formElement) return;+ set((state) => {+ // weird type issue here+ // seems to be because formElement is a writable draft+ state.formElement = formElement as any;+ });+ },+ validate: async () => {+ const formElement = get().formElement;+ invariant(+ formElement,+ "Cannot find reference to form. This is probably a bug in remix-validated-form."+ );++ const validator = get().formProps?.validator;+ invariant(+ validator,+ "Cannot find validator. This is probably a bug in remix-validated-form."+ );++ const result = await validator.validate(new FormData(formElement));+ if (result.error) get().setFieldErrors(result.error.fieldErrors);+ return result;+ },++ smartValidate: async ({ alwaysIncludeErrorsFromFields = [] } = {}) => {+ const formElement = get().formElement;+ invariant(+ formElement,+ "Cannot find reference to form. This is probably a bug in remix-validated-form."+ );++ const validator = get().formProps?.validator;+ invariant(+ validator,+ "Cannot find validator. This is probably a bug in remix-validated-form."+ );++ await Promise.all(+ alwaysIncludeErrorsFromFields.map((field) =>+ get().controlledFields.awaitValueUpdate?.(field)+ )+ );++ const validationResult = await validator.validate(+ new FormData(formElement)+ );+ if (!validationResult.error) {+ // Only update the field errors if it hasn't changed+ const hadErrors = Object.keys(get().fieldErrors).length > 0;+ if (hadErrors) get().setFieldErrors({});+ return validationResult;+ }++ const {+ error: { fieldErrors },+ } = validationResult;+ const errorFields = new Set<string>();+ const incomingErrors = new Set<string>();+ const prevErrors = new Set<string>();++ Object.keys(fieldErrors).forEach((field) => {+ errorFields.add(field);+ incomingErrors.add(field);+ });++ Object.keys(get().fieldErrors).forEach((field) => {+ errorFields.add(field);+ prevErrors.add(field);+ });++ const fieldsToUpdate = new Set<string>();+ const fieldsToDelete = new Set<string>();++ errorFields.forEach((field) => {+ // If an error has been cleared, remove it.+ if (!incomingErrors.has(field)) {+ fieldsToDelete.add(field);+ return;+ }++ // If an error has changed, we should update it.+ if (prevErrors.has(field) && incomingErrors.has(field)) {+ // Only update if the error has changed to avoid unnecessary rerenders+ if (fieldErrors[field] !== get().fieldErrors[field])+ fieldsToUpdate.add(field);+ return;+ }++ // If the error is always included, then we should update it.+ if (alwaysIncludeErrorsFromFields.includes(field)) {+ fieldsToUpdate.add(field);+ return;+ }++ // If the error is new, then only update if the field has been touched+ // or if the form has been submitted+ if (!prevErrors.has(field)) {+ const fieldTouched = get().touchedFields[field];+ const formHasBeenSubmitted = get().hasBeenSubmitted;+ if (fieldTouched || formHasBeenSubmitted) fieldsToUpdate.add(field);+ return;+ }+ });++ if (fieldsToDelete.size === 0 && fieldsToUpdate.size === 0) {+ return { ...validationResult, error: { fieldErrors: get().fieldErrors } };+ }++ set((state) => {+ fieldsToDelete.forEach((field) => {+ delete state.fieldErrors[field];+ });++ fieldsToUpdate.forEach((field) => {+ state.fieldErrors[field] = fieldErrors[field];+ });+ });++ return { ...validationResult, error: { fieldErrors: get().fieldErrors } };+ },++ submit: () => {+ const formElement = get().formElement;+ invariant(+ formElement,+ "Cannot find reference to form. This is probably a bug in remix-validated-form."+ );++ requestSubmit(formElement);+ },++ getValues: () => new FormData(get().formElement ?? undefined),++ resetFormElement: () => get().formElement?.reset(),++ controlledFields: {+ values: {},+ refCounts: {},+ valueUpdatePromises: {},+ valueUpdateResolvers: {},++ register: (fieldName) => {+ set((state) => {+ const current = state.controlledFields.refCounts[fieldName] ?? 0;+ state.controlledFields.refCounts[fieldName] = current + 1;+ });+ },+ unregister: (fieldName) => {+ // For this helper in particular, we may run into a case where state is undefined.+ // When the whole form unmounts, the form state may be cleaned up before the fields are.+ if (get() === null || get() === undefined) return;+ set((state) => {+ const current = state.controlledFields.refCounts[fieldName] ?? 0;+ if (current > 1) {+ state.controlledFields.refCounts[fieldName] = current - 1;+ return;+ }++ const isNested = Object.keys(state.controlledFields.refCounts).some(+ (key) => fieldName.startsWith(key) && key !== fieldName+ );++ // When nested within a field array, we should leave resetting up to the field array+ if (!isNested) {+ setPath(+ state.controlledFields.values,+ fieldName,+ getPath(state.formProps?.defaultValues, fieldName)+ );+ setPath(+ state.currentDefaultValues,+ fieldName,+ getPath(state.formProps?.defaultValues, fieldName)+ );+ }++ delete state.controlledFields.refCounts[fieldName];+ });+ },+ getValue: (fieldName) => getPath(get().controlledFields.values, fieldName),+ setValue: (fieldName, value) => {+ set((state) => {+ setPath(state.controlledFields.values, fieldName, value);+ });+ get().controlledFields.kickoffValueUpdate(fieldName);+ },+ kickoffValueUpdate: (fieldName) => {+ const clear = () =>+ set((state) => {+ delete state.controlledFields.valueUpdateResolvers[fieldName];+ delete state.controlledFields.valueUpdatePromises[fieldName];+ });+ set((state) => {+ const promise = new Promise<void>((resolve) => {+ state.controlledFields.valueUpdateResolvers[fieldName] = resolve;+ }).then(clear);+ state.controlledFields.valueUpdatePromises[fieldName] = promise;+ });+ },++ awaitValueUpdate: async (fieldName) => {+ await get().controlledFields.valueUpdatePromises[fieldName];+ },++ array: {+ push: (fieldName, item) => {+ set((state) => {+ arrayUtil+ .getArray(state.controlledFields.values, fieldName)+ .push(item);+ arrayUtil.getArray(state.currentDefaultValues, fieldName).push(item);+ // New item added to the end, no need to update touched or error+ });+ get().controlledFields.kickoffValueUpdate(fieldName);+ },++ swap: (fieldName, indexA, indexB) => {+ set((state) => {+ arrayUtil.swap(+ arrayUtil.getArray(state.controlledFields.values, fieldName),+ indexA,+ indexB+ );+ arrayUtil.swap(+ arrayUtil.getArray(state.currentDefaultValues, fieldName),+ indexA,+ indexB+ );+ arrayUtil.mutateAsArray(fieldName, state.touchedFields, (array) =>+ arrayUtil.swap(array, indexA, indexB)+ );+ arrayUtil.mutateAsArray(fieldName, state.fieldErrors, (array) =>+ arrayUtil.swap(array, indexA, indexB)+ );+ });+ get().controlledFields.kickoffValueUpdate(fieldName);+ },++ move: (fieldName, from, to) => {+ set((state) => {+ arrayUtil.move(+ arrayUtil.getArray(state.controlledFields.values, fieldName),+ from,+ to+ );+ arrayUtil.move(+ arrayUtil.getArray(state.currentDefaultValues, fieldName),+ from,+ to+ );+ arrayUtil.mutateAsArray(fieldName, state.touchedFields, (array) =>+ arrayUtil.move(array, from, to)+ );+ arrayUtil.mutateAsArray(fieldName, state.fieldErrors, (array) =>+ arrayUtil.move(array, from, to)+ );+ });+ get().controlledFields.kickoffValueUpdate(fieldName);+ },+ insert: (fieldName, index, item) => {+ set((state) => {+ arrayUtil.insert(+ arrayUtil.getArray(state.controlledFields.values, fieldName),+ index,+ item+ );+ arrayUtil.insert(+ arrayUtil.getArray(state.currentDefaultValues, fieldName),+ index,+ item+ );+ // Even though this is a new item, we need to push around other items.+ arrayUtil.mutateAsArray(fieldName, state.touchedFields, (array) =>+ arrayUtil.insertEmpty(array, index)+ );+ arrayUtil.mutateAsArray(fieldName, state.fieldErrors, (array) =>+ arrayUtil.insertEmpty(array, index)+ );+ });+ get().controlledFields.kickoffValueUpdate(fieldName);+ },+ remove: (fieldName, index) => {+ set((state) => {+ arrayUtil.remove(+ arrayUtil.getArray(state.controlledFields.values, fieldName),+ index+ );+ arrayUtil.remove(+ arrayUtil.getArray(state.currentDefaultValues, fieldName),+ index+ );+ arrayUtil.mutateAsArray(fieldName, state.touchedFields, (array) =>+ arrayUtil.remove(array, index)+ );+ arrayUtil.mutateAsArray(fieldName, state.fieldErrors, (array) =>+ arrayUtil.remove(array, index)+ );+ });+ get().controlledFields.kickoffValueUpdate(fieldName);+ },+ pop: (fieldName) => {+ set((state) => {+ arrayUtil.getArray(state.controlledFields.values, fieldName).pop();+ arrayUtil.getArray(state.currentDefaultValues, fieldName).pop();+ arrayUtil.mutateAsArray(fieldName, state.touchedFields, (array) =>+ array.pop()+ );+ arrayUtil.mutateAsArray(fieldName, state.fieldErrors, (array) =>+ array.pop()+ );+ });+ get().controlledFields.kickoffValueUpdate(fieldName);+ },+ unshift: (fieldName, value) => {+ set((state) => {+ arrayUtil+ .getArray(state.controlledFields.values, fieldName)+ .unshift(value);+ arrayUtil+ .getArray(state.currentDefaultValues, fieldName)+ .unshift(value);+ arrayUtil.mutateAsArray(fieldName, state.touchedFields, (array) =>+ arrayUtil.insertEmpty(array, 0)+ );+ arrayUtil.mutateAsArray(fieldName, state.fieldErrors, (array) =>+ arrayUtil.insertEmpty(array, 0)+ );+ });+ },+ replace: (fieldName, index, item) => {+ set((state) => {+ arrayUtil.replace(+ arrayUtil.getArray(state.controlledFields.values, fieldName),+ index,+ item+ );+ arrayUtil.replace(+ arrayUtil.getArray(state.currentDefaultValues, fieldName),+ index,+ item+ );+ arrayUtil.mutateAsArray(fieldName, state.touchedFields, (array) =>+ arrayUtil.replace(array, index, item)+ );+ arrayUtil.mutateAsArray(fieldName, state.fieldErrors, (array) =>+ arrayUtil.replace(array, index, item)+ );+ });+ get().controlledFields.kickoffValueUpdate(fieldName);+ },+ },+ },+});++export const useRootFormStore = create<FormStoreState>()(+ immer((set, get) => ({+ forms: {},+ form: (formId) => {+ return get().forms[formId] ?? defaultFormState;+ },+ cleanupForm: (formId: InternalFormId) => {+ set((state) => {+ delete state.forms[formId];+ });+ },+ registerForm: (formId: InternalFormId) => {+ if (get().forms[formId]) return;+ set((state) => {+ state.forms[formId] = createFormState(+ (setter) => set((state) => setter(state.forms[formId])),+ () => get().forms[formId]+ ) as WritableDraft<FormState>;+ });+ },+ }))+);diff --git a/packages/remix-validated-form/src/internal/state/fieldArray.tsx b/packages/remix-validated-form/src/internal/state/fieldArray.tsxnew file mode 100644index 0000000000..f361ba673d--- /dev/null+++ b/packages/remix-validated-form/src/internal/state/fieldArray.tsx@@ -0,0 +1,196 @@+import { nanoid } from "nanoid";+import React, { useCallback, useMemo, useRef } from "react";+import invariant from "tiny-invariant";+import type { InternalFormContextValue } from "../formContext";+import {+ useFieldDefaultValue,+ useFieldError,+ useInternalFormContext,+ useInternalHasBeenSubmitted,+ useSmartValidate,+} from "../hooks";+import * as arrayUtil from "./arrayUtil";+import { useRegisterControlledField } from "./controlledFields";+import { useFormStore } from "./storeHooks";++export type FieldArrayValidationBehavior = "onChange" | "onSubmit";++export type FieldArrayValidationBehaviorOptions = {+ initial: FieldArrayValidationBehavior;+ whenSubmitted: FieldArrayValidationBehavior;+};++export type FieldArrayItem<T> = {+ /**+ * The default value of the item.+ * This does not update as the field is changed by the user.+ */+ defaultValue: T;+ /**+ * A unique key for the item.+ * Use this as the key prop when rendering the item.+ */+ key: string;+};++const useInternalFieldArray = (+ context: InternalFormContextValue,+ field: string,+ validationBehavior?: Partial<FieldArrayValidationBehaviorOptions>+) => {+ const value = useFieldDefaultValue(field, context);+ useRegisterControlledField(context, field);+ const hasBeenSubmitted = useInternalHasBeenSubmitted(context.formId);+ const validateField = useSmartValidate(context.formId);+ const error = useFieldError(field, context);++ const resolvedValidationBehavior: FieldArrayValidationBehaviorOptions = {+ initial: "onSubmit",+ whenSubmitted: "onChange",+ ...validationBehavior,+ };++ const behavior = hasBeenSubmitted+ ? resolvedValidationBehavior.whenSubmitted+ : resolvedValidationBehavior.initial;++ const maybeValidate = useCallback(() => {+ if (behavior === "onChange") {+ validateField({ alwaysIncludeErrorsFromFields: [field] });+ }+ }, [behavior, field, validateField]);++ invariant(+ value === undefined || value === null || Array.isArray(value),+ `FieldArray: defaultValue value for ${field} must be an array, null, or undefined`+ );++ const arr = useFormStore(+ context.formId,+ (state) => state.controlledFields.array+ );++ const arrayValue = useMemo<unknown[]>(() => value ?? [], [value]);+ const keyRef = useRef<string[]>([]);++ // If the lengths don't match up it means one of two things+ // 1. The array has been modified outside of this hook+ // 2. We're initializing the array+ if (keyRef.current.length !== arrayValue.length) {+ keyRef.current = arrayValue.map(() => nanoid());+ }++ const helpers = useMemo(+ () => ({+ push: (item: any) => {+ arr.push(field, item);+ keyRef.current.push(nanoid());+ maybeValidate();+ },+ swap: (indexA: number, indexB: number) => {+ arr.swap(field, indexA, indexB);+ arrayUtil.swap(keyRef.current, indexA, indexB);+ maybeValidate();+ },+ move: (from: number, to: number) => {+ arr.move(field, from, to);+ arrayUtil.move(keyRef.current, from, to);+ maybeValidate();+ },+ insert: (index: number, value: any) => {+ arr.insert(field, index, value);+ arrayUtil.insert(keyRef.current, index, nanoid());+ maybeValidate();+ },+ unshift: (value: any) => {+ arr.unshift(field, value);+ keyRef.current.unshift(nanoid());+ maybeValidate();+ },+ remove: (index: number) => {+ arr.remove(field, index);+ arrayUtil.remove(keyRef.current, index);+ maybeValidate();+ },+ pop: () => {+ arr.pop(field);+ keyRef.current.pop();+ maybeValidate();+ },+ replace: (index: number, value: any) => {+ arr.replace(field, index, value);+ keyRef.current[index] = nanoid();+ maybeValidate();+ },+ }),+ [arr, field, maybeValidate]+ );++ const valueWithKeys = useMemo(() => {+ const result: { defaultValue: any; key: string }[] = [];+ arrayValue.forEach((item, index) => {+ result[index] = {+ key: keyRef.current[index],+ defaultValue: item,+ };+ });+ return result;+ }, [arrayValue]);++ return [valueWithKeys, helpers, error] as const;+};++export type FieldArrayHelpers<Item = any> = {+ push: (item: Item) => void;+ swap: (indexA: number, indexB: number) => void;+ move: (from: number, to: number) => void;+ insert: (index: number, value: Item) => void;+ unshift: (value: Item) => void;+ remove: (index: number) => void;+ pop: () => void;+ replace: (index: number, value: Item) => void;+};++export type UseFieldArrayOptions = {+ formId?: string;+ validationBehavior?: Partial<FieldArrayValidationBehaviorOptions>;+};++export function useFieldArray<Item = any>(+ name: string,+ { formId, validationBehavior }: UseFieldArrayOptions = {}+) {+ const context = useInternalFormContext(formId, "FieldArray");++ return useInternalFieldArray(context, name, validationBehavior) as [+ items: FieldArrayItem<Item>[],+ helpers: FieldArrayHelpers,+ error: string | undefined+ ];+}++export type FieldArrayProps<Item> = {+ name: string;+ children: (+ items: FieldArrayItem<Item>[],+ helpers: FieldArrayHelpers<Item>,+ error: string | undefined+ ) => React.ReactNode;+ formId?: string;+ validationBehavior?: FieldArrayValidationBehaviorOptions;+};++export function FieldArray<Item = any>({+ name,+ children,+ formId,+ validationBehavior,+}: FieldArrayProps<Item>) {+ const context = useInternalFormContext(formId, "FieldArray");+ const [value, helpers, error] = useInternalFieldArray(+ context,+ name,+ validationBehavior+ );+ return <>{children(value, helpers, error)}</>;+}diff --git a/packages/remix-validated-form/src/internal/state/storeHooks.ts b/packages/remix-validated-form/src/internal/state/storeHooks.tsnew file mode 100644index 0000000000..04e728db09--- /dev/null+++ b/packages/remix-validated-form/src/internal/state/storeHooks.ts@@ -0,0 +1,10 @@+import type { FormState } from "./createFormStore";+import { useRootFormStore } from "./createFormStore";+import type { InternalFormId } from "./types";++export const useFormStore = <T>(+ formId: InternalFormId,+ selector: (state: FormState) => T+) => {+ return useRootFormStore((state) => selector(state.form(formId)));+};diff --git a/packages/remix-validated-form/src/internal/state/types.ts b/packages/remix-validated-form/src/internal/state/types.tsnew file mode 100644index 0000000000..f8d1700a1b--- /dev/null+++ b/packages/remix-validated-form/src/internal/state/types.ts@@ -0,0 +1 @@+export type InternalFormId = string | symbol;diff --git a/packages/remix-validated-form/src/internal/submissionCallbacks.ts b/packages/remix-validated-form/src/internal/submissionCallbacks.tsnew file mode 100644index 0000000000..167a223797--- /dev/null+++ b/packages/remix-validated-form/src/internal/submissionCallbacks.ts@@ -0,0 +1,15 @@+import { useEffect, useRef } from "react";++export function useSubmitComplete(isSubmitting: boolean, callback: () => void) {+ const isPending = useRef(false);+ useEffect(() => {+ if (isSubmitting) {+ isPending.current = true;+ }++ if (!isSubmitting && isPending.current) {+ isPending.current = false;+ callback();+ }+ });+}diff --git a/packages/remix-validated-form/src/internal/util.ts b/packages/remix-validated-form/src/internal/util.tsnew file mode 100644index 0000000000..4a76c9aa2f--- /dev/null+++ b/packages/remix-validated-form/src/internal/util.ts@@ -0,0 +1,39 @@+import type React from "react";+import { useEffect, useLayoutEffect, useRef } from "react";+import * as R from "remeda";++export const omit = (obj: any, ...keys: string[]) => {+ const result = { ...obj };+ for (const key of keys) {+ delete result[key];+ }+ return result;+};++export const mergeRefs = <T = any>(+ refs: Array<React.MutableRefObject<T> | React.LegacyRef<T> | undefined>+): React.RefCallback<T> => {+ return (value: T) => {+ refs.filter(Boolean).forEach((ref) => {+ if (typeof ref === "function") {+ ref(value);+ } else if (ref != null) {+ (ref as React.MutableRefObject<T | null>).current = value;+ }+ });+ };+};++export const useIsomorphicLayoutEffect =+ typeof window !== "undefined" ? useLayoutEffect : useEffect;++export const useDeepEqualsMemo = <T>(item: T): T => {+ const ref = useRef<T>(item);+ const areEqual = ref.current === item || R.equals(ref.current, item);+ useEffect(() => {+ if (!areEqual) {+ ref.current = item;+ }+ });+ return areEqual ? ref.current : item;+};diff --git a/packages/remix-validated-form/src/server.ts b/packages/remix-validated-form/src/server.tsnew file mode 100644index 0000000000..d9aae7383b--- /dev/null+++ b/packages/remix-validated-form/src/server.ts@@ -0,0 +1,51 @@+import { json } from "@remix-run/server-runtime";+import type { FORM_DEFAULTS_FIELD } from "./internal/constants";+import { formDefaultValuesKey } from "./internal/constants";+import type {+ ValidationErrorResponseData,+ ValidatorError,+} from "./validation/types";++/**+ * Takes the errors from a `Validator` and returns a `Response`.+ * When you return this from your action, `ValidatedForm` on the frontend will automatically+ * display the errors on the correct fields on the correct form.+ *+ * You can also provide a second argument to `validationError`+ * to specify how to repopulate the form when JS is disabled.+ *+ * @example+ * ```ts+ * const result = validator.validate(await request.formData());+ * if (result.error) return validationError(result.error, result.submittedData);+ * ```+ */+export function validationError(+ error: ValidatorError,+ repopulateFields?: unknown,+ init?: ResponseInit+) {+ return json<ValidationErrorResponseData>(+ {+ fieldErrors: error.fieldErrors,+ subaction: error.subaction,+ repopulateFields,+ formId: error.formId,+ },+ { status: 422, ...init }+ );+}++export type FormDefaults = {+ [formDefaultsKey: `${typeof FORM_DEFAULTS_FIELD}_${string}`]: any;+};++// FIXME: Remove after https://github.com/egoist/tsup/issues/813 is fixed+export type internal_FORM_DEFAULTS_FIELD = typeof FORM_DEFAULTS_FIELD;++export const setFormDefaults = <DataType = any>(+ formId: string,+ defaultValues: Partial<DataType>+): FormDefaults => ({+ [formDefaultValuesKey(formId)]: defaultValues,+});diff --git a/packages/remix-validated-form/src/unreleased/formStateHooks.ts b/packages/remix-validated-form/src/unreleased/formStateHooks.tsnew file mode 100644index 0000000000..8c5dbb03eb--- /dev/null+++ b/packages/remix-validated-form/src/unreleased/formStateHooks.ts@@ -0,0 +1,170 @@+import { useMemo } from "react";+import {} from "../internal/getInputProps";+import {+ useClearError,+ useDefaultValuesForForm,+ useFieldErrors,+ useFieldErrorsForForm,+ useFormActionProp,+ useFormSubactionProp,+ useFormValues,+ useInternalFormContext,+ useInternalHasBeenSubmitted,+ useInternalIsSubmitting,+ useInternalIsValid,+ useResetFormElement,+ useSetFieldErrors,+ useSetTouched,+ useSmartValidate,+ useSubmitForm,+ useSyncedDefaultValues,+ useTouchedFields,+ useValidate,+} from "../internal/hooks";+import type {+ FieldErrors,+ TouchedFields,+ ValidationResult,+} from "../validation/types";++export type FormState = {+ fieldErrors: FieldErrors;+ isSubmitting: boolean;+ hasBeenSubmitted: boolean;+ touchedFields: TouchedFields;+ defaultValues: { [fieldName: string]: any };+ action?: string;+ subaction?: string;+ isValid: boolean;+};++/**+ * Returns information about the form.+ *+ * @param formId the id of the form. Only necessary if being used outside a ValidatedForm.+ */+export const useFormState = (formId?: string): FormState => {+ const formContext = useInternalFormContext(formId, "useFormState");+ const isSubmitting = useInternalIsSubmitting(formContext.formId);+ const hasBeenSubmitted = useInternalHasBeenSubmitted(formContext.formId);+ const touchedFields = useTouchedFields(formContext.formId);+ const isValid = useInternalIsValid(formContext.formId);+ const action = useFormActionProp(formContext.formId);+ const subaction = useFormSubactionProp(formContext.formId);++ const syncedDefaultValues = useSyncedDefaultValues(formContext.formId);+ const defaultValuesToUse = useDefaultValuesForForm(formContext);+ const hydratedDefaultValues =+ defaultValuesToUse.hydrateTo(syncedDefaultValues);++ const fieldErrorsFromState = useFieldErrors(formContext.formId);+ const fieldErrorsToUse = useFieldErrorsForForm(formContext);+ const hydratedFieldErrors = fieldErrorsToUse.hydrateTo(fieldErrorsFromState);++ return useMemo(+ () => ({+ action,+ subaction,+ defaultValues: hydratedDefaultValues,+ fieldErrors: hydratedFieldErrors ?? {},+ hasBeenSubmitted,+ isSubmitting,+ touchedFields,+ isValid,+ }),+ [+ action,+ hasBeenSubmitted,+ hydratedDefaultValues,+ hydratedFieldErrors,+ isSubmitting,+ isValid,+ subaction,+ touchedFields,+ ]+ );+};++export type FormHelpers = {+ /**+ * Clear the error of the specified field.+ */+ clearError: (fieldName: string) => void;+ /**+ * Validate the specified field.+ */+ validateField: (fieldName: string) => Promise<string | null>;+ /**+ * Change the touched state of the specified field.+ */+ setTouched: (fieldName: string, touched: boolean) => void;+ /**+ * Validate the whole form and populate any errors.+ */+ validate: () => Promise<ValidationResult<unknown>>;+ /**+ * Clears all errors on the form.+ */+ clearAllErrors: () => void;+ /**+ * Resets the form.+ *+ * _Note_: The equivalent behavior can be achieved by calling formElement.reset()+ * or clicking a button element with `type="reset"`.+ */+ reset: () => void;+ /**+ * Submits the form, running all validations first.+ *+ * _Note_: This is equivalent to clicking a button element with `type="submit"` or calling formElement.submit().+ */+ submit: () => void;+ /**+ * Returns the current form values as FormData+ */+ getValues: () => FormData;+};++/**+ * Returns helpers that can be used to update the form state.+ *+ * @param formId the id of the form. Only necessary if being used outside a ValidatedForm.+ */+export const useFormHelpers = (formId?: string): FormHelpers => {+ const formContext = useInternalFormContext(formId, "useFormHelpers");+ const setTouched = useSetTouched(formContext);+ const validateField = useSmartValidate(formContext.formId);+ const validate = useValidate(formContext.formId);+ const clearError = useClearError(formContext);+ const setFieldErrors = useSetFieldErrors(formContext.formId);+ const reset = useResetFormElement(formContext.formId);+ const submit = useSubmitForm(formContext.formId);+ const getValues = useFormValues(formContext.formId);+ return useMemo(+ () => ({+ setTouched,+ validateField: async (fieldName: string) => {+ const res = await validateField({+ alwaysIncludeErrorsFromFields: [fieldName],+ });+ return res.error?.fieldErrors[fieldName] ?? null;+ },+ clearError,+ validate,+ clearAllErrors: () => setFieldErrors({}),+ reset,+ submit,+ getValues,+ }),+ [+ clearError,+ reset,+ setFieldErrors,+ setTouched,+ submit,+ validate,+ validateField,+ getValues,+ ]+ );+};diff --git a/packages/remix-validated-form/src/userFacingFormContext.ts b/packages/remix-validated-form/src/userFacingFormContext.tsnew file mode 100644index 0000000000..57938979fb--- /dev/null+++ b/packages/remix-validated-form/src/userFacingFormContext.ts@@ -0,0 +1,147 @@+import { useCallback, useMemo } from "react";+import {+ useInternalFormContext,+ useRegisterReceiveFocus,+} from "./internal/hooks";+import { useFormHelpers, useFormState } from "./unreleased/formStateHooks";+import type {+ FieldErrors,+ TouchedFields,+ ValidationResult,+} from "./validation/types";++export type FormContextValue = {+ /**+ * All the errors in all the fields in the form.+ */+ fieldErrors: FieldErrors;+ /**+ * Clear the errors of the specified fields.+ */+ clearError: (...names: string[]) => void;+ /**+ * Validate the specified field.+ */+ validateField: (fieldName: string) => Promise<string | null>;+ /**+ * The `action` prop of the form.+ */+ action?: string;+ /**+ * The `subaction` prop of the form.+ */+ subaction?: string;+ /**+ * Whether or not the form is submitting.+ */+ isSubmitting: boolean;+ /**+ * Whether or not a submission has been attempted.+ * This is true once the form has been submitted, even if there were validation errors.+ * Resets to false when the form is reset.+ */+ hasBeenSubmitted: boolean;+ /**+ * Whether or not the form is valid.+ */+ isValid: boolean;+ /**+ * The default values of the form.+ */+ defaultValues?: { [fieldName: string]: any };+ /**+ * Register a custom focus handler to be used when+ * the field needs to receive focus due to a validation error.+ */+ registerReceiveFocus: (fieldName: string, handler: () => void) => () => void;+ /**+ * Any fields that have been touched by the user.+ */+ touchedFields: TouchedFields;+ /**+ * Change the touched state of the specified field.+ */+ setFieldTouched: (fieldName: string, touched: boolean) => void;+ /**+ * Validate the whole form and populate any errors.+ */+ validate: () => Promise<ValidationResult<unknown>>;+ /**+ * Clears all errors on the form.+ */+ clearAllErrors: () => void;+ /**+ * Resets the form.+ *+ * _Note_: The equivalent behavior can be achieved by calling formElement.reset()+ * or clicking a button element with `type="reset"`.+ */+ reset: () => void;+ /**+ * Submits the form, running all validations first.+ *+ * _Note_: This is equivalent to clicking a button element with `type="submit"` or calling formElement.submit().+ */+ submit: () => void;+ /**+ * Returns the current form values as FormData+ */+ getValues: () => FormData;+};++/**+ * Provides access to some of the internal state of the form.+ */+export const useFormContext = (formId?: string): FormContextValue => {+ // Try to access context so we get our error specific to this hook if it's not there+ const context = useInternalFormContext(formId, "useFormContext");+ const state = useFormState(formId);+ const {+ clearError: internalClearError,+ setTouched,+ validateField,+ clearAllErrors,+ validate,+ reset,+ submit,+ getValues,+ } = useFormHelpers(formId);++ const registerReceiveFocus = useRegisterReceiveFocus(context.formId);++ const clearError = useCallback(+ (...names: string[]) => {+ names.forEach((name) => {+ internalClearError(name);+ });+ },+ [internalClearError]+ );++ return useMemo(+ () => ({+ ...state,+ setFieldTouched: setTouched,+ validateField,+ clearError,+ registerReceiveFocus,+ clearAllErrors,+ validate,+ reset,+ submit,+ getValues,+ }),+ [+ clearAllErrors,+ clearError,+ registerReceiveFocus,+ reset,+ setTouched,+ state,+ submit,+ validate,+ validateField,+ getValues,+ ]+ );+};diff --git a/packages/remix-validated-form/src/utils.ts b/packages/remix-validated-form/src/utils.tsnew file mode 100644index 0000000000..d94bc4e9bf--- /dev/null+++ b/packages/remix-validated-form/src/utils.ts@@ -0,0 +1,44 @@+import get from "lodash.get";++export const getPath = (object: any, path: string) => {+ return get(object, path);+};++export function setPath<T>(object: T, path: string, defaultValue: any) {+ return _setPathNormalized(object, stringToPathArray(path), defaultValue);+}++function _setPathNormalized(+ object: any,+ path: (string | number)[],+ value: any+): any {+ const leadingSegments = path.slice(0, -1);+ const lastSegment = path[path.length - 1];++ let obj = object;+ for (let i = 0; i < leadingSegments.length; i++) {+ const segment = leadingSegments[i];+ if (obj[segment] === undefined) {+ const nextSegment = leadingSegments[i + 1] ?? lastSegment;+ obj[segment] = typeof nextSegment === "number" ? [] : {};+ }+ obj = obj[segment];+ }+ obj[lastSegment] = value;+ return object;+}++export const stringToPathArray = <T extends string>(+ path: T+): (string | number)[] => {+ if (path.length === 0) return [];++ const match =+ path.match(/^\[(.+?)\](.*)$/) || path.match(/^\.?([^.[\]]+)(.*)$/);+ if (match) {+ const [, key, rest] = match;+ return [/^\d+$/.test(key) ? Number(key) : key, ...stringToPathArray(rest)];+ }+ return [path];+};diff --git a/packages/remix-validated-form/src/validation/createValidator.ts b/packages/remix-validated-form/src/validation/createValidator.tsnew file mode 100644index 0000000000..08fa242378--- /dev/null+++ b/packages/remix-validated-form/src/validation/createValidator.ts@@ -0,0 +1,53 @@+import * as R from "remeda";+import type { CreateValidatorArg, GenericObject, Validator } from "..";+import { FORM_ID_FIELD } from "../internal/constants";+import { objectFromPathEntries } from "../internal/flatten";++const preprocessFormData = (data: GenericObject | FormData): GenericObject => {+ // A slightly janky way of determining if the data is a FormData object+ // since node doesn't really have FormData+ if ("entries" in data && typeof data.entries === "function")+ return objectFromPathEntries([...data.entries()]);+ return objectFromPathEntries(Object.entries(data));+};++const omitInternalFields = (data: GenericObject): GenericObject =>+ R.omit(data, [FORM_ID_FIELD]);++/**+ * Used to create a validator for a form.+ * It provides built-in handling for unflattening nested objects and+ * extracting the values from FormData.+ */+export function createValidator<T>(+ validator: CreateValidatorArg<T>+): Validator<T> {+ return {+ validate: async (value) => {+ const data = preprocessFormData(value);+ const result = await validator.validate(omitInternalFields(data));++ if (result.error) {+ return {+ data: undefined,+ error: {+ fieldErrors: result.error,+ subaction: data.subaction,+ formId: data[FORM_ID_FIELD],+ },+ submittedData: data,+ formId: data[FORM_ID_FIELD],+ };+ }++ return {+ data: result.data,+ error: undefined,+ submittedData: data,+ formId: data[FORM_ID_FIELD],+ };+ },+ validateField: (data: GenericObject | FormData, field: string) =>+ validator.validateField(preprocessFormData(data), field),+ };+}diff --git a/packages/remix-validated-form/src/validation/types.ts b/packages/remix-validated-form/src/validation/types.tsnew file mode 100644index 0000000000..73bf062bcb--- /dev/null+++ b/packages/remix-validated-form/src/validation/types.ts@@ -0,0 +1,72 @@+export type FieldErrors = Record<string, string>;++export type TouchedFields = Record<string, boolean>;++export type GenericObject = { [key: string]: any };++export type ValidatorError = {+ subaction?: string;+ formId?: string;+ fieldErrors: FieldErrors;+};++export type ValidationErrorResponseData = {+ subaction?: string;+ formId?: string;+ fieldErrors: FieldErrors;+ repopulateFields?: unknown;+};++export type BaseResult = { submittedData: GenericObject; formId?: string };+export type ErrorResult = BaseResult & {+ error: ValidatorError;+ data: undefined;+};+export type SuccessResult<DataType> = BaseResult & {+ data: DataType;+ error: undefined;+};++/**+ * The result when validating a form.+ */+export type ValidationResult<DataType> = SuccessResult<DataType> | ErrorResult;++/**+ * The result when validating an individual field in a form.+ */+export type ValidateFieldResult = { error?: string };++/**+ * A `Validator` can be passed to the `validator` prop of a `ValidatedForm`.+ */+export type Validator<DataType> = {+ validate: (+ unvalidatedData: GenericObject+ ) => Promise<ValidationResult<DataType>>;+ /**+ * @deprecated Will be removed in a future version of remix-validated-form+ */+ validateField?: (+ unvalidatedData: GenericObject,+ field: string+ ) => Promise<ValidateFieldResult>;+};++export type Valid<DataType> = { data: DataType; error: undefined };+export type Invalid = { error: FieldErrors; data: undefined };+export type CreateValidatorArg<DataType> = {+ validate: (+ unvalidatedData: GenericObject+ ) => Promise<Valid<DataType> | Invalid>;+ validateField: (+ unvalidatedData: GenericObject,+ field: string+ ) => Promise<ValidateFieldResult>;+};++export type ValidatorData<T extends Validator<any>> = T extends Validator<+ infer U+>+ ? U+ : never;diff --git a/packages/remix-validated-form/src/withZod.ts b/packages/remix-validated-form/src/withZod.tsnew file mode 100644index 0000000000..31c29af764--- /dev/null+++ b/packages/remix-validated-form/src/withZod.ts@@ -0,0 +1,53 @@+import * as R from "remeda";+import type { z } from "zod";+import { stringToPathArray } from "./utils";+import { createValidator } from "./validation/createValidator";+import type { FieldErrors, Validator } from "./validation/types";++const getIssuesForError = (err: z.ZodError<any>): z.ZodIssue[] => {+ return err.issues.flatMap((issue) => {+ if ("unionErrors" in issue) {+ return issue.unionErrors.flatMap((err) => getIssuesForError(err));+ } else {+ return [issue];+ }+ });+};++function pathToString(array: (string | number)[]): string {+ return array.reduce(function (string: string, item: string | number) {+ const prefix = string === "" ? "" : ".";+ return string + (isNaN(Number(item)) ? prefix + item : "[" + item + "]");+ }, "");+}++/**+ * Create a validator using a `zod` schema.+ */+export function withZod<T, U extends z.ZodTypeDef>(+ zodSchema: z.Schema<T, U, unknown>,+ parseParams?: Partial<z.ParseParams>+): Validator<T> {+ return createValidator({+ validate: async (value) => {+ const result = await zodSchema.safeParseAsync(value, parseParams);+ if (result.success) return { data: result.data, error: undefined };++ const fieldErrors: FieldErrors = {};+ getIssuesForError(result.error).forEach((issue) => {+ const path = pathToString(issue.path);+ if (!fieldErrors[path]) fieldErrors[path] = issue.message;+ });+ return { error: fieldErrors, data: undefined };+ },+ validateField: async (data, field) => {+ const result = await zodSchema.safeParseAsync(data, parseParams);+ if (result.success) return { error: undefined };+ return {+ error: getIssuesForError(result.error).find((issue) =>+ R.equals(issue.path, stringToPathArray(field))+ )?.message,+ };+ },+ });+}diff --git a/packages/remix-validated-form/tailwind.config.js b/packages/remix-validated-form/tailwind.config.jsnew file mode 100644index 0000000000..0ea1cf06ca--- /dev/null+++ b/packages/remix-validated-form/tailwind.config.js@@ -0,0 +1 @@+module.exports = require("@carbon/tailwind/tailwind.config");diff --git a/packages/remix-validated-form/tsconfig.json b/packages/remix-validated-form/tsconfig.jsonnew file mode 100644index 0000000000..5c7482cdc8--- /dev/null+++ b/packages/remix-validated-form/tsconfig.json@@ -0,0 +1,13 @@+{+ "compilerOptions": {+ "lib": ["dom", "ES2015"],+ "resolveJsonModule": true,+ "baseUrl": ".",+ "paths": {+ "~/*": ["../../packages/react/src/*"]+ }+ },+ "extends": "@carbon/tsconfig/react-library.json",+ "include": ["src"],+ "exclude": ["**/*.d.ts", "./dist", "node_modules"]+}diff --git a/www/pages/develop/core-concepts/writing.mdx b/www/pages/develop/core-concepts/writing.mdxindex 98b73c609a..c744b10a45 100644--- a/www/pages/develop/core-concepts/writing.mdx+++ b/www/pages/develop/core-concepts/writing.mdx@@ -19,7 +19,7 @@ Data writes should include:Client-side validation and server-side validation can be done with the same validator. The convention is to store all validators for a module in `app/<module>/services/<module>.form.ts`. We use `zod` and `zod-form-data` for form validation. Here's an example of a simple validator:```ts-import { withZod } from "@remix-validated-form/with-zod";+import { withZod } from "@carbon/remix-validated-form";import { z } from "zod";import { zfd } from "zod-form-data";@@ -54,7 +54,7 @@ On the client-side, there are two major components to be aware of:Here's an example of how they work together on the client-side:```tsx-import { ValidatedForm } from "remix-validated-form";+import { ValidatedForm } from "@carbon/remix-validated-form";import { Boolean, Hidden, Input, Numeric, Submit } from "~/components/Form";import { personValidator } from "~/modules/people";@@ -84,7 +84,7 @@ The form is validated on the client-side before the form is submitted. If the foOn the server-side, we use the same validator in the `action` function to validate the form data. If the form data is invalid, we return the form with the errors. If the form data is valid, we call the service layer to perform the write.```tsx-import { validationError } from "remix-validated-form";+import { validationError } from "@carbon/remix-validated-form";import { createPerson, personValidator } from "~/modules/people";export async function action({ request }: ActionFunctionArgs) {