diff --git a/packages/constants/src/index.ts b/packages/constants/src/index.ts index a7452ebe5..d7ccebd31 100644 --- a/packages/constants/src/index.ts +++ b/packages/constants/src/index.ts @@ -5,7 +5,6 @@ export * from "./endpoints"; export * from "./file"; export * from "./filter"; export * from "./graph"; -export * from "./icons"; export * from "./instance"; export * from "./issue"; export * from "./metadata"; diff --git a/packages/constants/src/icons.ts b/packages/ui/src/constants/icons.ts similarity index 99% rename from packages/constants/src/icons.ts rename to packages/ui/src/constants/icons.ts index ab9aa69b3..634d91686 100644 --- a/packages/constants/src/icons.ts +++ b/packages/ui/src/constants/icons.ts @@ -152,6 +152,8 @@ import { CircleChevronDown, UsersRound, ToggleLeft, + Search, + User, } from "lucide-react"; export const MATERIAL_ICONS_LIST = [ @@ -912,6 +914,8 @@ export const LUCIDE_ICONS_LIST = [ { name: "Minus", element: Minus }, { name: "MinusCircle", element: MinusCircle }, { name: "MinusSquare", element: MinusSquare }, + { name: "Search", element: Search }, { name: "ToggleLeft", element: ToggleLeft }, + { name: "User", element: User }, { name: "UsersRound", element: UsersRound }, ]; diff --git a/packages/ui/src/constants/index.ts b/packages/ui/src/constants/index.ts new file mode 100644 index 000000000..6ef8d54d4 --- /dev/null +++ b/packages/ui/src/constants/index.ts @@ -0,0 +1 @@ +export * from "./icons"; diff --git a/packages/ui/src/emoji/icons-list.tsx b/packages/ui/src/emoji/icons-list.tsx index bae22ffb8..7c6d25ba5 100644 --- a/packages/ui/src/emoji/icons-list.tsx +++ b/packages/ui/src/emoji/icons-list.tsx @@ -2,7 +2,7 @@ import { Search } from "lucide-react"; import React, { useEffect, useState } from "react"; // icons import useFontFaceObserver from "use-font-face-observer"; -import { MATERIAL_ICONS_LIST } from "@plane/constants"; +import { MATERIAL_ICONS_LIST } from ".."; import { cn } from "../../helpers"; import { Input } from "../form-fields"; import { InfoIcon } from "../icons"; diff --git a/packages/ui/src/emoji/logo.tsx b/packages/ui/src/emoji/logo.tsx index 0d598bac3..fd2727df6 100644 --- a/packages/ui/src/emoji/logo.tsx +++ b/packages/ui/src/emoji/logo.tsx @@ -1,9 +1,8 @@ import { Emoji } from "emoji-picker-react"; import React, { FC } from "react"; import useFontFaceObserver from "use-font-face-observer"; -// plane imports -import { LUCIDE_ICONS_LIST } from "@plane/constants"; // local imports +import { LUCIDE_ICONS_LIST } from ".."; import { emojiCodeToUnicode } from "./helpers"; export type TEmojiLogoProps = { diff --git a/packages/ui/src/emoji/lucide-icons-list.tsx b/packages/ui/src/emoji/lucide-icons-list.tsx index d569feb26..ee5b2fc20 100644 --- a/packages/ui/src/emoji/lucide-icons-list.tsx +++ b/packages/ui/src/emoji/lucide-icons-list.tsx @@ -1,8 +1,7 @@ import { Search } from "lucide-react"; import React, { useEffect, useState } from "react"; -// plane imports -import { LUCIDE_ICONS_LIST } from "@plane/constants"; // local imports +import { LUCIDE_ICONS_LIST } from ".."; import { cn } from "../../helpers"; import { Input } from "../form-fields"; import { InfoIcon } from "../icons"; diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 29bf6f248..a21979fa1 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -2,34 +2,36 @@ export * from "./avatar"; export * from "./badge"; export * from "./breadcrumbs"; export * from "./button"; +export * from "./calendar"; +export * from "./card"; +export * from "./collapsible"; +export * from "./color-picker"; +export * from "./constants"; +export * from "./content-wrapper"; export * from "./control-link"; +export * from "./drag-handle"; +export * from "./drop-indicator"; export * from "./dropdown"; export * from "./dropdowns"; export * from "./emoji"; +export * from "./favorite-star"; export * from "./form-fields"; +export * from "./header"; export * from "./hooks"; export * from "./icons"; +export * from "./link"; +export * from "./loader"; export * from "./modals"; +export * from "./popovers"; export * from "./progress"; +export * from "./row"; +export * from "./scroll-area"; export * from "./sortable"; export * from "./spinners"; +export * from "./tables"; +export * from "./tabs"; +export * from "./tag"; export * from "./toast"; export * from "./tooltip"; export * from "./typography"; -export * from "./drag-handle"; -export * from "./drop-indicator"; -export * from "./favorite-star"; -export * from "./loader"; -export * from "./collapsible"; -export * from "./popovers"; -export * from "./tables"; -export * from "./header"; -export * from "./row"; -export * from "./scroll-area"; -export * from "./content-wrapper"; -export * from "./card"; -export * from "./tag"; -export * from "./tabs"; -export * from "./calendar"; -export * from "./color-picker"; -export * from "./link"; +export * from "./utils"; diff --git a/packages/ui/src/utils/icons.ts b/packages/ui/src/utils/icons.ts new file mode 100644 index 000000000..de06cc735 --- /dev/null +++ b/packages/ui/src/utils/icons.ts @@ -0,0 +1,7 @@ +import { LUCIDE_ICONS_LIST } from ".."; + +/** + * Returns a random icon name from the LUCIDE_ICONS_LIST array + */ +export const getRandomIconName = (): string => + LUCIDE_ICONS_LIST[Math.floor(Math.random() * LUCIDE_ICONS_LIST.length)].name; diff --git a/packages/ui/src/utils/index.ts b/packages/ui/src/utils/index.ts new file mode 100644 index 000000000..6ef8d54d4 --- /dev/null +++ b/packages/ui/src/utils/index.ts @@ -0,0 +1 @@ +export * from "./icons"; diff --git a/packages/utils/src/emoji.ts b/packages/utils/src/emoji.ts index 00272f41a..2438cfeb7 100644 --- a/packages/utils/src/emoji.ts +++ b/packages/utils/src/emoji.ts @@ -1,7 +1,7 @@ "use client"; // plane imports -import { LUCIDE_ICONS_LIST, RANDOM_EMOJI_CODES } from "@plane/constants"; +import { RANDOM_EMOJI_CODES } from "@plane/constants"; /** * Converts a hyphen-separated hexadecimal emoji code to its decimal representation @@ -83,9 +83,3 @@ export const groupReactions: (reactions: any[], key: string) => { [key: string]: * @returns {string} A random emoji code */ export const getRandomEmoji = (): string => RANDOM_EMOJI_CODES[Math.floor(Math.random() * RANDOM_EMOJI_CODES.length)]; - -/** - * Returns a random icon name from the LUCIDE_ICONS_LIST array - */ -export const getRandomIconName = (): string => - LUCIDE_ICONS_LIST[Math.floor(Math.random() * LUCIDE_ICONS_LIST.length)].name; diff --git a/web/core/components/common/logo.tsx b/web/core/components/common/logo.tsx index f02fd2896..6e4ddb42c 100644 --- a/web/core/components/common/logo.tsx +++ b/web/core/components/common/logo.tsx @@ -7,8 +7,8 @@ import { Emoji } from "emoji-picker-react"; // eslint-disable-next-line import/order import useFontFaceObserver from "use-font-face-observer"; // plane imports -import { LUCIDE_ICONS_LIST } from "@plane/constants"; import { TLogoProps } from "@plane/types"; +import { LUCIDE_ICONS_LIST } from "@plane/ui"; import { emojiCodeToUnicode } from "@plane/utils"; type Props = {