From 2c29f955cb1b8e009e0f5477e8fd4aee46f9649d Mon Sep 17 00:00:00 2001 From: Yihui Liao <44729383+yihuiliao@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:07:38 -0800 Subject: [PATCH 1/6] chore: add autofill stories --- .../stories/Form.stories.tsx | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 packages/react-aria-components/stories/Form.stories.tsx diff --git a/packages/react-aria-components/stories/Form.stories.tsx b/packages/react-aria-components/stories/Form.stories.tsx new file mode 100644 index 00000000000..98ade1ec7ff --- /dev/null +++ b/packages/react-aria-components/stories/Form.stories.tsx @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ + +import {action} from '@storybook/addon-actions'; +import {Button, FileTrigger, Form, Input, Label, ListBox, ListBoxItem, Link, Popover, Select, SelectValue, TextField} from 'react-aria-components'; +import React from 'react'; + +export default { + title: 'React Aria Components' +}; + + +export const FormExample = () => { + return ( +
{ + action('onSubmit')(Object.fromEntries(new FormData(e.target as HTMLFormElement).entries())); + e.preventDefault(); + }}> + + + + + + +
+ ); +}; + From dbaefb133c422fd19a2b4065456fc62d47e4894c Mon Sep 17 00:00:00 2001 From: Yihui Liao <44729383+yihuiliao@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:24:39 -0800 Subject: [PATCH 2/6] add more components to form stories --- .../stories/Form.stories.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/react-aria-components/stories/Form.stories.tsx b/packages/react-aria-components/stories/Form.stories.tsx index 98ade1ec7ff..5c26d814317 100644 --- a/packages/react-aria-components/stories/Form.stories.tsx +++ b/packages/react-aria-components/stories/Form.stories.tsx @@ -11,7 +11,7 @@ */ import {action} from '@storybook/addon-actions'; -import {Button, FileTrigger, Form, Input, Label, ListBox, ListBoxItem, Link, Popover, Select, SelectValue, TextField} from 'react-aria-components'; +import {Button, FileTrigger, Form, Group, Input, Label, ListBox, ListBoxItem, Link, NumberField, Popover, Select, SelectValue, TextField} from 'react-aria-components'; import React from 'react'; export default { @@ -28,9 +28,13 @@ export const FormExample = () => { }}> - + - + + + + + + + + + + + ); From ec10e2f85e51bca71c9861a1380d312b90dc2932 Mon Sep 17 00:00:00 2001 From: Yihui Liao <44729383+yihuiliao@users.noreply.github.com> Date: Tue, 4 Feb 2025 17:53:14 -0800 Subject: [PATCH 3/6] make autocomplete form more realistic --- .../stories/Form.stories.tsx | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/react-aria-components/stories/Form.stories.tsx b/packages/react-aria-components/stories/Form.stories.tsx index 5c26d814317..9e00dead300 100644 --- a/packages/react-aria-components/stories/Form.stories.tsx +++ b/packages/react-aria-components/stories/Form.stories.tsx @@ -22,44 +22,44 @@ export default { export const FormExample = () => { return (
{ action('onSubmit')(Object.fromEntries(new FormData(e.target as HTMLFormElement).entries())); e.preventDefault(); }}> - - - + + + - - - + + + - + + + + + + - - - - - - - - - ); From 997e74e63532a968d8277ccbd22c5c3fcbdcba1a Mon Sep 17 00:00:00 2001 From: Yihui Liao <44729383+yihuiliao@users.noreply.github.com> Date: Tue, 4 Feb 2025 17:53:38 -0800 Subject: [PATCH 4/6] rename story --- packages/react-aria-components/stories/Form.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-aria-components/stories/Form.stories.tsx b/packages/react-aria-components/stories/Form.stories.tsx index 9e00dead300..48eaf126352 100644 --- a/packages/react-aria-components/stories/Form.stories.tsx +++ b/packages/react-aria-components/stories/Form.stories.tsx @@ -19,7 +19,7 @@ export default { }; -export const FormExample = () => { +export const FormAutoFillExample = () => { return (
Date: Wed, 5 Feb 2025 10:33:50 -0800 Subject: [PATCH 5/6] fix lint --- .../react-aria-components/stories/Form.stories.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/react-aria-components/stories/Form.stories.tsx b/packages/react-aria-components/stories/Form.stories.tsx index 48eaf126352..6af26826533 100644 --- a/packages/react-aria-components/stories/Form.stories.tsx +++ b/packages/react-aria-components/stories/Form.stories.tsx @@ -11,7 +11,7 @@ */ import {action} from '@storybook/addon-actions'; -import {Button, FileTrigger, Form, Group, Input, Label, ListBox, ListBoxItem, Link, NumberField, Popover, Select, SelectValue, TextField} from 'react-aria-components'; +import {Button, Form, Input, Label, ListBox, ListBoxItem, Popover, Select, SelectValue, TextField} from 'react-aria-components'; import React from 'react'; export default { @@ -26,24 +26,24 @@ export const FormAutoFillExample = () => { onSubmit={e => { action('onSubmit')(Object.fromEntries(new FormData(e.target as HTMLFormElement).entries())); e.preventDefault(); - }}> + }}> - + - + - + - + -