Skip to content

Scheduling infrastructure for absolutely everyone.

Tree shake icons (#7051)

Omar López6e93224c9bf1
diff --git a/apps/web/components/security/TwoFactorModalHeader.tsx b/apps/web/components/security/TwoFactorModalHeader.tsx
index 47e2be473b1..d339af60bc3 100644
--- a/apps/web/components/security/TwoFactorModalHeader.tsx
+++ b/apps/web/components/security/TwoFactorModalHeader.tsx
@@ -1,10 +1,10 @@
-import { ShieldCheckIcon } from "@calcom/ui/components/icon";
+import { FiShield } from "@calcom/ui/components/icon";
const TwoFactorModalHeader = ({ title, description }: { title: string; description: string }) => {
return (
<div className="mb-4 sm:flex sm:items-start">
<div className="bg-brand text-brandcontrast dark:bg-darkmodebrand dark:text-darkmodebrandcontrast mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-opacity-5 sm:mx-0 sm:h-10 sm:w-10">
- <ShieldCheckIcon className="h-6 w-6 text-white" />
+ <FiShield className="h-6 w-6 text-white" />
</div>
<div className="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3 className="font-cal text-lg font-medium leading-6 text-gray-900" id="modal-title">
diff --git a/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx b/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx
index 3d81133c51a..7fced1e911f 100644
--- a/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx
+++ b/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx
@@ -1,3 +1,4 @@
+import { StarIcon as StarIconSolid } from "@heroicons/react/solid";
import classNames from "classnames";
import { debounce, noop } from "lodash";
import { useRouter } from "next/router";
@@ -14,7 +15,7 @@ import type { RouterOutputs } from "@calcom/trpc/react";
import { trpc } from "@calcom/trpc/react";
import type { AppRouter } from "@calcom/trpc/server/routers/_app";
import { Button, Dialog, DialogClose, DialogContent, DialogHeader, Input, Label } from "@calcom/ui";
-import { FiCheck, FiEdit2, FiExternalLink, StarIconSolid } from "@calcom/ui/components/icon";
+import { FiCheck, FiEdit2, FiExternalLink } from "@calcom/ui/components/icon";
export enum UsernameChangeStatusEnum {
UPGRADE = "UPGRADE",
diff --git a/apps/web/next.config.js b/apps/web/next.config.js
index d6a9e214f03..5138b31987f 100644
--- a/apps/web/next.config.js
+++ b/apps/web/next.config.js
@@ -94,12 +94,17 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: !!process.env.CI,
},
- // TODO: We need to have all components in `@calcom/ui/components` in order to use this
- // modularizeImports: {
- // "@calcom/ui": {
- // transform: "@calcom/ui/components/{{member}}",
- // },
- // },
+ modularizeImports: {
+ "@calcom/ui/components/icon": {
+ transform: "@react-icons/all-files/fi/{{member}}",
+ skipDefaultConversion: true,
+ preventFullImport: true,
+ },
+ // TODO: We need to have all components in `@calcom/ui/components` in order to use this
+ // "@calcom/ui": {
+ // transform: "@calcom/ui/components/{{member}}",
+ // },
+ },
images: {
unoptimized: true,
},
diff --git a/apps/web/pages/[user].tsx b/apps/web/pages/[user].tsx
index 88f4c4f88fe..d1993e41d20 100644
--- a/apps/web/pages/[user].tsx
+++ b/apps/web/pages/[user].tsx
@@ -1,3 +1,4 @@
+import { BadgeCheckIcon } from "@heroicons/react/solid";
import classNames from "classnames";
import MarkdownIt from "markdown-it";
import type { GetServerSidePropsContext } from "next";
@@ -27,8 +28,8 @@ import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calco
import prisma from "@calcom/prisma";
import { baseEventTypeSelect } from "@calcom/prisma/selects";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
-import { HeadSeo, AvatarGroup, Avatar } from "@calcom/ui";
-import { BadgeCheckIcon, FiArrowRight } from "@calcom/ui/components/icon";
+import { Avatar, AvatarGroup, HeadSeo } from "@calcom/ui";
+import { FiArrowRight } from "@calcom/ui/components/icon";
import type { inferSSRProps } from "@lib/types/inferSSRProps";
import type { EmbedProps } from "@lib/withEmbedSsr";
diff --git a/packages/app-store/zapier/pages/setup/index.tsx b/packages/app-store/zapier/pages/setup/index.tsx
index 9ec20b749ec..13086d3ccca 100644
--- a/packages/app-store/zapier/pages/setup/index.tsx
+++ b/packages/app-store/zapier/pages/setup/index.tsx
@@ -6,7 +6,7 @@ import { Toaster } from "react-hot-toast";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { Button, showToast, Tooltip } from "@calcom/ui";
-import { ClipboardCopyIcon } from "@calcom/ui/components/icon";
+import { FiClipboard } from "@calcom/ui/components/icon";
export interface IZapierSetupProps {
inviteLink: string;
@@ -76,7 +76,7 @@ export default function ZapierSetup(props: IZapierSetupProps) {
}}
type="button"
className="mt-4 text-base sm:mt-0 sm:rounded-l-none">
- <ClipboardCopyIcon className="h-5 w-5 text-gray-100 ltr:mr-2 rtl:ml-2" />
+ <FiClipboard className="h-5 w-5 text-gray-100 ltr:mr-2 rtl:ml-2" />
{t("copy")}
</Button>
</Tooltip>
diff --git a/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx b/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx
index 3e405d1a2db..6c07a2639d4 100644
--- a/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx
+++ b/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx
@@ -7,7 +7,7 @@ import LicenseRequired from "@calcom/ee/common/components/v2/LicenseRequired";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { Button, DatePicker, DialogFooter, Form, showToast, Switch, TextField, Tooltip } from "@calcom/ui";
-import { ClipboardCopyIcon } from "@calcom/ui/components/icon";
+import { FiClipboard } from "@calcom/ui/components/icon";
export default function ApiKeyDialogForm({
defaultValues,
@@ -74,7 +74,7 @@ export default function ApiKeyDialogForm({
}}
type="button"
className="rounded-l-none py-[19px] text-base ">
- <ClipboardCopyIcon className="h-5 w-5 text-gray-100 ltr:mr-2 rtl:ml-2" />
+ <FiClipboard className="h-5 w-5 text-gray-100 ltr:mr-2 rtl:ml-2" />
{t("copy")}
</Button>
</Tooltip>
diff --git a/packages/features/ee/sso/components/ConnectionInfo.tsx b/packages/features/ee/sso/components/ConnectionInfo.tsx
index 71a10027ed0..909c9dd3a65 100644
--- a/packages/features/ee/sso/components/ConnectionInfo.tsx
+++ b/packages/features/ee/sso/components/ConnectionInfo.tsx
@@ -11,7 +11,7 @@ import {
DialogTrigger,
Label,
} from "@calcom/ui";
-import { ClipboardCopyIcon } from "@calcom/ui/components/icon";
+import { FiClipboard } from "@calcom/ui/components/icon";
export default function ConnectionInfo({
teamId,
@@ -99,7 +99,7 @@ const SAMLInfo = ({ acsUrl, entityId }: { acsUrl: string | null; entityId: strin
}}
type="button"
className="rounded-l-none py-[19px] text-base ">
- <ClipboardCopyIcon className="h-5 w-5 text-gray-100 ltr:mr-2 rtl:ml-2" />
+ <FiClipboard className="h-5 w-5 text-gray-100 ltr:mr-2 rtl:ml-2" />
{t("copy")}
</Button>
</Tooltip>
@@ -121,7 +121,7 @@ const SAMLInfo = ({ acsUrl, entityId }: { acsUrl: string | null; entityId: strin
}}
type="button"
className="rounded-l-none py-[19px] text-base ">
- <ClipboardCopyIcon className="h-5 w-5 text-gray-100 ltr:mr-2 rtl:ml-2" />
+ <FiClipboard className="h-5 w-5 text-gray-100 ltr:mr-2 rtl:ml-2" />
{t("copy")}
</Button>
</Tooltip>
@@ -157,7 +157,7 @@ const OIDCInfo = ({ callbackUrl }: { callbackUrl: string | null }) => {
}}
type="button"
className="rounded-l-none py-[19px] text-base ">
- <ClipboardCopyIcon className="h-5 w-5 text-gray-100 ltr:mr-2 rtl:ml-2" />
+ <FiClipboard className="h-5 w-5 text-gray-100 ltr:mr-2 rtl:ml-2" />
{t("copy")}
</Button>
</Tooltip>
diff --git a/packages/ui/components/icon/Icon.tsx b/packages/ui/components/icon/Icon.tsx
index 78c2591c03d..9b00644181c 100644
--- a/packages/ui/components/icon/Icon.tsx
+++ b/packages/ui/components/icon/Icon.tsx
@@ -1,10 +1,3 @@
// find all feather icons at https://feathericons.com/
// github https://github.com/feathericons/feather
export * from "react-icons/fi";
-
-// if feather icon is missing, use "@heroicons/react/outline";
-export { CollectionIcon } from "@heroicons/react/outline";
-export { ShieldCheckIcon } from "@heroicons/react/outline";
-export { BadgeCheckIcon } from "@heroicons/react/outline";
-export { ClipboardCopyIcon } from "@heroicons/react/outline";
-export { StarIcon as StarIconSolid } from "@heroicons/react/solid";
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 8f86365c466..52103b367cc 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -23,6 +23,7 @@
"@radix-ui/react-popover": "^1.0.2",
"@radix-ui/react-portal": "^1.0.0",
"@radix-ui/react-select": "^0.1.1",
+ "@react-icons/all-files": "^4.1.0",
"@tanstack/react-query": "^4.3.9",
"@wojtekmaj/react-daterange-picker": "^3.3.1",
"class-variance-authority": "^0.4.0",
diff --git a/yarn.lock b/yarn.lock
index c10da465f8c..a2d8ea5d46d 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6249,6 +6249,11 @@
tiny-warning "^1.0.3"
tslib "^2.3.0"
+"@react-icons/all-files@^4.1.0":
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/@react-icons/all-files/-/all-files-4.1.0.tgz#477284873a0821928224b6fc84c62d2534d6650b"
+ integrity sha512-hxBI2UOuVaI3O/BhQfhtb4kcGn9ft12RWAFVMUeNjqqhLsHvFtzIkFaptBJpFDANTKoDfdVoHTKZDlwKCACbMQ==
+
version "1.1.0"
resolved "https://registry.yarnpkg.com/@redis/bloom/-/bloom-1.1.0.tgz#64e310ddee72010676e14296076329e594a1f6c7"