Skip to content

Commit

Permalink
chore: Restructure UI components into folders (#2594)
Browse files Browse the repository at this point in the history
* chore: Restructure UI components into folders

* fix: Theme file moved in error
  • Loading branch information
ianjon3s authored Dec 21, 2023
1 parent 01bcb76 commit da0c42b
Show file tree
Hide file tree
Showing 138 changed files with 310 additions and 336 deletions.
10 changes: 5 additions & 5 deletions editor.planx.uk/src/@planx/components/AddressInput/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
} from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import Input from "ui/Input";
import InputRow from "ui/InputRow";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import RichTextInput from "ui/RichTextInput";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";

import { AddressInput, parseAddressInput } from "./model";

Expand Down
6 changes: 3 additions & 3 deletions editor.planx.uk/src/@planx/components/AddressInput/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import QuestionHeader from "@planx/components/shared/Preview/QuestionHeader";
import type { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import Input from "ui/Input";
import InputLabel from "ui/InputLabel";
import InputRowItem from "ui/InputRowItem";
import InputLabel from "ui/public/InputLabel";
import Input from "ui/shared/Input";
import InputRowItem from "ui/shared/InputRowItem";

import { ERROR_MESSAGE } from "../shared/constants";
import { getPreviouslySubmittedData, makeData } from "../shared/utils";
Expand Down
12 changes: 6 additions & 6 deletions editor.planx.uk/src/@planx/components/Calculate/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
} from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import Input from "ui/Input";
import InputGroup from "ui/InputGroup";
import InputRow from "ui/InputRow";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import OptionButton from "ui/OptionButton";
import InputGroup from "ui/editor/InputGroup";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import OptionButton from "ui/editor/OptionButton";
import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";

import type { Calculate } from "./model";
import { evaluate, getVariables, parseCalculate } from "./model";
Expand Down
22 changes: 11 additions & 11 deletions editor.planx.uk/src/@planx/components/Checklist/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import compose from "ramda/src/compose";
import remove from "ramda/src/remove";
import React, { useEffect, useRef } from "react";
import { FormikHookReturn } from "types";
import ImgInput from "ui/ImgInput";
import Input from "ui/Input";
import InputGroup from "ui/InputGroup";
import InputRow from "ui/InputRow";
import InputRowItem from "ui/InputRowItem";
import ListManager from "ui/ListManager";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import OptionButton from "ui/OptionButton";
import RichTextInput from "ui/RichTextInput";
import SimpleMenu from "ui/SimpleMenu";
import ImgInput from "ui/editor/ImgInput";
import InputGroup from "ui/editor/InputGroup";
import ListManager from "ui/editor/ListManager";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import OptionButton from "ui/editor/OptionButton";
import RichTextInput from "ui/editor/RichTextInput";
import SimpleMenu from "ui/editor/SimpleMenu";
import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";

import { Option, parseMoreInformation } from "../shared";
import PermissionSelect from "../shared/PermissionSelect";
Expand Down
10 changes: 5 additions & 5 deletions editor.planx.uk/src/@planx/components/Checklist/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import Card from "@planx/components/shared/Preview/Card";
import QuestionHeader from "@planx/components/shared/Preview/QuestionHeader";
import { getIn, useFormik } from "formik";
import React, { useState } from "react";
import ChecklistItem from "ui/ChecklistItem";
import ErrorWrapper from "ui/ErrorWrapper";
import { ExpandableList, ExpandableListItem } from "ui/ExpandableList";
import FormWrapper from "ui/FormWrapper";
import FullWidthWrapper from "ui/FullWidthWrapper";
import { ExpandableList, ExpandableListItem } from "ui/public/ExpandableList";
import FormWrapper from "ui/public/FormWrapper";
import FullWidthWrapper from "ui/public/FullWidthWrapper";
import ChecklistItem from "ui/shared/ChecklistItem";
import ErrorWrapper from "ui/shared/ErrorWrapper";
import { array, object } from "yup";

import { Option } from "../shared";
Expand Down
12 changes: 6 additions & 6 deletions editor.planx.uk/src/@planx/components/Confirmation/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import Box from "@mui/material/Box";
import { EditorProps, ICONS } from "@planx/components/ui";
import { useFormik } from "formik";
import React, { ChangeEvent } from "react";
import Input from "ui/Input";
import InputRow from "ui/InputRow";
import ListManager, {
EditorProps as ListManagerEditorProps,
} from "ui/ListManager";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import RichTextInput from "ui/RichTextInput";
} from "ui/editor/ListManager";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";

