fix: calcom UI circle dep (#19839)
* editor circle dep fix * circle dep fix in select * fix barrel export types --------- Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
1 parent
a385bd4d5f
commit
7e2a0d1a1b
8 files changed
+37
-33
No files matched your search
@@ -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 = {
|
||||
|
||||
@@ -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<SetStateAction<boolean>>;
|
||||
editable?: boolean;
|
||||
plainText?: boolean;
|
||||
};
|
||||
|
||||
const editorConfig = {
|
||||
theme: ExampleTheme,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export { Editor } from "./Editor";
|
||||
export type { TextEditorProps } from "./Editor";
|
||||
export type { TextEditorProps } from "./types";
|
||||
export { AddVariablesDropdown } from "./plugins/AddVariablesDropdown";
|
||||
@@ -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;
|
||||
|
||||
@@ -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<SetStateAction<boolean>>;
|
||||
editable?: boolean;
|
||||
plainText?: boolean;
|
||||
};
|
||||
@@ -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<Option> = GroupBase<Option>
|
||||
> = Props<Option, IsMulti, Group> & {
|
||||
variant?: "default" | "checkbox";
|
||||
"data-testid"?: string;
|
||||
size?: "sm" | "md";
|
||||
grow?: boolean;
|
||||
};
|
||||
import type { SelectProps } from "./types";
|
||||
|
||||
export const Select = <
|
||||
Option,
|
||||
|
||||
@@ -5,7 +5,7 @@ import classNames from "@calcom/ui/classNames";
|
||||
|
||||
import { UpgradeTeamsBadge } from "../../badge";
|
||||
import { Icon } from "../../icon";
|
||||
import type { SelectProps } from "./Select";
|
||||
import type { SelectProps } from "./types";
|
||||
|
||||
export const InputComponent = <
|
||||
Option,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { GroupBase, Props } from "react-select";
|
||||
|
||||
export type SelectProps<
|
||||
Option,
|
||||
IsMulti extends boolean = false,
|
||||
Group extends GroupBase<Option> = GroupBase<Option>
|
||||
> = Props<Option, IsMulti, Group> & {
|
||||
variant?: "default" | "checkbox";
|
||||
"data-testid"?: string;
|
||||
size?: "sm" | "md";
|
||||
grow?: boolean;
|
||||
};
|
||||
Reference in new issue
Block a user