mirror of
https://github.com/makeplane/plane.git
synced 2026-02-04 13:09:15 -06:00
[WEB-4661] fix: move helpers file into utils #7568
This commit is contained in:
committed by
GitHub
parent
a085c0ec62
commit
047080a66f
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export interface AuthForgotPasswordProps {
|
||||
onForgotPassword?: () => void;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useMemo } from "react";
|
||||
import { E_PASSWORD_STRENGTH } from "@plane/constants";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { Button } from "../button/button";
|
||||
import { Spinner } from "../spinners/circular-spinner";
|
||||
import { AuthConfirmPasswordInput } from "./auth-confirm-password-input";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Eye, EyeOff } from "lucide-react";
|
||||
import React, { useState } from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { Input } from "../form-fields/input";
|
||||
|
||||
export interface AuthInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "autoComplete"> {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
// ui
|
||||
import { Tooltip } from "../tooltip";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// types
|
||||
import { TAvatarSize, getSizeInfo, isAValidNumber } from "./avatar";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
// ui
|
||||
import { Tooltip } from "../tooltip";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export type TAvatarSize = "sm" | "md" | "base" | "lg" | number;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "react";
|
||||
// helpers
|
||||
import { getIconStyling, getBadgeStyling, TBadgeVariant, TBadgeSizes } from "./helper";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export interface BadgeProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
variant?: TBadgeVariant;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ChevronRight } from "lucide-react";
|
||||
import * as React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { Tooltip } from "../tooltip";
|
||||
|
||||
type BreadcrumbsProps = {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { CheckIcon } from "lucide-react";
|
||||
import * as React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// ui
|
||||
import { CustomMenu, TContextMenuItem } from "../dropdowns";
|
||||
import { Tooltip } from "../tooltip";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "react";
|
||||
import { useState } from "react";
|
||||
import { ICustomSearchSelectOption } from "@plane/types";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { CustomSearchSelect } from "../dropdowns";
|
||||
import { Tooltip } from "../tooltip";
|
||||
import { Breadcrumbs } from "./breadcrumbs";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { getIconStyling, getButtonStyling, TButtonVariant, TButtonSizes } from "./helper";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
variant?: TButtonVariant;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "react";
|
||||
import { Switch } from "@headlessui/react";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
interface IToggleSwitchProps {
|
||||
value: boolean;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ChevronLeft } from "lucide-react";
|
||||
import * as React from "react";
|
||||
import { DayPicker } from "react-day-picker";
|
||||
|
||||
import { cn } from "../helpers";
|
||||
import { cn } from "./utils";
|
||||
|
||||
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import {
|
||||
ECardDirection,
|
||||
ECardSpacing,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { FC } from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { DropdownIcon, ISvgIcons } from "../icons";
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { Row } from "../row";
|
||||
import { ERowVariant, TRowVariant } from "../row/helper";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { forwardRef } from "react";
|
||||
import { MoreVertical } from "lucide-react";
|
||||
import React, { forwardRef } from "react";
|
||||
// helpers
|
||||
import { cn } from "../helpers";
|
||||
import { cn } from "./utils";
|
||||
|
||||
interface IDragHandle {
|
||||
className?: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { cn } from "../helpers";
|
||||
import { cn } from "./utils";
|
||||
|
||||
type Props = {
|
||||
isVisible: boolean;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import React, { Fragment } from "react";
|
||||
// headless ui
|
||||
import { Combobox } from "@headlessui/react";
|
||||
import React, { Fragment } from "react";
|
||||
// helper
|
||||
import { cn } from "../../../helpers";
|
||||
import { cn } from "../../utils";
|
||||
import { IMultiSelectDropdownButton, ISingleSelectDropdownButton } from "../dropdown";
|
||||
|
||||
export const DropdownButton: React.FC<IMultiSelectDropdownButton | ISingleSelectDropdownButton> = (props) => {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import React, { FC, useEffect, useRef } from "react";
|
||||
// headless ui
|
||||
import { Combobox } from "@headlessui/react";
|
||||
// icons
|
||||
import { Search } from "lucide-react";
|
||||
import React, { FC, useEffect, useRef } from "react";
|
||||
// helpers
|
||||
import { cn } from "../../../helpers";
|
||||
import { cn } from "../../utils";
|
||||
|
||||
interface IInputSearch {
|
||||
isOpen: boolean;
|
||||
@@ -32,9 +30,11 @@ export const InputSearch: FC<IInputSearch> = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpen && !isMobile) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
inputRef.current && inputRef.current.focus();
|
||||
}
|
||||
}, [isOpen, isMobile]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import React from "react";
|
||||
// headless ui
|
||||
import { Combobox } from "@headlessui/react";
|
||||
// icons
|
||||
import { Check } from "lucide-react";
|
||||
// components
|
||||
import { DropdownOptionsLoader, InputSearch } from ".";
|
||||
import React from "react";
|
||||
// helpers
|
||||
import { cn } from "../../../helpers";
|
||||
import { cn } from "../../utils";
|
||||
// types
|
||||
import { IMultiSelectDropdownOptions, ISingleSelectDropdownOptions } from "../dropdown";
|
||||
// components
|
||||
import { DropdownOptionsLoader, InputSearch } from ".";
|
||||
|
||||
export const DropdownOptions: React.FC<IMultiSelectDropdownOptions | ISingleSelectDropdownOptions> = (props) => {
|
||||
const {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { usePopper } from "react-popper";
|
||||
// plane imports
|
||||
import { useOutsideClickDetector } from "@plane/hooks";
|
||||
// local imports
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { useDropdownKeyPressed } from "../hooks/use-dropdown-key-pressed";
|
||||
import { DropdownButton } from "./common";
|
||||
import { DropdownOptions } from "./common/options";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { usePopper } from "react-popper";
|
||||
// plane imports
|
||||
import { useOutsideClickDetector } from "@plane/hooks";
|
||||
// local imports
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { useDropdownKeyPressed } from "../hooks/use-dropdown-key-pressed";
|
||||
import { DropdownButton } from "./common";
|
||||
import { DropdownOptions } from "./common/options";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ChevronRight } from "lucide-react";
|
||||
import React, { useState, useRef, useContext } from "react";
|
||||
import { usePopper } from "react-popper";
|
||||
// helpers
|
||||
import { cn } from "../../../helpers";
|
||||
import { cn } from "../../utils";
|
||||
// types
|
||||
import { TContextMenuItem, ContextMenuContext, Portal } from "./root";
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
// plane helpers
|
||||
import { useOutsideClickDetector } from "@plane/hooks";
|
||||
// helpers
|
||||
import { cn } from "../../../helpers";
|
||||
// hooks
|
||||
import { usePlatformOS } from "../../hooks/use-platform-os";
|
||||
// helpers
|
||||
import { cn } from "../../utils";
|
||||
// components
|
||||
import { ContextMenuItem } from "./item";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { usePopper } from "react-popper";
|
||||
// plane helpers
|
||||
import { useOutsideClickDetector } from "@plane/hooks";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// hooks
|
||||
import { useDropdownKeyDown } from "../hooks/use-dropdown-key-down";
|
||||
// types
|
||||
|
||||
@@ -6,7 +6,7 @@ import { usePopper } from "react-popper";
|
||||
// plane imports
|
||||
import { useOutsideClickDetector } from "@plane/hooks";
|
||||
// local imports
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { useDropdownKeyDown } from "../hooks/use-dropdown-key-down";
|
||||
import { Tooltip } from "../tooltip";
|
||||
import { ICustomSearchSelectProps } from "./helper";
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useOutsideClickDetector } from "@plane/hooks";
|
||||
// hooks
|
||||
import { useDropdownKeyDown } from "../hooks/use-dropdown-key-down";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// types
|
||||
import { ICustomSelectItemProps, ICustomSelectProps } from "./helper";
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import EmojiPicker from "emoji-picker-react";
|
||||
// plane helpers
|
||||
import { useOutsideClickDetector } from "@plane/hooks";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// hooks
|
||||
import { LucideIconsList } from "./lucide-icons-list";
|
||||
// helpers
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useOutsideClickDetector } from "@plane/hooks";
|
||||
// components
|
||||
import { IconsList } from "./icons-list";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// hooks
|
||||
import { EmojiIconPickerTypes, TABS_LIST, TCustomEmojiPicker } from "./emoji-icon-helper";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react";
|
||||
// icons
|
||||
import useFontFaceObserver from "use-font-face-observer";
|
||||
import { MATERIAL_ICONS_LIST } from "..";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { Input } from "../form-fields";
|
||||
import { InfoIcon } from "../icons";
|
||||
// components
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Search } from "lucide-react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
// local imports
|
||||
import { LUCIDE_ICONS_LIST } from "..";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { Input } from "../form-fields";
|
||||
import { InfoIcon } from "../icons";
|
||||
import { DEFAULT_COLORS, TIconsListProps, adjustColorForContrast } from "./emoji-icon-helper";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { Star } from "lucide-react";
|
||||
import React from "react";
|
||||
// helpers
|
||||
import { cn } from "../helpers";
|
||||
import { cn } from "./utils";
|
||||
|
||||
type Props = {
|
||||
buttonClassName?: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||
containerClassName?: string;
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as React from "react";
|
||||
import { ColorResult, SketchPicker } from "react-color";
|
||||
import { usePopper } from "react-popper";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// components
|
||||
import { Button } from "../button";
|
||||
import { Input } from "./input";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||
mode?: "primary" | "transparent" | "true-transparent";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useRef } from "react";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// hooks
|
||||
import { useAutoResizeTextArea } from "../hooks/use-auto-resize-textarea";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { EHeaderVariant, getHeaderStyle, THeaderVariant } from "./helper";
|
||||
import { ERowVariant, Row } from "../row";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
import { AlertCircle, Ban, SignalHigh, SignalLow, SignalMedium } from "lucide-react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export type TIssuePriorities = "urgent" | "high" | "medium" | "low" | "none";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
// helpers
|
||||
import { cn } from "../helpers";
|
||||
import { cn } from "./utils";
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ModalCore } from "./modal-core";
|
||||
// constants
|
||||
import { EModalPosition, EModalWidth } from "./constants";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export type TModalVariant = "danger" | "primary";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Dialog, Transition } from "@headlessui/react";
|
||||
// constants
|
||||
import { EModalPosition, EModalWidth } from "./constants";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export interface OAuthButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
text: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { OAuthButton } from "./oauth-button";
|
||||
|
||||
export type TOAuthOption = {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { Fragment } from "react";
|
||||
// components
|
||||
import { Popover } from "./popover";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// types
|
||||
import { TPopoverMenu } from "./types";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { Fragment, Ref, useState } from "react";
|
||||
import { usePopper } from "react-popper";
|
||||
import { Popover as HeadlessReactPopover, Transition } from "@headlessui/react";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// types
|
||||
import { TPopover } from "./types";
|
||||
import { EllipsisVertical } from "lucide-react";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { Tooltip } from "../tooltip";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
type Props = {
|
||||
data: any;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { ERowVariant, rowStyle, TRowVariant } from "./helper";
|
||||
|
||||
export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
||||
import React, { FC } from "react";
|
||||
import { cn } from "../helpers";
|
||||
import { cn } from "./utils";
|
||||
|
||||
type TScrollAreaProps = {
|
||||
type?: "auto" | "always" | "scroll" | "hover";
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useEffect, useRef, useState } from "react";
|
||||
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
||||
import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
||||
import { isEqual } from "lodash";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
||||
import { DropIndicator } from "../drop-indicator";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export interface ISpinner extends React.SVGAttributes<SVGElement> {
|
||||
height?: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// types
|
||||
import { TTableData } from "./types";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Tab } from "@headlessui/react";
|
||||
import { LucideProps } from "lucide-react";
|
||||
import React, { FC } from "react";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export type TabListItem = {
|
||||
key: string;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Tab } from "@headlessui/react";
|
||||
import React, { FC, Fragment, useEffect, useState } from "react";
|
||||
// helpers
|
||||
import { useLocalStorage } from "@plane/hooks";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
// types
|
||||
import { TabList, TabListItem } from "./tab-list";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
import { ETagSize, ETagVariant, getTagStyle, TTagSize, TTagVariant } from "./helper";
|
||||
|
||||
export interface TagProps extends React.ComponentProps<"div"> {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { AlertTriangle, CheckCircle2, X, XCircle } from "lucide-react";
|
||||
// spinner
|
||||
import { CircularBarSpinner } from "../spinners";
|
||||
// helper
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export enum TOAST_TYPE {
|
||||
SUCCESS = "success",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Tooltip2 } from "@blueprintjs/popover2";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
// helpers
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
export type TPosition =
|
||||
| "top"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { cn } from "../../helpers";
|
||||
import { cn } from "../utils";
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export * from "./classname";
|
||||
export * from "./icons";
|
||||
|
||||
Reference in New Issue
Block a user