From 37159914cf5f0f239261a28e689e09ecee7a5069 Mon Sep 17 00:00:00 2001 From: Jeroen Reumkens Date: Wed, 4 Jan 2023 14:05:00 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Removed=20old=20root=20UI=20comp?= =?UTF-8?q?onents.=20(#6249)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Removed old root UI components. * Fixed import path * Changed icon to not import from root, since it somehow creates a recursive import * Removed irrelevant todo * Fixed merge issues. * Fixed shell export --- .../security/TwoFactorModalHeader.tsx | 4 +- .../UsernameAvailability/PremiumTextfield.tsx | 14 +- apps/web/pages/[user].tsx | 4 +- .../ee/routing-forms/components/index.ts | 2 - .../app-store/zapier/pages/setup/index.tsx | 4 +- .../api-keys/components/ApiKeyDialogForm.tsx | 4 +- .../ee/sso/components/SAMLConfiguration.tsx | 5 +- packages/ui/Alert.tsx | 48 - packages/ui/Button.tsx | 151 - packages/ui/Dialog.tsx | 116 - packages/ui/Dropdown.tsx | 100 - packages/ui/Icon.tsx | 18 - packages/ui/Loader.tsx | 10 - packages/ui/Logo.tsx | 39 - packages/ui/LogoAnimated.json | 3875 ----------------- packages/ui/LogoAnimatedWhite.json | 3875 ----------------- packages/ui/Shell.tsx | 11 - packages/ui/Tooltip.tsx | 44 - .../ui/components/apps/SkeletonLoader.tsx | 2 +- packages/ui/components/apps/Slider.tsx | 2 +- .../buttonGroup/buttongroup.stories.mdx | 2 +- .../errorBoundary}/ErrorBoundary.tsx | 0 packages/ui/components/errorBoundary/index.ts | 1 + .../form/checkbox/checkbox.stories.mdx | 10 +- .../components/form/inputs/HintOrErrors.tsx | 3 +- .../ui/components/form/select/components.tsx | 2 +- packages/ui/components/icon/Icon.tsx | 18 + packages/ui/components/icon/index.ts | 1 + packages/ui/components/index.ts | 3 + packages/ui/components/logo/Logo.tsx | 15 + packages/ui/components/logo/index.ts | 1 + packages/ui/components/logo/logo.stories.mdx | 25 + packages/ui/form/AddressInput.tsx | 2 +- packages/ui/form/fields.tsx | 2 +- packages/ui/index.tsx | 10 +- .../ui/v2/core/ConfirmationDialogContent.tsx | 3 +- packages/ui/{ => v2/core}/Kbar.tsx | 2 +- .../ui/v2/core/MeetingTimeInTimezones.tsx | 2 +- packages/ui/v2/core/Shell.tsx | 7 +- packages/ui/v2/core/layouts/AdminLayout.tsx | 2 +- .../v2/core/layouts/InstalledAppsLayout.tsx | 2 +- .../ui/v2/core/layouts/SettingsLayout.tsx | 3 +- 42 files changed, 102 insertions(+), 8342 deletions(-) delete mode 100644 packages/app-store/ee/routing-forms/components/index.ts delete mode 100644 packages/ui/Alert.tsx delete mode 100644 packages/ui/Button.tsx delete mode 100644 packages/ui/Dialog.tsx delete mode 100644 packages/ui/Dropdown.tsx delete mode 100644 packages/ui/Icon.tsx delete mode 100644 packages/ui/Loader.tsx delete mode 100644 packages/ui/Logo.tsx delete mode 100644 packages/ui/LogoAnimated.json delete mode 100644 packages/ui/LogoAnimatedWhite.json delete mode 100644 packages/ui/Shell.tsx delete mode 100644 packages/ui/Tooltip.tsx rename packages/ui/{ => components/errorBoundary}/ErrorBoundary.tsx (100%) create mode 100644 packages/ui/components/errorBoundary/index.ts create mode 100644 packages/ui/components/icon/Icon.tsx create mode 100644 packages/ui/components/icon/index.ts create mode 100644 packages/ui/components/logo/Logo.tsx create mode 100644 packages/ui/components/logo/index.ts create mode 100644 packages/ui/components/logo/logo.stories.mdx rename packages/ui/{ => v2/core}/Kbar.tsx (99%) diff --git a/apps/web/components/security/TwoFactorModalHeader.tsx b/apps/web/components/security/TwoFactorModalHeader.tsx index 44c251b7a3..d37f3c0636 100644 --- a/apps/web/components/security/TwoFactorModalHeader.tsx +++ b/apps/web/components/security/TwoFactorModalHeader.tsx @@ -1,10 +1,10 @@ -import { ShieldCheckIcon } from "@calcom/ui"; +import { Icon } from "@calcom/ui"; const TwoFactorModalHeader = ({ title, description }: { title: string; description: string }) => { return (
- +
diff --git a/apps/web/pages/[user].tsx b/apps/web/pages/[user].tsx index db500f47c5..92a8b00125 100644 --- a/apps/web/pages/[user].tsx +++ b/apps/web/pages/[user].tsx @@ -27,7 +27,7 @@ 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 { BadgeCheckIcon, Icon } from "@calcom/ui"; +import { Icon } from "@calcom/ui"; import { inferSSRProps } from "@lib/types/inferSSRProps"; import { EmbedProps } from "@lib/withEmbedSsr"; @@ -139,7 +139,7 @@ export default function User(props: inferSSRProps & E

{nameOrUsername} {user.verified && ( - + )}

{user.bio}

diff --git a/packages/app-store/ee/routing-forms/components/index.ts b/packages/app-store/ee/routing-forms/components/index.ts deleted file mode 100644 index e191e97eec..0000000000 --- a/packages/app-store/ee/routing-forms/components/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as InstallAppButton } from "./InstallAppButton"; -export { default as Icon } from "./icon"; diff --git a/packages/app-store/zapier/pages/setup/index.tsx b/packages/app-store/zapier/pages/setup/index.tsx index 0f5b2e38b4..5677e70758 100644 --- a/packages/app-store/zapier/pages/setup/index.tsx +++ b/packages/app-store/zapier/pages/setup/index.tsx @@ -5,7 +5,7 @@ import { Toaster } from "react-hot-toast"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; -import { Button, ClipboardCopyIcon, showToast, Tooltip } from "@calcom/ui"; +import { Button, Icon, showToast, Tooltip } from "@calcom/ui"; export interface IZapierSetupProps { inviteLink: string; @@ -75,7 +75,7 @@ export default function ZapierSetup(props: IZapierSetupProps) { }} type="button" className="mt-4 text-base sm:mt-0 sm:rounded-l-none"> - + {t("copy")} diff --git a/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx b/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx index f526eb3a62..83ed875664 100644 --- a/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx +++ b/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx @@ -8,7 +8,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import { Button, - ClipboardCopyIcon, + Icon, DatePickerField as DatePicker, DialogFooter, Form, @@ -83,7 +83,7 @@ export default function ApiKeyDialogForm({ }} type="button" className="rounded-l-none py-[19px] text-base "> - + {t("copy")} diff --git a/packages/features/ee/sso/components/SAMLConfiguration.tsx b/packages/features/ee/sso/components/SAMLConfiguration.tsx index fcdc3a500b..c060166001 100644 --- a/packages/features/ee/sso/components/SAMLConfiguration.tsx +++ b/packages/features/ee/sso/components/SAMLConfiguration.tsx @@ -9,7 +9,6 @@ import { Alert, Badge, Button, - ClipboardCopyIcon, ConfirmationDialogContent, Dialog, DialogContent, @@ -123,7 +122,7 @@ export default function SAMLConfiguration({ teamId }: { teamId: number | null }) }} type="button" className="px-4 text-base"> - + {t("copy")}
@@ -143,7 +142,7 @@ export default function SAMLConfiguration({ teamId }: { teamId: number | null }) }} type="button" className="px-4 text-base"> - + {t("copy")} diff --git a/packages/ui/Alert.tsx b/packages/ui/Alert.tsx deleted file mode 100644 index 36f0c31c74..0000000000 --- a/packages/ui/Alert.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { CheckCircleIcon, ExclamationIcon, InformationCircleIcon, XCircleIcon } from "@heroicons/react/solid"; -import classNames from "classnames"; -import { ReactNode } from "react"; - -export interface AlertProps { - title?: ReactNode; - message?: ReactNode; - actions?: ReactNode; - className?: string; - severity: "success" | "warning" | "error" | "info"; -} -export function Alert(props: AlertProps) { - const { severity } = props; - - return ( -
-
-
- {severity === "error" && ( -
-
-

{props.title}

-
{props.message}
-
- {props.actions &&
{props.actions}
} -
-
- ); -} diff --git a/packages/ui/Button.tsx b/packages/ui/Button.tsx deleted file mode 100644 index 78c6446b0a..0000000000 --- a/packages/ui/Button.tsx +++ /dev/null @@ -1,151 +0,0 @@ -import Link, { LinkProps } from "next/link"; -import React, { forwardRef } from "react"; - -import classNames from "@calcom/lib/classNames"; - -type SVGComponent = React.FunctionComponent>; - -export type ButtonBaseProps = { - color?: "primary" | "secondary" | "minimal" | "warn" | "alert" | "alert2"; - size?: "base" | "sm" | "lg" | "fab" | "icon"; - loading?: boolean; - disabled?: boolean; - onClick?: (event: React.MouseEvent) => void; - StartIcon?: SVGComponent; - startIconClassName?: string; - EndIcon?: SVGComponent; - endIconClassName?: string; - shallow?: boolean; -}; -export type ButtonProps = ButtonBaseProps & - ( - | (Omit & LinkProps) - | (Omit & { href?: never }) - ); - -export const Button = forwardRef(function Button( - props: ButtonProps, - forwardedRef -) { - const { - loading = false, - color = "primary", - size = "base", - StartIcon, - startIconClassName, - endIconClassName, - EndIcon, - shallow, - // attributes propagated from `HTMLAnchorProps` or `HTMLButtonProps` - ...passThroughProps - } = props; - // Buttons are **always** disabled if we're in a `loading` state - const disabled = props.disabled || loading; - - // If pass an `href`-attr is passed it's ``, otherwise it's a `