Scheduling infrastructure for absolutely everyone.
No more modules folder π₯ (#6158)
sean-brydon9d0cf6be0b2a
diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsxindex b8a4f281e88..5bb0a482b75 100644--- a/apps/web/components/booking/pages/AvailabilityPage.tsx+++ b/apps/web/components/booking/pages/AvailabilityPage.tsx@@ -17,6 +17,7 @@ import {useIsBackgroundTransparent,useIsEmbed,} from "@calcom/embed-core/embed-iframe";+import DatePicker from "@calcom/features/calendars/DatePicker";import CustomBranding from "@calcom/lib/CustomBranding";import classNames from "@calcom/lib/classNames";import getStripeAppData from "@calcom/lib/getStripeAppData";@@ -27,7 +28,7 @@ import { getRecurringFreq } from "@calcom/lib/recurringStrings";import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry";import { detectBrowserTimeFormat, setIs24hClockInLocalStorage, TimeFormat } from "@calcom/lib/timeFormat";import { trpc } from "@calcom/trpc/react";-import { Icon, DatePicker } from "@calcom/ui";+import { Icon } from "@calcom/ui";import { timeZone as localStorageTimeZone } from "@lib/clock";import useRouterQuery from "@lib/hooks/useRouterQuery";diff --git a/apps/web/components/eventtype/EventAdvancedTab.tsx b/apps/web/components/eventtype/EventAdvancedTab.tsxindex 6998a1eaa45..2a10f17e1ed 100644--- a/apps/web/components/eventtype/EventAdvancedTab.tsx+++ b/apps/web/components/eventtype/EventAdvancedTab.tsx@@ -6,13 +6,13 @@ import short from "short-uuid";import { v5 as uuidv5 } from "uuid";import DestinationCalendarSelector from "@calcom/features/calendars/DestinationCalendarSelector";+import CustomInputItem from "@calcom/features/eventtypes/components/CustomInputItem";import { APP_NAME, CAL_URL } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";import { trpc } from "@calcom/trpc/react";import {Button,Checkbox,- CustomInputItem,Dialog,DialogClose,DialogContent,diff --git a/apps/web/components/eventtype/EventTeamTab.tsx b/apps/web/components/eventtype/EventTeamTab.tsxindex 177163bdbb1..e3e166889ea 100644--- a/apps/web/components/eventtype/EventTeamTab.tsx+++ b/apps/web/components/eventtype/EventTeamTab.tsx@@ -3,9 +3,10 @@ import { EventTypeSetupInfered, FormValues } from "pages/event-types/[type]";import { useMemo } from "react";import { Controller, useFormContext } from "react-hook-form";+import CheckedTeamSelect from "@calcom/features/eventtypes/components/CheckedTeamSelect";import { WEBAPP_URL } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { Avatar, Button, CheckedTeamSelect, Icon, Label, Select } from "@calcom/ui";+import { Avatar, Button, Icon, Label, Select } from "@calcom/ui";interface IMemberToValue {id: number | null;diff --git a/apps/web/pages/[user].tsx b/apps/web/pages/[user].tsxindex df515e1af6f..db500f47c50 100644--- a/apps/web/pages/[user].tsx+++ b/apps/web/pages/[user].tsx@@ -12,6 +12,7 @@ import {useEmbedStyles,useIsEmbed,} from "@calcom/embed-core/embed-iframe";+import { EventTypeDescriptionLazy as EventTypeDescription } from "@calcom/features/eventtypes/components";import EmptyPage from "@calcom/features/eventtypes/components/EmptyPage";import CustomBranding from "@calcom/lib/CustomBranding";import defaultEvents, {@@ -26,7 +27,7 @@ import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcoimport prisma from "@calcom/prisma";import { baseEventTypeSelect } from "@calcom/prisma/selects";import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";-import { BadgeCheckIcon, EventTypeDescriptionLazy as EventTypeDescription, Icon } from "@calcom/ui";+import { BadgeCheckIcon, Icon } from "@calcom/ui";import { inferSSRProps } from "@lib/types/inferSSRProps";import { EmbedProps } from "@lib/withEmbedSsr";diff --git a/apps/web/pages/auth/login.tsx b/apps/web/pages/auth/login.tsxindex 8a8228649c5..ec33fddb822 100644--- a/apps/web/pages/auth/login.tsx+++ b/apps/web/pages/auth/login.tsx@@ -7,12 +7,13 @@ import { useState } from "react";import { FormProvider, useForm } from "react-hook-form";import { FaGoogle } from "react-icons/fa";+import { SAMLLogin } from "@calcom/features/auth/SAMLLogin";import { isSAMLLoginEnabled, samlProductID, samlTenantID } from "@calcom/features/ee/sso/lib/saml";import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl";import { useLocale } from "@calcom/lib/hooks/useLocale";import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry";import prisma from "@calcom/prisma";-import { Alert, Button, EmailField, Icon, PasswordField, SAMLLogin } from "@calcom/ui";+import { Alert, Button, EmailField, Icon, PasswordField } from "@calcom/ui";import { ErrorCode, getSession } from "@lib/auth";import { WEBAPP_URL, WEBSITE_URL } from "@lib/config/constants";diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsxindex d32503a14fd..b3a8acd2cf6 100644--- a/apps/web/pages/event-types/index.tsx+++ b/apps/web/pages/event-types/index.tsx@@ -4,7 +4,10 @@ import Link from "next/link";import { useRouter } from "next/router";import React, { Fragment, useEffect, useState } from "react";-import CreateEventTypeButton from "@calcom/features/eventtypes/components/CreateEventTypeButton";+import {+ CreateEventTypeButton,+ EventTypeDescriptionLazy as EventTypeDescription,+} from "@calcom/features/eventtypes/components";import { APP_NAME, CAL_URL, WEBAPP_URL } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";import { RouterOutputs, trpc, TRPCClientError } from "@calcom/trpc/react";@@ -22,7 +25,6 @@ import {DropdownMenuSeparator,DropdownMenuTrigger,EmptyScreen,- EventTypeDescription,Icon,Shell,showToast,diff --git a/apps/web/pages/team/[slug].tsx b/apps/web/pages/team/[slug].tsxindex 5f4b124bd4b..523fd3f7f58 100644--- a/apps/web/pages/team/[slug].tsx+++ b/apps/web/pages/team/[slug].tsx@@ -5,13 +5,14 @@ import { useRouter } from "next/router";import { useEffect } from "react";import { useIsEmbed } from "@calcom/embed-core/embed-iframe";+import EventTypeDescription from "@calcom/features/eventtypes/components/EventTypeDescription";import { CAL_URL } from "@calcom/lib/constants";import { getPlaceholderAvatar } from "@calcom/lib/getPlaceholderAvatar";import { useLocale } from "@calcom/lib/hooks/useLocale";import useTheme from "@calcom/lib/hooks/useTheme";import { getTeamWithMembers } from "@calcom/lib/server/queries/teams";import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry";-import { Avatar, Button, EventTypeDescription, Icon } from "@calcom/ui";+import { Avatar, Button, Icon } from "@calcom/ui";import { useToggleQuery } from "@lib/hooks/useToggleQuery";import { inferSSRProps } from "@lib/types/inferSSRProps";diff --git a/packages/ui/v2/modules/auth/SAMLLogin.tsx b/packages/features/auth/SAMLLogin.tsxsimilarity index 93%rename from packages/ui/v2/modules/auth/SAMLLogin.tsxrename to packages/features/auth/SAMLLogin.tsxindex 3689a226e35..c68678ee461 100644--- a/packages/ui/v2/modules/auth/SAMLLogin.tsx+++ b/packages/features/auth/SAMLLogin.tsx@@ -7,8 +7,7 @@ import { HOSTED_CAL_FEATURES } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry";import { trpc } from "@calcom/trpc/react";--import { Button, Icon } from "../../..";+import { Button, Icon } from "@calcom/ui";interface Props {samlTenantID: string;@@ -20,7 +19,7 @@ const schema = z.object({email: z.string().email({ message: "Please enter a valid email" }),});-export default function SAMLLogin({ samlTenantID, samlProductID, setErrorMessage }: Props) {+export function SAMLLogin({ samlTenantID, samlProductID, setErrorMessage }: Props) {const { t } = useLocale();const methods = useFormContext();const telemetry = useTelemetry();diff --git a/packages/ui/v2/modules/booker/DatePicker.tsx b/packages/features/calendars/DatePicker.tsxsimilarity index 99%rename from packages/ui/v2/modules/booker/DatePicker.tsxrename to packages/features/calendars/DatePicker.tsxindex 0625b5c4f23..fd05a134212 100644--- a/packages/ui/v2/modules/booker/DatePicker.tsx+++ b/packages/features/calendars/DatePicker.tsx@@ -6,9 +6,7 @@ import classNames from "@calcom/lib/classNames";import { daysInMonth, yyyymmdd } from "@calcom/lib/date-fns";import { useLocale } from "@calcom/lib/hooks/useLocale";import { weekdayNames } from "@calcom/lib/weekday";-import { Button, Icon } from "@calcom/ui";--import { SkeletonText } from "../../..";+import { Button, Icon, SkeletonText } from "@calcom/ui";export type DatePickerProps = {/** which day of the week to render the calendar. Usually Sunday (=0) or Monday (=1) - default: Sunday */diff --git a/packages/ui/v2/modules/event-types/CheckedTeamSelect.tsx b/packages/features/eventtypes/components/CheckedTeamSelect.tsxsimilarity index 97%rename from packages/ui/v2/modules/event-types/CheckedTeamSelect.tsxrename to packages/features/eventtypes/components/CheckedTeamSelect.tsxindex f74082a9c75..c3532601843 100644--- a/packages/ui/v2/modules/event-types/CheckedTeamSelect.tsx+++ b/packages/features/eventtypes/components/CheckedTeamSelect.tsx@@ -3,8 +3,7 @@ import { Props } from "react-select";import { classNames } from "@calcom/lib";import { useLocale } from "@calcom/lib/hooks/useLocale";--import { Avatar, Icon, Select } from "../../..";+import { Avatar, Icon, Select } from "@calcom/ui";type CheckedSelectOption = {avatar: string;diff --git a/packages/ui/v2/modules/event-types/CustomInputItem.tsx b/packages/features/eventtypes/components/CustomInputItem.tsxsimilarity index 95%rename from packages/ui/v2/modules/event-types/CustomInputItem.tsxrename to packages/features/eventtypes/components/CustomInputItem.tsxindex 6ad2b6b1b9c..1702fcc3a39 100644--- a/packages/ui/v2/modules/event-types/CustomInputItem.tsx+++ b/packages/features/eventtypes/components/CustomInputItem.tsx@@ -1,6 +1,5 @@import { useLocale } from "@calcom/lib/hooks/useLocale";--import { Badge, Button, ButtonGroup, Icon } from "../../..";+import { Badge, Button, ButtonGroup, Icon } from "@calcom/ui";type Props = {required?: boolean;diff --git a/packages/ui/v2/modules/event-types/EventTypeDescription.tsx b/packages/features/eventtypes/components/EventTypeDescription.tsxsimilarity index 99%rename from packages/ui/v2/modules/event-types/EventTypeDescription.tsxrename to packages/features/eventtypes/components/EventTypeDescription.tsxindex b2d56ac33fe..e918c691bb9 100644--- a/packages/ui/v2/modules/event-types/EventTypeDescription.tsx+++ b/packages/features/eventtypes/components/EventTypeDescription.tsx@@ -8,8 +8,7 @@ import getStripeAppData from "@calcom/lib/getStripeAppData";import { useLocale } from "@calcom/lib/hooks/useLocale";import { baseEventTypeSelect } from "@calcom/prisma";import { EventTypeModel } from "@calcom/prisma/zod";--import { Badge, Icon } from "../../..";+import { Badge, Icon } from "@calcom/ui";export type EventTypeDescriptionProps = {eventType: Pick<diff --git a/packages/ui/v2/modules/event-types/MultiDropdownSelect.tsx b/packages/features/eventtypes/components/MultiDropdownSelect.tsxsimilarity index 100%rename from packages/ui/v2/modules/event-types/MultiDropdownSelect.tsxrename to packages/features/eventtypes/components/MultiDropdownSelect.tsxdiff --git a/packages/ui/v2/modules/event-types/index.ts b/packages/features/eventtypes/components/index.tssimilarity index 63%rename from packages/ui/v2/modules/event-types/index.tsrename to packages/features/eventtypes/components/index.tsindex 55a339d2b37..1575b9890df 100644--- a/packages/ui/v2/modules/event-types/index.ts+++ b/packages/features/eventtypes/components/index.ts@@ -2,4 +2,6 @@ import dynamic from "next/dynamic";export { default as CheckedTeamSelect } from "./CheckedTeamSelect";export { default as CustomInputItem } from "./CustomInputItem";+export { default as CreateEventTypeButton } from "./CreateEventTypeButton";+export { default as EventTypeDescription } from "./EventTypeDescription";export const EventTypeDescriptionLazy = dynamic(() => import("./EventTypeDescription"));diff --git a/packages/features/schedules/components/DateOverrideInputDialog.tsx b/packages/features/schedules/components/DateOverrideInputDialog.tsxindex ab110d83817..7b7a81527ca 100644--- a/packages/features/schedules/components/DateOverrideInputDialog.tsx+++ b/packages/features/schedules/components/DateOverrideInputDialog.tsx@@ -13,11 +13,11 @@ import {DialogHeader,DialogClose,Switch,- DatePicker,Form,Button,} from "@calcom/ui";+import DatePicker from "../../calendars/DatePicker";import { DayRanges, TimeRange } from "./Schedule";const ALL_DAY_RANGE = {diff --git a/packages/ui/v2/modules/tips/Tips.tsx b/packages/features/tips/Tips.tsxsimilarity index 99%rename from packages/ui/v2/modules/tips/Tips.tsxrename to packages/features/tips/Tips.tsxindex 4a903d4ae64..1f362cddfc7 100644--- a/packages/ui/v2/modules/tips/Tips.tsx+++ b/packages/features/tips/Tips.tsx@@ -3,8 +3,7 @@ import { useEffect, useState } from "react";import { useLocale } from "@calcom/lib/hooks/useLocale";import { localStorage } from "@calcom/lib/webstorage";--import Card from "../../core/Card";+import { Card } from "@calcom/ui";export const tips = [{diff --git a/packages/ui/v2/modules/tips/index.ts b/packages/features/tips/index.tssimilarity index 100%rename from packages/ui/v2/modules/tips/index.tsrename to packages/features/tips/index.tsdiff --git a/packages/ui/v2/modules/List.tsx b/packages/ui/components/list/List.tsxsimilarity index 100%rename from packages/ui/v2/modules/List.tsxrename to packages/ui/components/list/List.tsxdiff --git a/packages/ui/components/list/index.ts b/packages/ui/components/list/index.tsnew file mode 100644index 00000000000..b61f1d71914--- /dev/null+++ b/packages/ui/components/list/index.ts@@ -0,0 +1,2 @@+export { List, ListItem, ListItemText, ListItemTitle } from "./List";+export type { ListItemProps, ListProps } from "./List";diff --git a/packages/ui/index.tsx b/packages/ui/index.tsxindex 67d1e67e474..29f3a2a27e6 100644--- a/packages/ui/index.tsx+++ b/packages/ui/index.tsx@@ -46,8 +46,6 @@ export { default as TimezoneChangeDialog } from "./TimezoneChangeDialog";// export { default as Tooltip } from "./Tooltip";export {Alert,- CheckedTeamSelect,- CustomInputItem,EmptyScreen,HorizontalTabs,SettingsToggle,@@ -58,6 +56,7 @@ export {SkeletonText,Swatch,Switch,+ Card,VerticalTabs,} from "./v2";export type { AlertProps } from "./v2";@@ -118,8 +117,3 @@ export type { ITimezone, ITimezoneOption } from "./v2/core/TimezoneSelect";export { Tooltip } from "./v2/core/Tooltip";export { default as VerticalDivider } from "./v2/core/VerticalDivider";export { default as WizardForm } from "./v2/core/WizardForm";-export { default as SAMLLogin } from "./v2/modules/auth/SAMLLogin";-export { default as DatePicker } from "./v2/modules/booker/DatePicker";-export { EventTypeDescriptionLazy } from "./v2/modules/event-types";-export { EventTypeDescription } from "./v2/modules/event-types/EventTypeDescription";-export { default as Tips } from "./v2/modules/tips/Tips";diff --git a/packages/ui/v2/core/Shell.tsx b/packages/ui/v2/core/Shell.tsxindex 93d7ea642a9..1cb4b444c7f 100644--- a/packages/ui/v2/core/Shell.tsx+++ b/packages/ui/v2/core/Shell.tsx@@ -12,6 +12,7 @@ import UnconfirmedBookingBadge from "@calcom/features/bookings/UnconfirmedBookinimport ImpersonatingBanner from "@calcom/features/ee/impersonation/components/ImpersonatingBanner";import HelpMenuItem from "@calcom/features/ee/support/components/HelpMenuItem";import { TeamsUpgradeBanner } from "@calcom/features/ee/teams/components";+import { Tips } from "@calcom/features/tips";import CustomBranding from "@calcom/lib/CustomBranding";import classNames from "@calcom/lib/classNames";import {@@ -40,7 +41,6 @@ import {Icon,showToast,TimezoneChangeDialog,- Tips,} from "../..";/* TODO: Get this from endpoint */diff --git a/packages/ui/v2/index.ts b/packages/ui/v2/index.tsindex 14e128a437b..3a8ecd3a9fa 100644--- a/packages/ui/v2/index.ts+++ b/packages/ui/v2/index.ts@@ -1,3 +1,2 @@/* TODO: Make this index explicit */export * from "./core";-export * from "./modules";diff --git a/packages/ui/v2/modules/_IMPORTANT_README/_IMPORTANT_README.md b/packages/ui/v2/modules/_IMPORTANT_README/_IMPORTANT_README.mddeleted file mode 100644index f9a6f116906..00000000000--- a/packages/ui/v2/modules/_IMPORTANT_README/_IMPORTANT_README.md+++ /dev/null@@ -1,7 +0,0 @@-# To all Cal.com contributors--All these components should live in `packages/features`--With love,--zomars πdiff --git a/packages/ui/v2/modules/auth/index.ts b/packages/ui/v2/modules/auth/index.tsdeleted file mode 100644index 8737ce49811..00000000000--- a/packages/ui/v2/modules/auth/index.ts+++ /dev/null@@ -1 +0,0 @@-export { default as SAMLLogin } from "./SAMLLogin";diff --git a/packages/ui/v2/modules/booker/index.ts b/packages/ui/v2/modules/booker/index.tsdeleted file mode 100644index 2f4cf5f51a1..00000000000--- a/packages/ui/v2/modules/booker/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from "./DatePicker";diff --git a/packages/ui/v2/modules/index.ts b/packages/ui/v2/modules/index.tsdeleted file mode 100644index e5c8acf9139..00000000000--- a/packages/ui/v2/modules/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from "./auth";-export * from "./booker";-export * from "./event-types";