import { TYPES } from "../types";
import { Confirmation, parseNextSteps, Step } from "./model";
Expand Down
8 changes: 4 additions & 4 deletions editor.planx.uk/src/@planx/components/Confirmation/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import Card from "@planx/components/shared/Preview/Card";
import { PublicProps } from "@planx/components/ui";
import { useStore } from "pages/FlowEditor/lib/store";
import React from "react";
import Banner from "ui/Banner";
import FileDownload from "ui/FileDownload";
import NumberedList from "ui/NumberedList";
import ReactMarkdownOrHtml from "ui/ReactMarkdownOrHtml";
import Banner from "ui/public/Banner";
import FileDownload from "ui/public/FileDownload";
import NumberedList from "ui/public/NumberedList";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml";

import { makeCsvData } from "../Send/uniform";
import type { Confirmation } from "./model";
Expand Down
10 changes: 5 additions & 5 deletions editor.planx.uk/src/@planx/components/ContactInput/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
} from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import Input from "ui/Input";
import InputRow from "ui/InputRow";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import RichTextInput from "ui/RichTextInput";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";

import { ContactInput, parseContactInput } from "./model";

Expand Down
6 changes: 3 additions & 3 deletions editor.planx.uk/src/@planx/components/ContactInput/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import QuestionHeader from "@planx/components/shared/Preview/QuestionHeader";
import type { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import Input from "ui/Input";
import InputLabel from "ui/InputLabel";
import InputRowItem from "ui/InputRowItem";
import InputLabel from "ui/public/InputLabel";
import Input from "ui/shared/Input";
import InputRowItem from "ui/shared/InputRowItem";

import { ERROR_MESSAGE } from "../shared/constants";
import type { Contact, ContactInput } from "./model";
Expand Down
10 changes: 5 additions & 5 deletions editor.planx.uk/src/@planx/components/Content/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
} from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import ColorPicker from "ui/ColorPicker";
import InputRow from "ui/InputRow";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import RichTextInput from "ui/RichTextInput";
import ColorPicker from "ui/editor/ColorPicker";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import InputRow from "ui/shared/InputRow";

export type Props = EditorProps<TYPES.Content, Content>;

Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/Content/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Card from "@planx/components/shared/Preview/Card";
import { PublicProps } from "@planx/components/ui";
import React from "react";
import { getContrastTextColor } from "styleUtils";
import ReactMarkdownOrHtml from "ui/ReactMarkdownOrHtml";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml";

export type Props = PublicProps<Content>;

Expand Down
12 changes: 6 additions & 6 deletions editor.planx.uk/src/@planx/components/DateInput/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import {
} from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import DateInputUi from "ui/DateInput";
import Input from "ui/Input";
import InputRow from "ui/InputRow";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import RichTextInput from "ui/RichTextInput";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import DateInputUi from "ui/shared/DateInput";
import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";

export type Props = EditorProps<TYPES.DateInput, DateInput>;

Expand Down
4 changes: 2 additions & 2 deletions editor.planx.uk/src/@planx/components/DateInput/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import QuestionHeader from "@planx/components/shared/Preview/QuestionHeader";
import { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import DateInputComponent from "ui/DateInput";
import InputRow from "ui/InputRow";
import DateInputComponent from "ui/shared/DateInput";
import InputRow from "ui/shared/InputRow";
import { object } from "yup";

import { DESCRIPTION_TEXT, ERROR_MESSAGE } from "../shared/constants";
Expand Down
14 changes: 7 additions & 7 deletions editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
} from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import Input from "ui/Input";
import InputGroup from "ui/InputGroup";
import InputRow from "ui/InputRow";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import OptionButton from "ui/OptionButton";
import RichTextInput from "ui/RichTextInput";
import InputGroup from "ui/editor/InputGroup";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import OptionButton from "ui/editor/OptionButton";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";

import type { DrawBoundary } from "./model";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { type GeometryObject, point } from "@turf/helpers";
import { Store, useStore } from "pages/FlowEditor/lib/store";
import React, { useEffect, useRef, useState } from "react";
import { FONT_WEIGHT_SEMI_BOLD } from "theme";
import FullWidthWrapper from "ui/FullWidthWrapper";
import FullWidthWrapper from "ui/public/FullWidthWrapper";

import { DrawBoundary, PASSPORT_UPLOAD_KEY } from "../model";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { TYPES } from "@planx/components/types";
import { useFormik } from "formik";
import React from "react";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";

import { ICONS } from "../ui";

Expand Down
10 changes: 5 additions & 5 deletions editor.planx.uk/src/@planx/components/FileUpload/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { TYPES } from "@planx/components/types";
import { ICONS, InternalNotes, MoreInformation } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import Input from "ui/Input";
import InputRow from "ui/InputRow";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import RichTextInput from "ui/RichTextInput";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";

