From 9d0cf6be0b2af0ef012f79cf4bdd8b8bed2272f1 Mon Sep 17 00:00:00 2001 From: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Date: Thu, 22 Dec 2022 19:06:26 +0000 Subject: [PATCH] =?UTF-8?q?No=20more=20modules=20folder=20=F0=9F=94=A5=20(?= =?UTF-8?q?#6158)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Peer Richelsen --- apps/web/components/booking/pages/AvailabilityPage.tsx | 3 ++- apps/web/components/eventtype/EventAdvancedTab.tsx | 2 +- apps/web/components/eventtype/EventTeamTab.tsx | 3 ++- apps/web/pages/[user].tsx | 3 ++- apps/web/pages/auth/login.tsx | 3 ++- apps/web/pages/event-types/index.tsx | 6 ++++-- apps/web/pages/team/[slug].tsx | 3 ++- packages/{ui/v2/modules => features}/auth/SAMLLogin.tsx | 5 ++--- .../modules/booker => features/calendars}/DatePicker.tsx | 4 +--- .../eventtypes/components}/CheckedTeamSelect.tsx | 3 +-- .../eventtypes/components}/CustomInputItem.tsx | 3 +-- .../eventtypes/components}/EventTypeDescription.tsx | 3 +-- .../eventtypes/components}/MultiDropdownSelect.tsx | 0 .../eventtypes/components}/index.ts | 2 ++ .../schedules/components/DateOverrideInputDialog.tsx | 2 +- packages/{ui/v2/modules => features}/tips/Tips.tsx | 3 +-- packages/{ui/v2/modules => features}/tips/index.ts | 0 packages/ui/{v2/modules => components/list}/List.tsx | 0 packages/ui/components/list/index.ts | 2 ++ packages/ui/index.tsx | 8 +------- packages/ui/v2/core/Shell.tsx | 2 +- packages/ui/v2/index.ts | 1 - .../ui/v2/modules/_IMPORTANT_README/_IMPORTANT_README.md | 7 ------- packages/ui/v2/modules/auth/index.ts | 1 - packages/ui/v2/modules/booker/index.ts | 1 - packages/ui/v2/modules/index.ts | 3 --- 26 files changed, 29 insertions(+), 44 deletions(-) rename packages/{ui/v2/modules => features}/auth/SAMLLogin.tsx (93%) rename packages/{ui/v2/modules/booker => features/calendars}/DatePicker.tsx (99%) rename packages/{ui/v2/modules/event-types => features/eventtypes/components}/CheckedTeamSelect.tsx (97%) rename packages/{ui/v2/modules/event-types => features/eventtypes/components}/CustomInputItem.tsx (95%) rename packages/{ui/v2/modules/event-types => features/eventtypes/components}/EventTypeDescription.tsx (99%) rename packages/{ui/v2/modules/event-types => features/eventtypes/components}/MultiDropdownSelect.tsx (100%) rename packages/{ui/v2/modules/event-types => features/eventtypes/components}/index.ts (63%) rename packages/{ui/v2/modules => features}/tips/Tips.tsx (99%) rename packages/{ui/v2/modules => features}/tips/index.ts (100%) rename packages/ui/{v2/modules => components/list}/List.tsx (100%) create mode 100644 packages/ui/components/list/index.ts delete mode 100644 packages/ui/v2/modules/_IMPORTANT_README/_IMPORTANT_README.md delete mode 100644 packages/ui/v2/modules/auth/index.ts delete mode 100644 packages/ui/v2/modules/booker/index.ts delete mode 100644 packages/ui/v2/modules/index.ts diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx index b8a4f281e8..5bb0a482b7 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.tsx index 6998a1eaa4..2a10f17e1e 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.tsx index 177163bdbb..e3e166889e 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].tsx index df515e1af6..db500f47c5 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 "@calco import 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.tsx index 8a8228649c..ec33fddb82 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.tsx index d32503a14f..b3a8acd2cf 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].tsx index 5f4b124bd4..523fd3f7f5 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.tsx similarity index 93% rename from packages/ui/v2/modules/auth/SAMLLogin.tsx rename to packages/features/auth/SAMLLogin.tsx index 3689a226e3..c68678ee46 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.tsx similarity index 99% rename from packages/ui/v2/modules/booker/DatePicker.tsx rename to packages/features/calendars/DatePicker.tsx index 0625b5c4f2..fd05a13421 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.tsx similarity index 97% rename from packages/ui/v2/modules/event-types/CheckedTeamSelect.tsx rename to packages/features/eventtypes/components/CheckedTeamSelect.tsx index f74082a9c7..c353260184 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.tsx similarity index 95% rename from packages/ui/v2/modules/event-types/CustomInputItem.tsx rename to packages/features/eventtypes/components/CustomInputItem.tsx index 6ad2b6b1b9..1702fcc3a3 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.tsx similarity index 99% rename from packages/ui/v2/modules/event-types/EventTypeDescription.tsx rename to packages/features/eventtypes/components/EventTypeDescription.tsx index b2d56ac33f..e918c691bb 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.tsx similarity index 100% rename from packages/ui/v2/modules/event-types/MultiDropdownSelect.tsx rename to packages/features/eventtypes/components/MultiDropdownSelect.tsx diff --git a/packages/ui/v2/modules/event-types/index.ts b/packages/features/eventtypes/components/index.ts similarity index 63% rename from packages/ui/v2/modules/event-types/index.ts rename to packages/features/eventtypes/components/index.ts index 55a339d2b3..1575b9890d 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.tsx index ab110d8381..7b7a81527c 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.tsx similarity index 99% rename from packages/ui/v2/modules/tips/Tips.tsx rename to packages/features/tips/Tips.tsx index 4a903d4ae6..1f362cddfc 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.ts similarity index 100% rename from packages/ui/v2/modules/tips/index.ts rename to packages/features/tips/index.ts diff --git a/packages/ui/v2/modules/List.tsx b/packages/ui/components/list/List.tsx similarity index 100% rename from packages/ui/v2/modules/List.tsx rename to packages/ui/components/list/List.tsx diff --git a/packages/ui/components/list/index.ts b/packages/ui/components/list/index.ts new file mode 100644 index 0000000000..b61f1d7191 --- /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.tsx index 67d1e67e47..29f3a2a27e 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.tsx index 93d7ea642a..1cb4b444c7 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/UnconfirmedBookin import 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.ts index 14e128a437..3a8ecd3a9f 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.md deleted file mode 100644 index f9a6f11690..0000000000 --- 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.ts deleted file mode 100644 index 8737ce4981..0000000000 --- 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.ts deleted file mode 100644 index 2f4cf5f51a..0000000000 --- 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.ts deleted file mode 100644 index e5c8acf913..0000000000 --- a/packages/ui/v2/modules/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./auth"; -export * from "./booker"; -export * from "./event-types";