From 0be8b84c4586d8bab6b9f126cd6c94922eaf33c2 Mon Sep 17 00:00:00 2001 From: Sriram Veeraghanta Date: Mon, 11 Aug 2025 01:56:15 +0530 Subject: [PATCH] fix: move helpers file into utils --- .../[projectId]/issues/(list)/mobile-header.tsx | 3 +-- packages/ui/src/auth-form/auth-forgot-password.tsx | 2 +- packages/ui/src/auth-form/auth-form.tsx | 2 +- packages/ui/src/auth-form/auth-input.tsx | 2 +- packages/ui/src/avatar/avatar-group.tsx | 2 +- packages/ui/src/avatar/avatar.tsx | 2 +- packages/ui/src/badge/badge.tsx | 2 +- packages/ui/src/breadcrumbs/breadcrumbs.tsx | 2 +- packages/ui/src/breadcrumbs/navigation-dropdown.tsx | 2 +- .../ui/src/breadcrumbs/navigation-search-dropdown.tsx | 2 +- packages/ui/src/button/button.tsx | 2 +- packages/ui/src/button/toggle-switch.tsx | 2 +- packages/ui/src/calendar.tsx | 2 +- packages/ui/src/card/card.tsx | 2 +- packages/ui/src/collapsible/collapsible-button.tsx | 2 +- packages/ui/src/content-wrapper/content-wrapper.tsx | 2 +- packages/ui/src/drag-handle.tsx | 4 ++-- packages/ui/src/drop-indicator.tsx | 2 +- packages/ui/src/dropdown/common/button.tsx | 5 ++--- packages/ui/src/dropdown/common/input-search.tsx | 8 ++++---- packages/ui/src/dropdown/common/options.tsx | 10 ++++------ packages/ui/src/dropdown/multi-select.tsx | 2 +- packages/ui/src/dropdown/single-select.tsx | 2 +- packages/ui/src/dropdowns/context-menu/item.tsx | 2 +- packages/ui/src/dropdowns/context-menu/root.tsx | 6 ++---- packages/ui/src/dropdowns/custom-menu.tsx | 2 +- packages/ui/src/dropdowns/custom-search-select.tsx | 2 +- packages/ui/src/dropdowns/custom-select.tsx | 2 +- packages/ui/src/emoji/emoji-icon-picker-new.tsx | 2 +- packages/ui/src/emoji/emoji-icon-picker.tsx | 2 +- packages/ui/src/emoji/icons-list.tsx | 2 +- packages/ui/src/emoji/lucide-icons-list.tsx | 2 +- packages/ui/src/favorite-star.tsx | 4 ++-- packages/ui/src/form-fields/checkbox.tsx | 2 +- packages/ui/src/form-fields/input-color-picker.tsx | 2 +- packages/ui/src/form-fields/input.tsx | 2 +- packages/ui/src/form-fields/textarea.tsx | 2 +- packages/ui/src/header/header.tsx | 2 +- packages/ui/src/icons/priority-icon.tsx | 2 +- packages/ui/src/loader.tsx | 2 +- packages/ui/src/modals/alert-modal.tsx | 2 +- packages/ui/src/modals/modal-core.tsx | 2 +- packages/ui/src/oauth/oauth-button.tsx | 2 +- packages/ui/src/oauth/oauth-options.tsx | 2 +- packages/ui/src/popovers/popover-menu.tsx | 2 +- packages/ui/src/popovers/popover.tsx | 2 +- packages/ui/src/progress/linear-progress-indicator.tsx | 2 +- packages/ui/src/row/row.tsx | 2 +- packages/ui/src/scroll-area.tsx | 2 +- packages/ui/src/sortable/draggable.tsx | 2 +- packages/ui/src/spinners/circular-spinner.tsx | 2 +- packages/ui/src/tables/table.tsx | 2 +- packages/ui/src/tabs/tab-list.tsx | 2 +- packages/ui/src/tabs/tabs.tsx | 2 +- packages/ui/src/tag/tag.tsx | 2 +- packages/ui/src/toast/index.tsx | 2 +- packages/ui/src/tooltip/tooltip.tsx | 2 +- packages/ui/src/typography/sub-heading.tsx | 2 +- packages/ui/{helpers.ts => src/utils/classname.tsx} | 0 packages/ui/src/utils/index.ts | 1 + 60 files changed, 69 insertions(+), 74 deletions(-) rename packages/ui/{helpers.ts => src/utils/classname.tsx} (100%) diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/mobile-header.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/mobile-header.tsx index 01e35f0dd8f..93eded847de 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/mobile-header.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/mobile-header.tsx @@ -6,7 +6,7 @@ import { useParams } from "next/navigation"; // icons import { Calendar, ChevronDown, Kanban, List } from "lucide-react"; // plane imports -import { EIssueFilterType, ISSUE_LAYOUTS, ISSUE_DISPLAY_FILTERS_BY_PAGE } from "@plane/constants"; +import { EIssueFilterType, ISSUE_DISPLAY_FILTERS_BY_PAGE } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import { EIssuesStoreType, @@ -15,7 +15,6 @@ import { IIssueFilterOptions, EIssueLayoutTypes, } from "@plane/types"; -import { CustomMenu } from "@plane/ui"; import { isIssueFilterActive } from "@plane/utils"; // components import { WorkItemsModal } from "@/components/analytics/work-items/modal"; diff --git a/packages/ui/src/auth-form/auth-forgot-password.tsx b/packages/ui/src/auth-form/auth-forgot-password.tsx index 44f27a1f580..02df0380e39 100644 --- a/packages/ui/src/auth-form/auth-forgot-password.tsx +++ b/packages/ui/src/auth-form/auth-forgot-password.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { cn } from "../../helpers"; +import { cn } from "../utils"; export interface AuthForgotPasswordProps { onForgotPassword?: () => void; diff --git a/packages/ui/src/auth-form/auth-form.tsx b/packages/ui/src/auth-form/auth-form.tsx index 7f0e5848004..efa0a908dbb 100644 --- a/packages/ui/src/auth-form/auth-form.tsx +++ b/packages/ui/src/auth-form/auth-form.tsx @@ -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"; diff --git a/packages/ui/src/auth-form/auth-input.tsx b/packages/ui/src/auth-form/auth-input.tsx index 2972ce393b1..fab3b693cc8 100644 --- a/packages/ui/src/auth-form/auth-input.tsx +++ b/packages/ui/src/auth-form/auth-input.tsx @@ -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, "autoComplete"> { diff --git a/packages/ui/src/avatar/avatar-group.tsx b/packages/ui/src/avatar/avatar-group.tsx index 501f694900d..7d7d0c8f0a9 100644 --- a/packages/ui/src/avatar/avatar-group.tsx +++ b/packages/ui/src/avatar/avatar-group.tsx @@ -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"; diff --git a/packages/ui/src/avatar/avatar.tsx b/packages/ui/src/avatar/avatar.tsx index 088f11fc03a..4ba9dc324c4 100644 --- a/packages/ui/src/avatar/avatar.tsx +++ b/packages/ui/src/avatar/avatar.tsx @@ -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; diff --git a/packages/ui/src/badge/badge.tsx b/packages/ui/src/badge/badge.tsx index 73c12f3e2af..93f2d6bdfe3 100644 --- a/packages/ui/src/badge/badge.tsx +++ b/packages/ui/src/badge/badge.tsx @@ -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 { variant?: TBadgeVariant; diff --git a/packages/ui/src/breadcrumbs/breadcrumbs.tsx b/packages/ui/src/breadcrumbs/breadcrumbs.tsx index af0ba9b4f35..9e5b88b5d99 100644 --- a/packages/ui/src/breadcrumbs/breadcrumbs.tsx +++ b/packages/ui/src/breadcrumbs/breadcrumbs.tsx @@ -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 = { diff --git a/packages/ui/src/breadcrumbs/navigation-dropdown.tsx b/packages/ui/src/breadcrumbs/navigation-dropdown.tsx index c07513e4aae..5581b1f3067 100644 --- a/packages/ui/src/breadcrumbs/navigation-dropdown.tsx +++ b/packages/ui/src/breadcrumbs/navigation-dropdown.tsx @@ -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"; diff --git a/packages/ui/src/breadcrumbs/navigation-search-dropdown.tsx b/packages/ui/src/breadcrumbs/navigation-search-dropdown.tsx index 75cfff35a77..4f5356b2a49 100644 --- a/packages/ui/src/breadcrumbs/navigation-search-dropdown.tsx +++ b/packages/ui/src/breadcrumbs/navigation-search-dropdown.tsx @@ -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"; diff --git a/packages/ui/src/button/button.tsx b/packages/ui/src/button/button.tsx index 10ee815f692..c5605b92fa8 100644 --- a/packages/ui/src/button/button.tsx +++ b/packages/ui/src/button/button.tsx @@ -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 { variant?: TButtonVariant; diff --git a/packages/ui/src/button/toggle-switch.tsx b/packages/ui/src/button/toggle-switch.tsx index c779cb4360e..f0558a959b8 100644 --- a/packages/ui/src/button/toggle-switch.tsx +++ b/packages/ui/src/button/toggle-switch.tsx @@ -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; diff --git a/packages/ui/src/calendar.tsx b/packages/ui/src/calendar.tsx index 80b160cc1b4..ea6dcd7d62e 100644 --- a/packages/ui/src/calendar.tsx +++ b/packages/ui/src/calendar.tsx @@ -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; diff --git a/packages/ui/src/card/card.tsx b/packages/ui/src/card/card.tsx index 6030e65bb0c..63ca5fb64e3 100644 --- a/packages/ui/src/card/card.tsx +++ b/packages/ui/src/card/card.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { cn } from "../../helpers"; +import { cn } from "../utils"; import { ECardDirection, ECardSpacing, diff --git a/packages/ui/src/collapsible/collapsible-button.tsx b/packages/ui/src/collapsible/collapsible-button.tsx index 48f0d0c703a..61a803c6312 100644 --- a/packages/ui/src/collapsible/collapsible-button.tsx +++ b/packages/ui/src/collapsible/collapsible-button.tsx @@ -1,5 +1,5 @@ import React, { FC } from "react"; -import { cn } from "../../helpers"; +import { cn } from "../utils"; import { DropdownIcon, ISvgIcons } from "../icons"; type Props = { diff --git a/packages/ui/src/content-wrapper/content-wrapper.tsx b/packages/ui/src/content-wrapper/content-wrapper.tsx index e081dcc5039..7e724f3cdd9 100644 --- a/packages/ui/src/content-wrapper/content-wrapper.tsx +++ b/packages/ui/src/content-wrapper/content-wrapper.tsx @@ -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"; diff --git a/packages/ui/src/drag-handle.tsx b/packages/ui/src/drag-handle.tsx index 89037a5ca40..5ec26ecd35e 100644 --- a/packages/ui/src/drag-handle.tsx +++ b/packages/ui/src/drag-handle.tsx @@ -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; diff --git a/packages/ui/src/drop-indicator.tsx b/packages/ui/src/drop-indicator.tsx index 7ffc83a4ba7..b8982be0651 100644 --- a/packages/ui/src/drop-indicator.tsx +++ b/packages/ui/src/drop-indicator.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { cn } from "../helpers"; +import { cn } from "./utils"; type Props = { isVisible: boolean; diff --git a/packages/ui/src/dropdown/common/button.tsx b/packages/ui/src/dropdown/common/button.tsx index 39d9cd53833..f8d508f73f6 100644 --- a/packages/ui/src/dropdown/common/button.tsx +++ b/packages/ui/src/dropdown/common/button.tsx @@ -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 = (props) => { diff --git a/packages/ui/src/dropdown/common/input-search.tsx b/packages/ui/src/dropdown/common/input-search.tsx index 984f997356d..d5e19d0e84d 100644 --- a/packages/ui/src/dropdown/common/input-search.tsx +++ b/packages/ui/src/dropdown/common/input-search.tsx @@ -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 = (props) => { useEffect(() => { if (isOpen && !isMobile) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions inputRef.current && inputRef.current.focus(); } }, [isOpen, isMobile]); + return (
= (props) => { const { diff --git a/packages/ui/src/dropdown/multi-select.tsx b/packages/ui/src/dropdown/multi-select.tsx index 400e2c72847..e464cc3c99e 100644 --- a/packages/ui/src/dropdown/multi-select.tsx +++ b/packages/ui/src/dropdown/multi-select.tsx @@ -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"; diff --git a/packages/ui/src/dropdown/single-select.tsx b/packages/ui/src/dropdown/single-select.tsx index 9614feb5160..7e352390b31 100644 --- a/packages/ui/src/dropdown/single-select.tsx +++ b/packages/ui/src/dropdown/single-select.tsx @@ -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"; diff --git a/packages/ui/src/dropdowns/context-menu/item.tsx b/packages/ui/src/dropdowns/context-menu/item.tsx index 8e2050d9dd8..68626a61dc0 100644 --- a/packages/ui/src/dropdowns/context-menu/item.tsx +++ b/packages/ui/src/dropdowns/context-menu/item.tsx @@ -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"; diff --git a/packages/ui/src/dropdowns/context-menu/root.tsx b/packages/ui/src/dropdowns/context-menu/root.tsx index 480607dbac3..b801a62df1f 100644 --- a/packages/ui/src/dropdowns/context-menu/root.tsx +++ b/packages/ui/src/dropdowns/context-menu/root.tsx @@ -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"; diff --git a/packages/ui/src/dropdowns/custom-menu.tsx b/packages/ui/src/dropdowns/custom-menu.tsx index 103bd20e19d..44a85b76f28 100644 --- a/packages/ui/src/dropdowns/custom-menu.tsx +++ b/packages/ui/src/dropdowns/custom-menu.tsx @@ -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 diff --git a/packages/ui/src/dropdowns/custom-search-select.tsx b/packages/ui/src/dropdowns/custom-search-select.tsx index 68fb90cb5dd..39b505ea918 100644 --- a/packages/ui/src/dropdowns/custom-search-select.tsx +++ b/packages/ui/src/dropdowns/custom-search-select.tsx @@ -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"; diff --git a/packages/ui/src/dropdowns/custom-select.tsx b/packages/ui/src/dropdowns/custom-select.tsx index ed006a7cb62..2beaf556d2b 100644 --- a/packages/ui/src/dropdowns/custom-select.tsx +++ b/packages/ui/src/dropdowns/custom-select.tsx @@ -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"; diff --git a/packages/ui/src/emoji/emoji-icon-picker-new.tsx b/packages/ui/src/emoji/emoji-icon-picker-new.tsx index 7144ebd36ab..4f29d766d16 100644 --- a/packages/ui/src/emoji/emoji-icon-picker-new.tsx +++ b/packages/ui/src/emoji/emoji-icon-picker-new.tsx @@ -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 diff --git a/packages/ui/src/emoji/emoji-icon-picker.tsx b/packages/ui/src/emoji/emoji-icon-picker.tsx index 5d1a0d472f5..98451c28da3 100644 --- a/packages/ui/src/emoji/emoji-icon-picker.tsx +++ b/packages/ui/src/emoji/emoji-icon-picker.tsx @@ -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"; diff --git a/packages/ui/src/emoji/icons-list.tsx b/packages/ui/src/emoji/icons-list.tsx index 7c6d25ba5f5..6e0722e3098 100644 --- a/packages/ui/src/emoji/icons-list.tsx +++ b/packages/ui/src/emoji/icons-list.tsx @@ -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 diff --git a/packages/ui/src/emoji/lucide-icons-list.tsx b/packages/ui/src/emoji/lucide-icons-list.tsx index ee5b2fc204e..012ced1eb90 100644 --- a/packages/ui/src/emoji/lucide-icons-list.tsx +++ b/packages/ui/src/emoji/lucide-icons-list.tsx @@ -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"; diff --git a/packages/ui/src/favorite-star.tsx b/packages/ui/src/favorite-star.tsx index b71714ab099..8614f656568 100644 --- a/packages/ui/src/favorite-star.tsx +++ b/packages/ui/src/favorite-star.tsx @@ -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; diff --git a/packages/ui/src/form-fields/checkbox.tsx b/packages/ui/src/form-fields/checkbox.tsx index b2e01908df2..7f9b8134dc7 100644 --- a/packages/ui/src/form-fields/checkbox.tsx +++ b/packages/ui/src/form-fields/checkbox.tsx @@ -1,6 +1,6 @@ import * as React from "react"; // helpers -import { cn } from "../../helpers"; +import { cn } from "../utils"; export interface CheckboxProps extends React.InputHTMLAttributes { containerClassName?: string; diff --git a/packages/ui/src/form-fields/input-color-picker.tsx b/packages/ui/src/form-fields/input-color-picker.tsx index eb7b83977f7..c069dd9b07c 100644 --- a/packages/ui/src/form-fields/input-color-picker.tsx +++ b/packages/ui/src/form-fields/input-color-picker.tsx @@ -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"; diff --git a/packages/ui/src/form-fields/input.tsx b/packages/ui/src/form-fields/input.tsx index 4e71ea89a09..d42c4c098e8 100644 --- a/packages/ui/src/form-fields/input.tsx +++ b/packages/ui/src/form-fields/input.tsx @@ -1,6 +1,6 @@ import * as React from "react"; // helpers -import { cn } from "../../helpers"; +import { cn } from "../utils"; export interface InputProps extends React.InputHTMLAttributes { mode?: "primary" | "transparent" | "true-transparent"; diff --git a/packages/ui/src/form-fields/textarea.tsx b/packages/ui/src/form-fields/textarea.tsx index 786e00a1dee..ed7d75133ee 100644 --- a/packages/ui/src/form-fields/textarea.tsx +++ b/packages/ui/src/form-fields/textarea.tsx @@ -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"; diff --git a/packages/ui/src/header/header.tsx b/packages/ui/src/header/header.tsx index b60d41b9600..1987297e9e1 100644 --- a/packages/ui/src/header/header.tsx +++ b/packages/ui/src/header/header.tsx @@ -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"; diff --git a/packages/ui/src/icons/priority-icon.tsx b/packages/ui/src/icons/priority-icon.tsx index a6ea01329dd..e7da9debba4 100644 --- a/packages/ui/src/icons/priority-icon.tsx +++ b/packages/ui/src/icons/priority-icon.tsx @@ -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"; diff --git a/packages/ui/src/loader.tsx b/packages/ui/src/loader.tsx index f8ca5ea7beb..6eaa74c65d4 100644 --- a/packages/ui/src/loader.tsx +++ b/packages/ui/src/loader.tsx @@ -1,6 +1,6 @@ import React from "react"; // helpers -import { cn } from "../helpers"; +import { cn } from "./utils"; type Props = { children: React.ReactNode; diff --git a/packages/ui/src/modals/alert-modal.tsx b/packages/ui/src/modals/alert-modal.tsx index eeef2861f22..9905c741878 100644 --- a/packages/ui/src/modals/alert-modal.tsx +++ b/packages/ui/src/modals/alert-modal.tsx @@ -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"; diff --git a/packages/ui/src/modals/modal-core.tsx b/packages/ui/src/modals/modal-core.tsx index 798917481d3..1cae5bcb799 100644 --- a/packages/ui/src/modals/modal-core.tsx +++ b/packages/ui/src/modals/modal-core.tsx @@ -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; diff --git a/packages/ui/src/oauth/oauth-button.tsx b/packages/ui/src/oauth/oauth-button.tsx index 6ce4803382f..1bf454dad31 100644 --- a/packages/ui/src/oauth/oauth-button.tsx +++ b/packages/ui/src/oauth/oauth-button.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { cn } from "../../helpers"; +import { cn } from "../utils"; export interface OAuthButtonProps extends React.ButtonHTMLAttributes { text: string; diff --git a/packages/ui/src/oauth/oauth-options.tsx b/packages/ui/src/oauth/oauth-options.tsx index 0e282792d67..1c42cb19d52 100644 --- a/packages/ui/src/oauth/oauth-options.tsx +++ b/packages/ui/src/oauth/oauth-options.tsx @@ -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 = { diff --git a/packages/ui/src/popovers/popover-menu.tsx b/packages/ui/src/popovers/popover-menu.tsx index 079aa3e25ed..6828aabb042 100644 --- a/packages/ui/src/popovers/popover-menu.tsx +++ b/packages/ui/src/popovers/popover-menu.tsx @@ -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"; diff --git a/packages/ui/src/popovers/popover.tsx b/packages/ui/src/popovers/popover.tsx index 4860a25a89a..d1a49b13f0f 100644 --- a/packages/ui/src/popovers/popover.tsx +++ b/packages/ui/src/popovers/popover.tsx @@ -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"; diff --git a/packages/ui/src/progress/linear-progress-indicator.tsx b/packages/ui/src/progress/linear-progress-indicator.tsx index e32087d49c7..d1127ad2d7b 100644 --- a/packages/ui/src/progress/linear-progress-indicator.tsx +++ b/packages/ui/src/progress/linear-progress-indicator.tsx @@ -1,6 +1,6 @@ import React from "react"; import { Tooltip } from "../tooltip"; -import { cn } from "../../helpers"; +import { cn } from "../utils"; type Props = { data: any; diff --git a/packages/ui/src/row/row.tsx b/packages/ui/src/row/row.tsx index 309aa5f57a0..f482fc808c7 100644 --- a/packages/ui/src/row/row.tsx +++ b/packages/ui/src/row/row.tsx @@ -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 { diff --git a/packages/ui/src/scroll-area.tsx b/packages/ui/src/scroll-area.tsx index 435ecf49163..ac5419f730b 100644 --- a/packages/ui/src/scroll-area.tsx +++ b/packages/ui/src/scroll-area.tsx @@ -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"; diff --git a/packages/ui/src/sortable/draggable.tsx b/packages/ui/src/sortable/draggable.tsx index 7fded837e6f..7af1fa6277b 100644 --- a/packages/ui/src/sortable/draggable.tsx +++ b/packages/ui/src/sortable/draggable.tsx @@ -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"; diff --git a/packages/ui/src/spinners/circular-spinner.tsx b/packages/ui/src/spinners/circular-spinner.tsx index 010ff6bfae2..2226d39ea50 100644 --- a/packages/ui/src/spinners/circular-spinner.tsx +++ b/packages/ui/src/spinners/circular-spinner.tsx @@ -1,6 +1,6 @@ import * as React from "react"; // helpers -import { cn } from "../../helpers"; +import { cn } from "../utils"; export interface ISpinner extends React.SVGAttributes { height?: string; diff --git a/packages/ui/src/tables/table.tsx b/packages/ui/src/tables/table.tsx index 7c8c161868a..c1840814414 100644 --- a/packages/ui/src/tables/table.tsx +++ b/packages/ui/src/tables/table.tsx @@ -1,6 +1,6 @@ import React from "react"; // helpers -import { cn } from "../../helpers"; +import { cn } from "../utils"; // types import { TTableData } from "./types"; diff --git a/packages/ui/src/tabs/tab-list.tsx b/packages/ui/src/tabs/tab-list.tsx index 0e9eb2dbd5b..c60ab1fa775 100644 --- a/packages/ui/src/tabs/tab-list.tsx +++ b/packages/ui/src/tabs/tab-list.tsx @@ -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; diff --git a/packages/ui/src/tabs/tabs.tsx b/packages/ui/src/tabs/tabs.tsx index b2791c0b8ca..7e368c0dab1 100644 --- a/packages/ui/src/tabs/tabs.tsx +++ b/packages/ui/src/tabs/tabs.tsx @@ -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"; diff --git a/packages/ui/src/tag/tag.tsx b/packages/ui/src/tag/tag.tsx index deb3d1b0f67..6f1b0e62f05 100644 --- a/packages/ui/src/tag/tag.tsx +++ b/packages/ui/src/tag/tag.tsx @@ -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"> { diff --git a/packages/ui/src/toast/index.tsx b/packages/ui/src/toast/index.tsx index 5ccbd775b9a..cd5bc37a32a 100644 --- a/packages/ui/src/toast/index.tsx +++ b/packages/ui/src/toast/index.tsx @@ -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", diff --git a/packages/ui/src/tooltip/tooltip.tsx b/packages/ui/src/tooltip/tooltip.tsx index d013414cdb8..1c84b6bb644 100644 --- a/packages/ui/src/tooltip/tooltip.tsx +++ b/packages/ui/src/tooltip/tooltip.tsx @@ -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" diff --git a/packages/ui/src/typography/sub-heading.tsx b/packages/ui/src/typography/sub-heading.tsx index 9e7075583cc..094d041efda 100644 --- a/packages/ui/src/typography/sub-heading.tsx +++ b/packages/ui/src/typography/sub-heading.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { cn } from "../../helpers"; +import { cn } from "../utils"; type Props = { children: React.ReactNode; diff --git a/packages/ui/helpers.ts b/packages/ui/src/utils/classname.tsx similarity index 100% rename from packages/ui/helpers.ts rename to packages/ui/src/utils/classname.tsx diff --git a/packages/ui/src/utils/index.ts b/packages/ui/src/utils/index.ts index 6ef8d54d416..62ca197ac9e 100644 --- a/packages/ui/src/utils/index.ts +++ b/packages/ui/src/utils/index.ts @@ -1 +1,2 @@ +export * from "./classname"; export * from "./icons";