From de341b7576aec743806c9a04f79435ff2bd87d1b Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Fri, 15 Dec 2023 10:38:56 -0600 Subject: [PATCH] chore: Bump form-state. --- package.json | 2 +- src/forms/BoundSelectAndTextField.stories.tsx | 4 +++- src/forms/SuperDrawerApp.stories.tsx | 3 ++- yarn.lock | 10 +++++----- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 15c0d4799..d92aa9612 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "format": "prettier --loglevel warn --write \"**/*.{ts,tsx,css,md,mdx}\"" }, "dependencies": { - "@homebound/form-state": "^2.20.1", + "@homebound/form-state": "^2.25.0", "@internationalized/number": "^3.0.3", "@popperjs/core": "^2.11.6", "@react-aria/utils": "^3.18.0", diff --git a/src/forms/BoundSelectAndTextField.stories.tsx b/src/forms/BoundSelectAndTextField.stories.tsx index 089757732..3faa3e821 100644 --- a/src/forms/BoundSelectAndTextField.stories.tsx +++ b/src/forms/BoundSelectAndTextField.stories.tsx @@ -4,13 +4,15 @@ import { Observer } from "mobx-react"; import { BoundSelectAndTextField } from "src"; import { ScheduleTypes } from "src/components/Filters/testDomain"; import { Css } from "src/Css"; +import { useState } from "react"; export default { component: BoundSelectAndTextField, } as Meta; export function Example() { - const formState = useFormState({ config, init: { type: ScheduleTypes.Task } }); + const [input] = useState({ type: ScheduleTypes.Task }); + const formState = useFormState({ config, init: { input } }); const types = [ { id: ScheduleTypes.Task, name: "Task" }, { id: ScheduleTypes.Milestone, name: "Milestone" }, diff --git a/src/forms/SuperDrawerApp.stories.tsx b/src/forms/SuperDrawerApp.stories.tsx index 863b724d8..818c23030 100644 --- a/src/forms/SuperDrawerApp.stories.tsx +++ b/src/forms/SuperDrawerApp.stories.tsx @@ -44,9 +44,10 @@ export function SuperDrawerApp() { } const initFormValue: AuthorInput = {}; + function SuperDrawerForm() { const { closeDrawer, addCanCloseDrawerCheck } = useSuperDrawer(); - const formState = useFormState({ config: formConfig, init: initFormValue }); + const formState = useFormState({ config: formConfig, init: { input: initFormValue } }); // eslint-disable-next-line react-hooks/exhaustive-deps useEffect(() => addCanCloseDrawerCheck(() => !formState.dirty), []); diff --git a/yarn.lock b/yarn.lock index e7dbaeca1..d73587335 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2625,7 +2625,7 @@ __metadata: "@emotion/jest": ^11.10.5 "@emotion/react": ^11.10.6 "@homebound/eslint-config": ^1.8.0 - "@homebound/form-state": ^2.20.1 + "@homebound/form-state": ^2.25.0 "@homebound/rtl-react-router-utils": 1.0.3 "@homebound/rtl-utils": ^2.65.0 "@homebound/truss": ^1.132.0 @@ -2753,16 +2753,16 @@ __metadata: languageName: node linkType: hard -"@homebound/form-state@npm:^2.20.1": - version: 2.20.1 - resolution: "@homebound/form-state@npm:2.20.1" +"@homebound/form-state@npm:^2.25.0": + version: 2.25.0 + resolution: "@homebound/form-state@npm:2.25.0" dependencies: fast-deep-equal: ^3.1.3 is-plain-object: ^5.0.0 peerDependencies: mobx: ">=6" react: ">=16" - checksum: a2509821a2d5f1f9887a3410b22d7f6c4952547132ca60f251c0a26de7ef6792eadca57c271a90dee1517b550c1e7ec0a6a439259de7e7a136a520c97bd38b71 + checksum: a78be0637c3e50276b83beb907925b171b23be7732dbd56c7a019e7bd196eca85d806ed330264bf230a9eb6ab3366ea4918bc0a708bf0f776efa757d0b889f95 languageName: node linkType: hard