diff --git a/frontend/apps/editor3d/app/src/components/reusable/Input/Input.mdx b/frontend/apps/editor3d/app/src/components/reusable/Input/Input.mdx deleted file mode 100644 index e8eb7b347a..0000000000 --- a/frontend/apps/editor3d/app/src/components/reusable/Input/Input.mdx +++ /dev/null @@ -1,19 +0,0 @@ -import { Canvas, Meta } from '@storybook/blocks'; - -import * as InputStories from './Input.stories'; - - - -# Input control - -Here is the input with placeholder - - -Here is the input with icon - - -Here is the input with label - - -Here is the input with error message - diff --git a/frontend/apps/editor3d/app/src/components/reusable/Input/Input.stories.tsx b/frontend/apps/editor3d/app/src/components/reusable/Input/Input.stories.tsx deleted file mode 100644 index b2804d63f5..0000000000 --- a/frontend/apps/editor3d/app/src/components/reusable/Input/Input.stories.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react"; -import { Input } from "./Input"; -import { withActions } from "@storybook/addon-actions/decorator"; -import { faUser } from "@fortawesome/pro-solid-svg-icons"; - -const meta: Meta = { - component: Input, - parameters: { - actions: { - handles: ["change", "blur", "focus"], - }, - }, - decorators: [withActions], -}; - -type Story = StoryObj; - -export const Default: Story = { - render: () => ( -
- -
- ), -}; - -export const WithIcon: Story = { - render: () => ( -
- -
- ), -}; - -export const WithLabel: Story = { - render: () => ( -
- -
- ), -}; - -export const WithError: Story = { - render: () => ( -
- -
- ), -}; - -export default meta; diff --git a/frontend/apps/editor3d/app/src/components/reusable/Input/Input.tsx b/frontend/apps/editor3d/app/src/components/reusable/Input/Input.tsx deleted file mode 100644 index 7eeab2124c..0000000000 --- a/frontend/apps/editor3d/app/src/components/reusable/Input/Input.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import React from "react"; -import { twMerge } from "tailwind-merge"; -import { IconDefinition } from "@fortawesome/pro-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { Label, H6 } from "~/components"; -import { kebabCase } from "~/utilities"; -import { - disableHotkeyInput, - enableHotkeyInput, - DomLevels, -} from "~/pages/PageEnigma/signals"; - -interface InputProps extends React.InputHTMLAttributes { - inputClassName?: string; - iconClassName?: string; - label?: string; - icon?: IconDefinition; - isError?: boolean; - errorMessage?: string; -} - -export const Input = React.forwardRef( - ( - { - label, - icon, - inputClassName, - iconClassName, - className, - id, - isError, - onBlur, - onFocus, - errorMessage, - ...rest - }: InputProps, - ref: React.ForwardedRef, - ) => { - return ( -
- {label && } - -
- {icon && ( - - )} - ) => { - if (onFocus) { - onFocus(e); - } - disableHotkeyInput(DomLevels.INPUT); - }} - onBlur={(e: React.FocusEvent) => { - if (onBlur) { - onBlur(e); - } - enableHotkeyInput(DomLevels.INPUT); - }} - {...rest} - /> - {errorMessage && ( -
{errorMessage}
- )} -
-
- ); - }, -); - -Input.displayName = "Input"; diff --git a/frontend/apps/editor3d/app/src/components/reusable/Input/index.ts b/frontend/apps/editor3d/app/src/components/reusable/Input/index.ts deleted file mode 100644 index be66d7661c..0000000000 --- a/frontend/apps/editor3d/app/src/components/reusable/Input/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./Input"; diff --git a/frontend/apps/editor3d/app/src/components/reusable/NumberInput/NumberInput.tsx b/frontend/apps/editor3d/app/src/components/reusable/NumberInput/NumberInput.tsx index bbd2011ae2..e5dd2efc58 100644 --- a/frontend/apps/editor3d/app/src/components/reusable/NumberInput/NumberInput.tsx +++ b/frontend/apps/editor3d/app/src/components/reusable/NumberInput/NumberInput.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react"; -import { Input } from "../Input"; +import { Input } from "@storyteller/ui-input"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faChevronDown, faChevronUp } from "@fortawesome/pro-solid-svg-icons"; import { twMerge } from "tailwind-merge"; diff --git a/frontend/apps/editor3d/app/src/components/reusable/UploadModal/UploadFiles.tsx b/frontend/apps/editor3d/app/src/components/reusable/UploadModal/UploadFiles.tsx index 948ae64d4c..81a13b9e80 100644 --- a/frontend/apps/editor3d/app/src/components/reusable/UploadModal/UploadFiles.tsx +++ b/frontend/apps/editor3d/app/src/components/reusable/UploadModal/UploadFiles.tsx @@ -1,7 +1,6 @@ -import { H6, Input, ListDropdown } from "~/components"; -import { - Button -} from "@storyteller/ui-button" +import { H6, ListDropdown } from "~/components"; +import { Input } from "@storyteller/ui-input"; +import { Button } from "@storyteller/ui-button"; import { FileUploader } from "./FileUploader"; import { useState } from "react"; import { diff --git a/frontend/apps/editor3d/app/src/components/reusable/UploadModal3D/UploadFiles3D.tsx b/frontend/apps/editor3d/app/src/components/reusable/UploadModal3D/UploadFiles3D.tsx index 7ffb22a788..aec65a0e59 100644 --- a/frontend/apps/editor3d/app/src/components/reusable/UploadModal3D/UploadFiles3D.tsx +++ b/frontend/apps/editor3d/app/src/components/reusable/UploadModal3D/UploadFiles3D.tsx @@ -1,8 +1,8 @@ import { useCallback, useEffect, useState, useRef } from "react"; -import { H6, Input, Label, ListDropdown } from "~/components"; -import { - Button -} from "@storyteller/ui-button" +import { H6, ListDropdown } from "~/components"; +import { Button } from "@storyteller/ui-button"; +import { Input } from "@storyteller/ui-input"; +import { Label } from "@storyteller/ui-label"; import { FileUploader } from "../UploadModal/FileUploader"; import { loadPreviewOnCanvas, snapshotCanvasAsThumbnail } from "./utilities"; import { upload3DObjects } from "./utilities/upload3DObjects"; diff --git a/frontend/apps/editor3d/app/src/components/reusable/UploadModalMedia/UploadFilesMedia.tsx b/frontend/apps/editor3d/app/src/components/reusable/UploadModalMedia/UploadFilesMedia.tsx index fe6bb9d456..f7ece0dd01 100644 --- a/frontend/apps/editor3d/app/src/components/reusable/UploadModalMedia/UploadFilesMedia.tsx +++ b/frontend/apps/editor3d/app/src/components/reusable/UploadModalMedia/UploadFilesMedia.tsx @@ -1,6 +1,7 @@ import { useState } from "react"; -import { H6, Input } from "~/components"; -import { Button } from "@storyteller/ui-button" +import { H6 } from "~/components"; +import { Button } from "@storyteller/ui-button"; +import { Input } from "@storyteller/ui-input"; import { FileUploader } from "../UploadModal/FileUploader"; import { uploadPlane } from "./uploadPlane"; import { UploaderState } from "~/models"; diff --git a/frontend/apps/editor3d/app/src/components/reusable/UploadModalMedia/UploadImageMedia.tsx b/frontend/apps/editor3d/app/src/components/reusable/UploadModalMedia/UploadImageMedia.tsx index d54ac7c722..d5799b74f9 100644 --- a/frontend/apps/editor3d/app/src/components/reusable/UploadModalMedia/UploadImageMedia.tsx +++ b/frontend/apps/editor3d/app/src/components/reusable/UploadModalMedia/UploadImageMedia.tsx @@ -1,9 +1,8 @@ import { useState } from "react"; - -import { H6, Input } from "~/components"; -import { Button } from "@storyteller/ui-button" +import { H6 } from "~/components"; +import { Button } from "@storyteller/ui-button"; +import { Input } from "@storyteller/ui-input"; import { FileUploader } from "../UploadModal/FileUploader"; - import { UploaderState } from "~/models"; import { uploadImage } from "./uploadImage"; @@ -59,7 +58,7 @@ export const UploadImageMedia = ({ return ( <> -
+
- { - assetFile.error && ( -
{assetFile.error}
- ) - } + {assetFile.error && ( +
{assetFile.error}
+ )} -
+
{!assetFile.value && ( -
+
File Preview
)} - { - assetFile.value && + {assetFile.value && ( file upload preview - - } + )}
- < div className="flex justify-end gap-4" > - - < Button variant="secondary" onClick={onClose} > +
diff --git a/frontend/apps/editor3d/app/src/components/reusable/index.ts b/frontend/apps/editor3d/app/src/components/reusable/index.ts index 576bf6770a..fa37d933c8 100644 --- a/frontend/apps/editor3d/app/src/components/reusable/index.ts +++ b/frontend/apps/editor3d/app/src/components/reusable/index.ts @@ -1,7 +1,6 @@ export * from "./FileUploader"; export * from "./FilterButtons"; export * from "./Gravatar"; -export * from "./Input"; export * from "./InputVector"; export * from "./ListDropdown"; export * from "./LoadingBar"; diff --git a/frontend/apps/editor3d/app/src/components/signaled/TopBar/SceneTitleInput.tsx b/frontend/apps/editor3d/app/src/components/signaled/TopBar/SceneTitleInput.tsx index 08e8bbeb30..eb54401538 100644 --- a/frontend/apps/editor3d/app/src/components/signaled/TopBar/SceneTitleInput.tsx +++ b/frontend/apps/editor3d/app/src/components/signaled/TopBar/SceneTitleInput.tsx @@ -3,15 +3,14 @@ import { twMerge } from "tailwind-merge"; import { useSignals } from "@preact/signals-react/runtime"; import { faPencil, faSpinnerThird } from "@fortawesome/pro-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { scene, signalScene, authentication, currentPage } from "~/signals"; +import { scene, signalScene, authentication } from "~/signals"; import { showErrorDialog, errorDialogMessage, errorDialogTitle, } from "~/pages/PageEnigma/signals"; -import { Input } from "~/components"; +import { Input } from "@storyteller/ui-input"; import { MediaFilesApi } from "~/Classes/ApiManager/MediaFilesApi"; -import { Pages } from "~/pages/PageEnigma/constants/page"; interface Props { pageName: string; diff --git a/frontend/apps/editor3d/app/src/pages/Page2d/components/features/DialogEditText/DialogEditText.tsx b/frontend/apps/editor3d/app/src/pages/Page2d/components/features/DialogEditText/DialogEditText.tsx index 06b89bd1c2..6b413eb665 100644 --- a/frontend/apps/editor3d/app/src/pages/Page2d/components/features/DialogEditText/DialogEditText.tsx +++ b/frontend/apps/editor3d/app/src/pages/Page2d/components/features/DialogEditText/DialogEditText.tsx @@ -30,12 +30,9 @@ export type TextFormatData = { export type TextNodeData = { text: string; } & TextFormatData; - import { useState } from "react"; - -import { DialogTitle } from "@headlessui/react"; -import { Button, TextEditor } from "../../../components/ui"; - +import { TextEditor } from "../../../components/ui"; +import { Button } from "@storyteller/ui-button"; import { Modal } from "@storyteller/ui-modal"; export const DialogEditText = ({ diff --git a/frontend/apps/editor3d/app/src/pages/Page2d/components/features/DialogError/index.tsx b/frontend/apps/editor3d/app/src/pages/Page2d/components/features/DialogError/index.tsx index 21de24579e..382e833fbb 100644 --- a/frontend/apps/editor3d/app/src/pages/Page2d/components/features/DialogError/index.tsx +++ b/frontend/apps/editor3d/app/src/pages/Page2d/components/features/DialogError/index.tsx @@ -1,13 +1,16 @@ import { twMerge } from "tailwind-merge"; -import { dialogPanelStyles, paperWrapperStyles } from "../../../components/styles"; +import { + dialogPanelStyles, + paperWrapperStyles, +} from "../../../components/styles"; import { Description, Dialog, DialogPanel, DialogTitle, } from "@headlessui/react"; -import { Button } from "../../../components/ui"; +import { Button } from "@storyteller/ui-button"; export const DialogError = ({ isShowing, diff --git a/frontend/apps/editor3d/app/src/pages/Page2d/components/features/ToolbarMain/ButtonPreviewAndRender.tsx b/frontend/apps/editor3d/app/src/pages/Page2d/components/features/ToolbarMain/ButtonPreviewAndRender.tsx index 20f52b33dc..dcc6c0a3e4 100644 --- a/frontend/apps/editor3d/app/src/pages/Page2d/components/features/ToolbarMain/ButtonPreviewAndRender.tsx +++ b/frontend/apps/editor3d/app/src/pages/Page2d/components/features/ToolbarMain/ButtonPreviewAndRender.tsx @@ -1,5 +1,6 @@ import { faCameraMovie, faPlayCircle } from "@fortawesome/pro-solid-svg-icons"; -import { Button, Tooltip } from "~/components/ui"; +import { Button } from "@storyteller/ui-button"; +import { Tooltip } from "@storyteller/ui-tooltip"; import { ToolbarButtonProps } from "../ToolbarButton"; export const ButtonPreviewAndRender = ({ @@ -9,10 +10,7 @@ export const ButtonPreviewAndRender = ({ buttonPreviewProps: ToolbarButtonProps; buttonRenderProps: ToolbarButtonProps; }) => { - return ( -
-
- ); + return
; }; const ButtonPreview = (buttonProps: ToolbarButtonProps) => { const { diff --git a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/Input.tsx b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/Input.tsx deleted file mode 100644 index 88efddb17f..0000000000 --- a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/Input.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import React from "react"; -import { twMerge } from "tailwind-merge"; -import { IconDefinition } from "@fortawesome/pro-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { kebabCase } from "~/utilities"; - -interface InputProps extends React.InputHTMLAttributes { - inputClassName?: string; - iconClassName?: string; - label?: string; - icon?: IconDefinition; - isError?: boolean; - errorMessage?: string; -} - -export const Input = React.forwardRef( - ( - { - label, - icon, - inputClassName, - iconClassName, - className, - id, - isError, - onBlur, - onFocus, - errorMessage, - ...rest - }: InputProps, - ref: React.ForwardedRef, - ) => { - return ( -
- {label && ( - - )} - -
- {icon && ( - - )} - ) => { - if (onFocus) { - onFocus(e); - } - }} - onBlur={(e: React.FocusEvent) => { - if (onBlur) { - onBlur(e); - } - }} - {...rest} - /> - {errorMessage && ( -
{errorMessage}
- )} -
-
- ); - }, -); - -Input.displayName = "Input"; diff --git a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/InputNumber.tsx b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/InputNumber.tsx index 7451e437a5..de2627d792 100644 --- a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/InputNumber.tsx +++ b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/InputNumber.tsx @@ -2,8 +2,7 @@ import React, { useEffect, useState } from "react"; import { twMerge } from "tailwind-merge"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faChevronDown, faChevronUp } from "@fortawesome/pro-solid-svg-icons"; - -import { Input } from "./Input"; +import { Input } from "@storyteller/ui-input"; interface NumberInputProps { value: number; diff --git a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/TextEditor/ColorPicker.tsx b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/TextEditor/ColorPicker.tsx index 5bdd9026ca..9e59c62804 100644 --- a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/TextEditor/ColorPicker.tsx +++ b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/TextEditor/ColorPicker.tsx @@ -11,7 +11,7 @@ import { twMerge } from "tailwind-merge"; import { paperWrapperStyles } from "../../../components/styles"; import { Button } from "../Button"; -import { Input } from "../Input"; +import { Input } from "@storyteller/ui-input"; import { HexEyedropPicker } from "../HexEyedropPicker"; export const ColorPicker = ({ diff --git a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/ToolbarMain/BackgroundMenu.tsx b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/ToolbarMain/BackgroundMenu.tsx index cd1a7f874e..0c072eac40 100644 --- a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/ToolbarMain/BackgroundMenu.tsx +++ b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/ToolbarMain/BackgroundMenu.tsx @@ -8,12 +8,11 @@ import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react"; import { ChangeEvent, useEffect, useState } from "react"; import { HexColorPicker } from "react-colorful"; import { twMerge } from "tailwind-merge"; - import { useSignals } from "@preact/signals-react/runtime"; import { paperWrapperStyles } from "~/components/styles"; -import { Button } from "../Button"; +import { Button } from "@storyteller/ui-button"; import { HexEyedropPicker } from "../HexEyedropPicker"; -import { Input } from "../Input"; +import { Input } from "@storyteller/ui-input"; export const BackgroundMenu = ({ color: prevColor, @@ -90,7 +89,7 @@ export const BackgroundMenu = ({ if (streamChanges) { onChange(color); } - } + }; // Rerender the component when these signals change: useSignals(); diff --git a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/ToolbarMain/PaintModeMenu.tsx b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/ToolbarMain/PaintModeMenu.tsx index 5822afae4e..2c0606a32c 100644 --- a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/ToolbarMain/PaintModeMenu.tsx +++ b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/ToolbarMain/PaintModeMenu.tsx @@ -8,7 +8,6 @@ import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react"; import { ChangeEvent, useEffect, useState, useRef } from "react"; import { HexAlphaColorPicker } from "react-colorful"; import { twMerge } from "tailwind-merge"; - import { useSignals } from "@preact/signals-react/runtime"; import { paperWrapperStyles } from "../../../components/styles"; import { diff --git a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/index.ts b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/index.ts index 788a004ad8..232e097088 100644 --- a/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/index.ts +++ b/frontend/apps/editor3d/app/src/pages/Page2d/components/ui/index.ts @@ -1,5 +1,3 @@ -export * from "./Button"; -export * from "./Input"; export * from "./InputNumber"; export * from "./LoadingBar"; export * from "./LoadingSpinner"; diff --git a/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/GenerateModals/Sharing.tsx b/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/GenerateModals/Sharing.tsx index 56ea7f2801..7c843927a5 100644 --- a/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/GenerateModals/Sharing.tsx +++ b/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/GenerateModals/Sharing.tsx @@ -5,7 +5,6 @@ import { Input } from "@storyteller/ui-input"; import { Label } from "@storyteller/ui-label"; import { Button } from "@storyteller/ui-button"; import { Modal } from "@storyteller/ui-modal"; - import { faArrowDownToLine, faArrowRight, @@ -16,7 +15,6 @@ import { import SocialButton from "./SocialButton"; import { generateMovieId, viewMyMovies } from "~/pages/PageEnigma/signals"; import dayjs from "dayjs"; - import { downloadFile } from "~/pages/PageEnigma/comps/GenerateModals/utils/downloadFile"; import { GetCdnOrigin } from "~/api/GetCdnOrigin"; diff --git a/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/Outliner/Outliner.tsx b/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/Outliner/Outliner.tsx index 5c4761932e..932d28e54c 100644 --- a/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/Outliner/Outliner.tsx +++ b/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/Outliner/Outliner.tsx @@ -17,7 +17,7 @@ import { faLockOpen, faXmark, } from "@fortawesome/pro-solid-svg-icons"; -import { Input } from "~/components"; +import { Input } from "@storyteller/ui-input"; import { Button } from "@storyteller/ui-button"; import { Transition } from "@headlessui/react"; import { twMerge } from "tailwind-merge"; diff --git a/frontend/apps/editor3d/app/src/signup.tsx b/frontend/apps/editor3d/app/src/signup.tsx index 683bd07ad5..ee8deaf26d 100644 --- a/frontend/apps/editor3d/app/src/signup.tsx +++ b/frontend/apps/editor3d/app/src/signup.tsx @@ -1,6 +1,6 @@ import { faEnvelope, faKey, faUser } from "@fortawesome/pro-solid-svg-icons"; import { GlobalSettingsManager } from "./pages/PageEnigma/GlobalSettingsManager"; -import { Input } from "~/components"; +import { Input } from "@storyteller/ui-input"; import { Button } from "@storyteller/ui-button"; import { addToast, authentication, signUp } from "~/signals"; import { FormEvent, useRef, useState, StrictMode } from "react";