function Component(props: any) {
const formik = useFormik<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Store } from "pages/FlowEditor/lib/store";
import type { handleSubmit } from "pages/Preview/Node";
import React, { useEffect, useRef, useState } from "react";
import { FileWithPath } from "react-dropzone";
import ErrorWrapper from "ui/ErrorWrapper";
import ErrorWrapper from "ui/shared/ErrorWrapper";
import { array } from "yup";

import { PrivateFileUpload } from "../shared/PrivateFileUpload/PrivateFileUpload";
Expand Down
22 changes: 11 additions & 11 deletions editor.planx.uk/src/@planx/components/FileUploadAndLabel/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ import {
import { useFormik } from "formik";
import { lowerCase, merge, upperFirst } from "lodash";
import React from "react";
import ImgInput from "ui/ImgInput";
import Input from "ui/Input";
import InputRow from "ui/InputRow";
import InputRowItem from "ui/InputRowItem";
import ImgInput from "ui/editor/ImgInput";
import ListManager, {
EditorProps as ListManagerEditorProps,
} from "ui/ListManager";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import { ModalSubtitle } from "ui/ModalSubtitle";
import OptionButton from "ui/OptionButton";
import RichTextInput from "ui/RichTextInput";
import SelectInput from "ui/SelectInput";
} from "ui/editor/ListManager";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import { ModalSubtitle } from "ui/editor/ModalSubtitle";
import OptionButton from "ui/editor/OptionButton";
import RichTextInput from "ui/editor/RichTextInput";
import SelectInput from "ui/editor/SelectInput";
import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";

import {
checkIfConditionalRule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Typography from "@mui/material/Typography";
import capitalize from "lodash/capitalize";
import React, { useEffect, useState } from "react";
import { usePrevious } from "react-use";
import ErrorWrapper from "ui/ErrorWrapper";
import ErrorWrapper from "ui/shared/ErrorWrapper";

import { FileUploadSlot } from "../FileUpload/Public";
import { UploadedFileCard } from "../shared/PrivateFileUpload/UploadedFileCard";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import {
import { useStore } from "pages/FlowEditor/lib/store";
import React, { useEffect, useState } from "react";
import { usePrevious } from "react-use";
import ErrorWrapper from "ui/ErrorWrapper";
import FullWidthWrapper from "ui/FullWidthWrapper";
import ReactMarkdownOrHtml from "ui/ReactMarkdownOrHtml";
import { emptyContent } from "ui/RichTextInput";
import { emptyContent } from "ui/editor/RichTextInput";
import FullWidthWrapper from "ui/public/FullWidthWrapper";
import ErrorWrapper from "ui/shared/ErrorWrapper";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml";

import { FileUploadSlot } from "../FileUpload/Public";
import { MoreInformation } from "../shared";
Expand Down
16 changes: 8 additions & 8 deletions editor.planx.uk/src/@planx/components/FindProperty/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import {
} from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import Input from "ui/Input";
import InputGroup from "ui/InputGroup";
import InputRow from "ui/InputRow";
import InputRowItem from "ui/InputRowItem";
import ModalSection from "ui/ModalSection";
import ModalSectionContent from "ui/ModalSectionContent";
import OptionButton from "ui/OptionButton";
import RichTextInput from "ui/RichTextInput";
import InputGroup from "ui/editor/InputGroup";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import OptionButton from "ui/editor/OptionButton";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";

import type { FindProperty } from "./model";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { publicClient } from "lib/graphql";
import find from "lodash/find";
import { parse, toNormalised } from "postcode";
import React, { useEffect, useState } from "react";
import Input from "ui/Input";
import InputLabel from "ui/InputLabel";
import InputLabel from "ui/public/InputLabel";
import Input from "ui/shared/Input";

import type { SiteAddress } from "../model";
import { FETCH_BLPU_CODES } from "../Public";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
import { GeoJSONObject } from "@turf/helpers";
import { useStore } from "pages/FlowEditor/lib/store";
import React, { useEffect, useState } from "react";
import Input from "ui/Input";
import InputLabel from "ui/InputLabel";
import InputLabel from "ui/public/InputLabel";
import Input from "ui/shared/Input";

import { DEFAULT_NEW_ADDRESS_LABEL, SiteAddress } from "../model";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, { useEffect, useState } from "react";
import useSWR from "swr";
import ExternalPlanningSiteDialog, {
DialogPurpose,
} from "ui/ExternalPlanningSiteDialog";
} from "ui/public/ExternalPlanningSiteDialog";

import {
DEFAULT_NEW_ADDRESS_TITLE,
Expand Down
Loading

0 comments on commit da0c42b

Please sign in to comment.