diff --git a/packages/ui/components/editor/Editor.test.tsx b/packages/ui/components/editor/Editor.test.tsx index c8a495749d..f3ca4629d0 100644 --- a/packages/ui/components/editor/Editor.test.tsx +++ b/packages/ui/components/editor/Editor.test.tsx @@ -2,8 +2,8 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, it, expect, vi } from "vitest"; -import type { TextEditorProps } from "./Editor"; import { Editor } from "./Editor"; +import type { TextEditorProps } from "./types"; describe("Editor", () => { const defaultProps: TextEditorProps = { diff --git a/packages/ui/components/editor/Editor.tsx b/packages/ui/components/editor/Editor.tsx index c7b1de53f2..474f3325b2 100644 --- a/packages/ui/components/editor/Editor.tsx +++ b/packages/ui/components/editor/Editor.tsx @@ -12,7 +12,6 @@ import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPl import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin"; import { HeadingNode, QuoteNode } from "@lexical/rich-text"; import { TableCellNode, TableNode, TableRowNode } from "@lexical/table"; -import type { Dispatch, SetStateAction } from "react"; import classNames from "@calcom/ui/classNames"; @@ -25,6 +24,7 @@ import PlainTextPlugin from "./plugins/PlainTextPlugin"; import ToolbarPlugin from "./plugins/ToolbarPlugin"; import CustomEnterKeyPlugin from "./plugins/customEnterKeyPlugin"; import "./stylesEditor.css"; +import type { TextEditorProps } from "./types"; /* Default toolbar items: @@ -33,22 +33,6 @@ import "./stylesEditor.css"; - italic - link */ -export type TextEditorProps = { - getText: () => string; - setText: (text: string) => void; - excludedToolbarItems?: string[]; - variables?: string[]; - addVariableButtonTop?: boolean; - height?: string; - maxHeight?: string; - placeholder?: string; - disableLists?: boolean; - updateTemplate?: boolean; - firstRender?: boolean; - setFirstRender?: Dispatch>; - editable?: boolean; - plainText?: boolean; -}; const editorConfig = { theme: ExampleTheme, diff --git a/packages/ui/components/editor/index.ts b/packages/ui/components/editor/index.ts index 82463f3619..1d21bf7224 100644 --- a/packages/ui/components/editor/index.ts +++ b/packages/ui/components/editor/index.ts @@ -1,3 +1,3 @@ export { Editor } from "./Editor"; -export type { TextEditorProps } from "./Editor"; +export type { TextEditorProps } from "./types"; export { AddVariablesDropdown } from "./plugins/AddVariablesDropdown"; diff --git a/packages/ui/components/editor/plugins/ToolbarPlugin.tsx b/packages/ui/components/editor/plugins/ToolbarPlugin.tsx index aafa5cf595..037a02e2a9 100644 --- a/packages/ui/components/editor/plugins/ToolbarPlugin.tsx +++ b/packages/ui/components/editor/plugins/ToolbarPlugin.tsx @@ -30,7 +30,7 @@ import { createPortal } from "react-dom"; import { Button } from "../../button"; import { Dropdown, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../dropdown"; import { Icon } from "../../icon"; -import type { TextEditorProps } from "../Editor"; +import type { TextEditorProps } from "../types"; import { AddVariablesDropdown } from "./AddVariablesDropdown"; const LowPriority = 1; diff --git a/packages/ui/components/editor/types.ts b/packages/ui/components/editor/types.ts new file mode 100644 index 0000000000..8c08c560a4 --- /dev/null +++ b/packages/ui/components/editor/types.ts @@ -0,0 +1,18 @@ +import type { Dispatch, SetStateAction } from "react"; + +export type TextEditorProps = { + getText: () => string; + setText: (text: string) => void; + excludedToolbarItems?: string[]; + variables?: string[]; + addVariableButtonTop?: boolean; + height?: string; + maxHeight?: string; + placeholder?: string; + disableLists?: boolean; + updateTemplate?: boolean; + firstRender?: boolean; + setFirstRender?: Dispatch>; + editable?: boolean; + plainText?: boolean; +}; diff --git a/packages/ui/components/form/select/Select.tsx b/packages/ui/components/form/select/Select.tsx index 33eb270615..4fca78e38c 100644 --- a/packages/ui/components/form/select/Select.tsx +++ b/packages/ui/components/form/select/Select.tsx @@ -1,6 +1,6 @@ import { useId } from "@radix-ui/react-id"; import * as React from "react"; -import type { GroupBase, Props, SingleValue, MultiValue } from "react-select"; +import type { GroupBase, SingleValue, MultiValue } from "react-select"; import ReactSelect from "react-select"; import { useLocale } from "@calcom/lib/hooks/useLocale"; @@ -9,17 +9,7 @@ import cx from "@calcom/ui/classNames"; import { Label } from "../inputs/Label"; import { inputStyles } from "../inputs/TextField"; import { getReactSelectProps } from "./selectTheme"; - -export type SelectProps< - Option, - IsMulti extends boolean = false, - Group extends GroupBase