From dde0f3a259d4d32eabc6e66a085532ffd1f53884 Mon Sep 17 00:00:00 2001 From: jdickman Date: Tue, 12 Dec 2023 15:21:01 -0800 Subject: [PATCH 1/2] organize component directories by type --- .../AnnotationModal.stories.tsx | 2 +- .../AnnotationModal/AnnotationModal.tsx | 18 ++++--- .../LoadingModal/LoadingModal.stories.tsx | 2 +- src/components/LoadingModal/LoadingModal.tsx | 8 ++-- .../data-display/Popover/Popover.stories.tsx | 47 +++++++++++++++++++ .../data-display/Popover/Popover.tsx | 12 +++++ .../AutoComplete/AutoComplete.stories.tsx | 6 +-- .../AutoComplete/AutoComplete.tsx | 0 .../DatePicker/DatePicker.stories.tsx | 2 +- .../DatePicker/DatePicker.tsx | 0 .../{ => data-entry}/Input/Input.stories.tsx | 2 +- .../{ => data-entry}/Input/Input.tsx | 0 .../{ => feedback}/Modal/Modal.stories.tsx | 6 +-- src/components/{ => feedback}/Modal/Modal.tsx | 0 .../{ => feedback}/Result/Result.stories.tsx | 2 +- .../{ => feedback}/Result/Result.tsx | 0 .../Skeleton/Skeleton.stories.tsx | 2 +- .../{ => feedback}/Skeleton/Skeleton.tsx | 0 .../{ => general}/Button/Button.stories.tsx | 0 .../{ => general}/Button/Button.tsx | 0 src/components/layout/Flex/Flex.stories.tsx | 19 ++++++++ src/components/layout/Flex/Flex.tsx | 12 +++++ src/components/layout/Space/Space.stories.tsx | 18 +++++++ src/components/layout/Space/Space.tsx | 12 +++++ .../Dropdown/Dropdown.stories.tsx | 4 +- .../{ => navigation}/Dropdown/Dropdown.tsx | 0 26 files changed, 146 insertions(+), 28 deletions(-) create mode 100644 src/components/data-display/Popover/Popover.stories.tsx create mode 100644 src/components/data-display/Popover/Popover.tsx rename src/components/{ => data-entry}/AutoComplete/AutoComplete.stories.tsx (86%) rename src/components/{ => data-entry}/AutoComplete/AutoComplete.tsx (100%) rename src/components/{ => data-entry}/DatePicker/DatePicker.stories.tsx (80%) rename src/components/{ => data-entry}/DatePicker/DatePicker.tsx (100%) rename src/components/{ => data-entry}/Input/Input.stories.tsx (89%) rename src/components/{ => data-entry}/Input/Input.tsx (100%) rename src/components/{ => feedback}/Modal/Modal.stories.tsx (83%) rename src/components/{ => feedback}/Modal/Modal.tsx (100%) rename src/components/{ => feedback}/Result/Result.stories.tsx (89%) rename src/components/{ => feedback}/Result/Result.tsx (100%) rename src/components/{ => feedback}/Skeleton/Skeleton.stories.tsx (83%) rename src/components/{ => feedback}/Skeleton/Skeleton.tsx (100%) rename src/components/{ => general}/Button/Button.stories.tsx (100%) rename src/components/{ => general}/Button/Button.tsx (100%) create mode 100644 src/components/layout/Flex/Flex.stories.tsx create mode 100644 src/components/layout/Flex/Flex.tsx create mode 100644 src/components/layout/Space/Space.stories.tsx create mode 100644 src/components/layout/Space/Space.tsx rename src/components/{ => navigation}/Dropdown/Dropdown.stories.tsx (91%) rename src/components/{ => navigation}/Dropdown/Dropdown.tsx (100%) diff --git a/src/components/AnnotationModal/AnnotationModal.stories.tsx b/src/components/AnnotationModal/AnnotationModal.stories.tsx index 1836d56b2..ee58a96b3 100644 --- a/src/components/AnnotationModal/AnnotationModal.stories.tsx +++ b/src/components/AnnotationModal/AnnotationModal.stories.tsx @@ -2,7 +2,7 @@ import React from "react"; import { useState } from "react"; import { Meta } from "@storybook/react"; import { StoryObj } from "@storybook/react"; -import { Button } from "src/components/Button/Button"; +import { Button } from "src/components/general/Button/Button"; import { AnnotationModal } from "src/components/AnnotationModal/AnnotationModal"; const meta: Meta = { diff --git a/src/components/AnnotationModal/AnnotationModal.tsx b/src/components/AnnotationModal/AnnotationModal.tsx index 122196031..ab7a7c64a 100644 --- a/src/components/AnnotationModal/AnnotationModal.tsx +++ b/src/components/AnnotationModal/AnnotationModal.tsx @@ -1,11 +1,12 @@ import React from "react"; import { LoadingModal } from "../LoadingModal/LoadingModal"; import { ILoadingModalProps } from "../LoadingModal/LoadingModal"; -import { Input } from "src/components/Input/Input"; -import { Dropdown } from "src/components/Dropdown/Dropdown"; -import { Button } from "src/components/Button/Button"; +import { DatePicker } from "src/components/data-entry/DatePicker/DatePicker"; +import { Dropdown } from "src/components/navigation/Dropdown/Dropdown"; +import { Input } from "src/components/data-entry/Input/Input"; +import { Flex } from "src/components/layout/Flex/Flex"; +import { Button } from "src/components/general/Button/Button"; import { ItemType } from "antd/es/menu/hooks/useItems"; -import { DatePicker } from "src/components/DatePicker/DatePicker"; export interface IAnnotationModalProps extends Omit, "fetchData" | "children"> { } @@ -35,22 +36,19 @@ export function AnnotationModal(props: IAnnotationModalProps) { fetchData={fetchAnnotations}> {initData => <> + + -

-

- -

- } menu={{ items: initData.events.map(event => ({ value: event.name, label: event.name, type: "group" } as ItemType)) }}> - +
} diff --git a/src/components/LoadingModal/LoadingModal.stories.tsx b/src/components/LoadingModal/LoadingModal.stories.tsx index aa034be30..73b786ea4 100644 --- a/src/components/LoadingModal/LoadingModal.stories.tsx +++ b/src/components/LoadingModal/LoadingModal.stories.tsx @@ -2,7 +2,7 @@ import React from "react"; import { useState } from "react"; import { Meta } from "@storybook/react"; import { StoryObj } from "@storybook/react"; -import { Button } from "src/components/Button/Button"; +import { Button } from "src/components/general/Button/Button"; import { LoadingModal } from "src/components/LoadingModal/LoadingModal"; import { ILoadingModalProps } from "src/components/LoadingModal/LoadingModal"; diff --git a/src/components/LoadingModal/LoadingModal.tsx b/src/components/LoadingModal/LoadingModal.tsx index b3035c03e..32f4a73fd 100644 --- a/src/components/LoadingModal/LoadingModal.tsx +++ b/src/components/LoadingModal/LoadingModal.tsx @@ -1,9 +1,9 @@ import React from "react"; import { useInitData } from "src/hooks/useInitData"; -import { Modal } from "src/components/Modal/Modal"; -import { IModalProps } from "src/components/Modal/Modal"; -import { Result } from "src/components/Result/Result"; -import { Skeleton } from "src/components/Skeleton/Skeleton"; +import { IModalProps } from "src/components/feedback/Modal/Modal"; +import { Skeleton } from "src/components/feedback/Skeleton/Skeleton"; +import { Modal } from "src/components/feedback/Modal/Modal"; +import { Result } from "src/components/feedback/Result/Result"; export interface ILoadingModalProps extends Omit { fetchData(): Promise; diff --git a/src/components/data-display/Popover/Popover.stories.tsx b/src/components/data-display/Popover/Popover.stories.tsx new file mode 100644 index 000000000..ce9b3bc80 --- /dev/null +++ b/src/components/data-display/Popover/Popover.stories.tsx @@ -0,0 +1,47 @@ +import React from "react"; +import { Popover } from "src/components/data-display/Popover/Popover"; +import { IPopoverProps } from "src/components/data-display/Popover/Popover"; +import { Meta } from "@storybook/react"; +import { StoryObj } from "@storybook/react"; +import { Button } from "src/components/general/Button/Button"; + +const meta: Meta = { + title: "Aquarium/Data Entry/Popover", + component: Popover, + + args: {}, +}; +export default meta; + + +type Story = StoryObj + +const PrimaryTemplate = (args: IPopoverProps) => { + + const content = ( +
+

Content

+
); + + return <> + +