🧹 One calcom/ui import to rule them all (#5561)
* Removed emptyscreen component v1 version, migrated pages that still used it to v2, and removed v1 of workflow pages and components. * updated workflow pages imports to remove v2 from path. * Deleted v1 switch component, deleted v1 api-keys components, deleted old web integrations components that were unused. * Removed v1 list component. * Fixed event workflows tab path. * Fixed import path for button in sandbox page. * Cleanup and type fixes * Making explicit indexes * UI import migrations * More import fixes * More import fixes * Submodule sync * Type fixes * Build fixes Co-authored-by: zomars <[email protected]>
This commit is contained in:
1 parent
a36b46bd81
commit
ccc2bdd25e
325 files changed
+2152
-5271
No files matched your search
@@ -7,9 +7,8 @@ import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import React, { PropsWithChildren, ReactNode } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Button } from "@calcom/ui/Button";
|
||||
import { DialogClose, DialogContent } from "@calcom/ui/Dialog";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
|
||||
import { Button, DialogClose, DialogContent, Icon } from ".";
|
||||
|
||||
export type ConfirmationDialogContentProps = {
|
||||
confirmBtn?: ReactNode;
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import React from "react";
|
||||
|
||||
import { SVGComponent } from "@calcom/types/SVGComponent";
|
||||
|
||||
export default function EmptyScreen({
|
||||
Icon,
|
||||
headline,
|
||||
description,
|
||||
button,
|
||||
}: {
|
||||
Icon: SVGComponent;
|
||||
headline: string;
|
||||
description: string | React.ReactElement;
|
||||
button?: React.ReactElement;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
data-testid="empty-screen"
|
||||
className="min-h-80 my-6 flex flex-col items-center justify-center rounded-sm border border-dashed">
|
||||
<div className="flex h-[72px] w-[72px] items-center justify-center rounded-full bg-gray-600 dark:bg-white">
|
||||
<Icon className="inline-block h-10 w-10 text-white dark:bg-white dark:text-gray-600" />
|
||||
</div>
|
||||
<div className="max-w-[420px] text-center">
|
||||
<h2 className="mt-6 mb-1 text-lg font-medium dark:text-gray-300">{headline}</h2>
|
||||
<p className="mb-2 text-sm leading-6 text-gray-600 dark:text-gray-300">{description}</p>
|
||||
{button}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -15,4 +15,4 @@ export { StarIcon as StarIconSolid } from "@heroicons/react/solid";
|
||||
// I want:
|
||||
// export CollectionIcon as Icon.Collection
|
||||
// so I can
|
||||
// import { Icon } from "@calcom/ui/Icon";
|
||||
// import { Icon } from "@calcom/ui";
|
||||
@@ -1,19 +1,19 @@
|
||||
import {
|
||||
KBarProvider,
|
||||
KBarAnimator,
|
||||
KBarPortal,
|
||||
KBarPositioner,
|
||||
KBarAnimator,
|
||||
KBarSearch,
|
||||
KBarProvider,
|
||||
KBarResults,
|
||||
useMatches,
|
||||
KBarSearch,
|
||||
useKBar,
|
||||
useMatches,
|
||||
} from "kbar";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { isMac } from "@calcom/lib/isMac";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import Tooltip from "@calcom/ui/v2/core/Tooltip";
|
||||
|
||||
import { Icon, Tooltip } from ".";
|
||||
|
||||
type shortcutArrayType = {
|
||||
shortcuts?: string[];
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
import Link from "next/link";
|
||||
import { createElement } from "react";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
|
||||
export function List(props: JSX.IntrinsicElements["ul"]) {
|
||||
return (
|
||||
<ul {...props} className={classNames("-mx-4 rounded-sm sm:mx-0 sm:overflow-hidden", props.className)}>
|
||||
{props.children}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
export type ListItemProps = { expanded?: boolean } & ({ href?: never } & JSX.IntrinsicElements["li"]);
|
||||
|
||||
export function ListItem(props: ListItemProps) {
|
||||
const { href, expanded, ...passThroughProps } = props;
|
||||
|
||||
const elementType = href ? "a" : "li";
|
||||
|
||||
const element = createElement(
|
||||
elementType,
|
||||
{
|
||||
...passThroughProps,
|
||||
className: classNames(
|
||||
"items-center bg-white min-w-0 flex-1 flex border-gray-200",
|
||||
expanded ? "my-2 border" : "border -mb-px last:mb-0",
|
||||
props.className,
|
||||
(props.onClick || href) && "hover:bg-neutral-50"
|
||||
),
|
||||
},
|
||||
props.children
|
||||
);
|
||||
|
||||
return href ? (
|
||||
<Link passHref href={href}>
|
||||
{element}
|
||||
</Link>
|
||||
) : (
|
||||
element
|
||||
);
|
||||
}
|
||||
|
||||
export function ListItemTitle<TComponent extends keyof JSX.IntrinsicElements = "span">(
|
||||
props: JSX.IntrinsicElements[TComponent] & { component?: TComponent }
|
||||
) {
|
||||
const { component = "span", ...passThroughProps } = props;
|
||||
|
||||
return createElement(
|
||||
component,
|
||||
{
|
||||
...passThroughProps,
|
||||
className: classNames("text-sm font-medium text-neutral-900 truncate", props.className),
|
||||
},
|
||||
props.children
|
||||
);
|
||||
}
|
||||
|
||||
export function ListItemText<TComponent extends keyof JSX.IntrinsicElements = "span">(
|
||||
props: JSX.IntrinsicElements[TComponent] & { component?: TComponent }
|
||||
) {
|
||||
const { component = "span", ...passThroughProps } = props;
|
||||
|
||||
return createElement(
|
||||
component,
|
||||
{
|
||||
...passThroughProps,
|
||||
className: classNames("text-sm text-gray-500 truncate", props.className),
|
||||
},
|
||||
props.children
|
||||
);
|
||||
}
|
||||
+11
-2
@@ -1,2 +1,11 @@
|
||||
export { default } from "@calcom/ui/v2/core/Shell";
|
||||
export * from "@calcom/ui/v2/core/Shell";
|
||||
export {
|
||||
default,
|
||||
default as Shell,
|
||||
MobileNavigationMoreItems,
|
||||
ONBOARDING_INTRODUCED_AT,
|
||||
ONBOARDING_NEXT_REDIRECT,
|
||||
ShellMain,
|
||||
ShellSubHeading,
|
||||
shouldShowOnboarding,
|
||||
} from "./v2/core/Shell";
|
||||
export type { NavigationItemType } from "./v2/core/Shell";
|
||||
@@ -1,33 +0,0 @@
|
||||
import { useId } from "@radix-ui/react-id";
|
||||
import * as Label from "@radix-ui/react-label";
|
||||
import * as PrimitiveSwitch from "@radix-ui/react-switch";
|
||||
import React from "react";
|
||||
|
||||
const Switch = (
|
||||
props: React.ComponentProps<typeof PrimitiveSwitch.Root> & {
|
||||
label?: string;
|
||||
}
|
||||
) => {
|
||||
const { label, ...primitiveProps } = props;
|
||||
const id = useId();
|
||||
|
||||
return (
|
||||
<div className="flex h-[20px] items-center">
|
||||
<PrimitiveSwitch.Root className="h-[20px] w-[36px] rounded-sm bg-gray-400 p-0.5" {...primitiveProps}>
|
||||
<PrimitiveSwitch.Thumb
|
||||
id={id}
|
||||
className="block h-[16px] w-[16px] translate-x-0 bg-white transition-transform"
|
||||
/>
|
||||
</PrimitiveSwitch.Root>
|
||||
{label && (
|
||||
<Label.Root
|
||||
htmlFor={id}
|
||||
className="cursor-pointer align-text-top text-sm font-medium text-neutral-700 ltr:ml-3 rtl:mr-3 dark:text-white">
|
||||
{label}
|
||||
</Label.Root>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Switch;
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useSession } from "next-auth/react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { DialogContent, showToast } from "@calcom/ui/v2";
|
||||
import { Dialog } from "@calcom/ui/v2/core/Dialog";
|
||||
|
||||
import { Dialog, DialogContent, showToast } from ".";
|
||||
|
||||
export default function TimezoneChangeDialog() {
|
||||
const { t } = useLocale();
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
import { ShellSubHeading } from "../Shell";
|
||||
import { SkeletonText } from "../v2/core/skeleton";
|
||||
|
||||
/** @deprecated Use `packages/ui/v2/core/apps/SkeletonLoader.tsx` */
|
||||
function SkeletonLoader({ className }: { className?: string }) {
|
||||
return (
|
||||
<>
|
||||
<ShellSubHeading title={<div className="h-6 w-32 bg-gray-100" />} {...{ className }} />
|
||||
<ul className="-mx-4 animate-pulse divide-y divide-neutral-200 rounded-md border border-gray-200 bg-white sm:mx-0 sm:overflow-hidden">
|
||||
<SkeletonItem />
|
||||
<SkeletonItem />
|
||||
<SkeletonItem />
|
||||
</ul>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default SkeletonLoader;
|
||||
|
||||
function SkeletonItem() {
|
||||
return (
|
||||
<li className="group flex w-full items-center justify-between p-3">
|
||||
<div className="flex-grow truncate text-sm">
|
||||
<div className="flex justify-start space-x-2">
|
||||
<SkeletonText className="h-3 w-3" />
|
||||
<div className="space-y-2">
|
||||
<SkeletonText className="h-1 w-8" />
|
||||
<SkeletonText className="h-1 w-4" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-4 hidden flex-shrink-0 sm:mt-0 sm:ml-5 lg:flex">
|
||||
<div className="flex justify-between space-x-2 rtl:space-x-reverse">
|
||||
<SkeletonText className="h-3 w-8" />
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Icon } from "@calcom/ui";
|
||||
import {Avatar} from './Avatar';
|
||||
import {AvatarGroup} from './AvatarGroup';
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from "./Avatar";
|
||||
export * from "./AvatarGroup";
|
||||
export { Avatar } from "./Avatar";
|
||||
export type { AvatarProps } from "./Avatar";
|
||||
export { AvatarGroup } from "./AvatarGroup";
|
||||
@@ -3,7 +3,7 @@ import { GoPrimitiveDot } from "react-icons/go";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
|
||||
export const badgeClassNameByVariant = {
|
||||
const badgeClassNameByVariant = {
|
||||
default: "bg-orange-100 text-orange-800",
|
||||
warning: "bg-orange-100 text-orange-800",
|
||||
orange: "bg-orange-100 text-orange-800",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable, VariantRow } from '@calcom/storybook/components'
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Icon } from "@calcom/ui";
|
||||
import { Badge } from './Badge';
|
||||
|
||||
<Meta title="UI/Badge" component={Badge} />
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export * from "./Badge";
|
||||
export { Badge } from "./Badge";
|
||||
export type { BadgeProps } from "./Badge";
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title,CustomArgsTable } from '@calcom/storybook/components'
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
import { Breadcrumb } from './Breadcrumb';
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from "./Breadcrumb";
|
||||
export { Breadcrumb, BreadcrumbContainer, BreadcrumbItem } from "./Breadcrumb";
|
||||
@@ -8,6 +8,8 @@ import { applyStyleToMultipleVariants } from "@calcom/lib/cva";
|
||||
|
||||
import Tooltip from "../../v2/core/Tooltip";
|
||||
|
||||
type InferredVariantProps = VariantProps<typeof buttonClasses>;
|
||||
|
||||
export type ButtonBaseProps = {
|
||||
/** Action that happens when the button is clicked */
|
||||
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||
@@ -19,7 +21,9 @@ export type ButtonBaseProps = {
|
||||
/**Tool tip used when icon size is set to small */
|
||||
tooltip?: string;
|
||||
flex?: boolean;
|
||||
} & VariantProps<typeof buttonClasses>;
|
||||
} & Omit<InferredVariantProps, "color"> & {
|
||||
color?: NonNullable<InferredVariantProps["color"]>;
|
||||
};
|
||||
|
||||
export type ButtonProps = ButtonBaseProps &
|
||||
(
|
||||
@@ -38,7 +42,8 @@ const buttonClasses = cva(
|
||||
destructive: "",
|
||||
},
|
||||
size: {
|
||||
base: "h-9 px-4 py-2.5 ",
|
||||
sm: "px-3 py-2 leading-4 rounded-sm" /** For backwards compatibility */,
|
||||
base: "h-9 px-4 py-2.5 ",
|
||||
lg: "h-[36px] px-4 py-2.5 ",
|
||||
icon: "flex justify-center min-h-[36px] min-w-[36px] ",
|
||||
},
|
||||
@@ -138,7 +143,7 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonPr
|
||||
) {
|
||||
const {
|
||||
loading = false,
|
||||
color,
|
||||
color = "primary",
|
||||
size,
|
||||
type = "button",
|
||||
StartIcon,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title, VariantsTable, VariantColumn, RowTitles, CustomArgsTable} from '@calcom/storybook/components'
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
import { Button } from './Button';
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export * from "./Button";
|
||||
export { Button } from "./Button";
|
||||
export type { ButtonBaseProps, ButtonProps } from "./Button";
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantsRow } from '@calcom/storybook/components'
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
import { ButtonGroup} from './ButtonGroup';
|
||||
import { Button} from '../button/Button';
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from "./ButtonGroup";
|
||||
export { ButtonGroup } from "./ButtonGroup";
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantsRow } from '@calcom/storybook/components'
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
import Checkbox from './Checkbox';
|
||||
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
export * from "./checkbox";
|
||||
export * from "./inputs/HintOrErrors";
|
||||
export * from "./inputs/Input";
|
||||
export * from "./inputs/Label";
|
||||
export { Checkbox } from "./checkbox";
|
||||
export { HintsOrErrors } from "./inputs/HintOrErrors";
|
||||
export {
|
||||
EmailField,
|
||||
EmailInput,
|
||||
FieldsetLegend,
|
||||
Form,
|
||||
Input,
|
||||
InputField,
|
||||
InputGroupBox,
|
||||
InputLeading,
|
||||
PasswordField,
|
||||
TextArea,
|
||||
TextAreaField,
|
||||
TextField,
|
||||
} from "./inputs/Input";
|
||||
export { Label } from "./inputs/Label";
|
||||
@@ -1,16 +1,12 @@
|
||||
import { forwardRef, ReactElement, ReactNode, Ref, useCallback, useId, useState } from "react";
|
||||
import React from "react";
|
||||
import React, { forwardRef, ReactElement, ReactNode, Ref, useCallback, useId, useState } from "react";
|
||||
import { Eye, EyeOff } from "react-feather";
|
||||
import { FieldValues, FormProvider, SubmitHandler, useFormContext, UseFormReturn } from "react-hook-form";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { getErrorFromUnknown } from "@calcom/lib/errors";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Alert } from "@calcom/ui/v2/core/Alert";
|
||||
import { Tooltip } from "@calcom/ui/v2/core/Tooltip";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
import { Skeleton } from "@calcom/ui/v2/core/skeleton";
|
||||
|
||||
import { Alert, showToast, Skeleton, Tooltip } from "../../..";
|
||||
import { HintsOrErrors } from "./HintOrErrors";
|
||||
import { Label } from "./Label";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title,CustomArgsTable, VariantRow,VariantsTable} from '@calcom/storybook/components'
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
import {InputField} from "./Input"
|
||||
|
||||
|
||||
@@ -1,8 +1,27 @@
|
||||
export * from "./avatar";
|
||||
export * from "./badge";
|
||||
export * from "./breadcrumb";
|
||||
export * from "./button";
|
||||
export * from "./buttonGroup";
|
||||
export * from "./form";
|
||||
export { Avatar, AvatarGroup } from "./avatar";
|
||||
export type { AvatarProps } from "./avatar";
|
||||
export { Badge } from "./badge";
|
||||
export type { BadgeProps } from "./badge";
|
||||
export { Breadcrumb, BreadcrumbContainer, BreadcrumbItem } from "./breadcrumb";
|
||||
export { Button } from "./button";
|
||||
export type { ButtonBaseProps, ButtonProps } from "./button";
|
||||
export { ButtonGroup } from "./buttonGroup";
|
||||
export {
|
||||
Checkbox,
|
||||
EmailField,
|
||||
EmailInput,
|
||||
FieldsetLegend,
|
||||
Form,
|
||||
HintsOrErrors,
|
||||
Input,
|
||||
InputField,
|
||||
InputGroupBox,
|
||||
InputLeading,
|
||||
Label,
|
||||
PasswordField,
|
||||
TextArea,
|
||||
TextAreaField,
|
||||
TextField,
|
||||
} from "./form";
|
||||
export { TopBanner } from "./top-banner";
|
||||
export type { TopBannerProps } from "./top-banner";
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable, VariantRow } from '@calcom/storybook/components'
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Icon } from "@calcom/ui";
|
||||
import { TopBanner } from './TopBanner'
|
||||
|
||||
<Meta title="UI/TopBanner" component={TopBanner} />
|
||||
@@ -63,5 +63,3 @@ Each toast has a state to represent neutral, positive or negative responses.
|
||||
/>
|
||||
</Example>
|
||||
</Examples>
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ import classNames from "classnames";
|
||||
import { components } from "react-select";
|
||||
import BaseSelect, {
|
||||
allTimezones,
|
||||
ITimezoneOption,
|
||||
ITimezone,
|
||||
ITimezoneOption,
|
||||
Props as SelectProps,
|
||||
} from "react-timezone-select";
|
||||
|
||||
import { InputComponent } from "@calcom/ui/v2/core/form/select/components";
|
||||
import { InputComponent } from "../v2/core/form/select/components";
|
||||
|
||||
function TimezoneSelect({ className, ...props }: SelectProps) {
|
||||
// @TODO: remove borderRadius and haveRoundedClassName logic from theme so we use only new style
|
||||
|
||||
@@ -5,9 +5,9 @@ import { FieldValues, FormProvider, SubmitHandler, useFormContext, UseFormReturn
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { getErrorFromUnknown } from "@calcom/lib/errors";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import { Alert } from "../Alert";
|
||||
import { showToast } from "../v2/core/notifications";
|
||||
|
||||
type InputProps = Omit<JSX.IntrinsicElements["input"], "name"> & { name: string };
|
||||
|
||||
|
||||
+120
-5
@@ -1,7 +1,122 @@
|
||||
export { default as Button } from "./Button";
|
||||
export { default as EmptyScreen } from "./EmptyScreen";
|
||||
export {
|
||||
Avatar,
|
||||
AvatarGroup,
|
||||
Badge,
|
||||
Breadcrumb,
|
||||
BreadcrumbContainer,
|
||||
BreadcrumbItem,
|
||||
Button,
|
||||
ButtonGroup,
|
||||
Checkbox,
|
||||
EmailField,
|
||||
EmailInput,
|
||||
FieldsetLegend,
|
||||
Form,
|
||||
HintsOrErrors,
|
||||
Input,
|
||||
InputField,
|
||||
InputGroupBox,
|
||||
InputLeading,
|
||||
Label,
|
||||
PasswordField,
|
||||
TextArea,
|
||||
TextAreaField,
|
||||
TextField,
|
||||
TopBanner,
|
||||
} from "./components";
|
||||
export type { AvatarProps, BadgeProps, ButtonBaseProps, ButtonProps, TopBannerProps } from "./components";
|
||||
export { default as CheckboxField } from "./components/form/checkbox/Checkbox";
|
||||
/** ⬇️ TODO - Move these to components */
|
||||
export { default as ErrorBoundary } from "./ErrorBoundary";
|
||||
export { default as AddressInput } from "./form/AddressInputLazy";
|
||||
export { default as PhoneInput } from "./form/PhoneInputLazy";
|
||||
export { default as Select } from "./form/Select";
|
||||
export { BadgeCheckIcon, ClipboardCopyIcon, Icon, ShieldCheckIcon, StarIconSolid } from "./Icon";
|
||||
export { default as Loader } from "./Loader";
|
||||
export { default as Switch } from "./Switch";
|
||||
export { default as Tooltip } from "./Tooltip";
|
||||
export * from "./Icon";
|
||||
export { default as Shell, ShellMain } from "./Shell";
|
||||
export { default as TimezoneChangeDialog } from "./TimezoneChangeDialog";
|
||||
// export { default as Tooltip } from "./Tooltip";
|
||||
export {
|
||||
Alert,
|
||||
CheckedTeamSelect,
|
||||
CustomInputItem,
|
||||
EmptyScreen,
|
||||
HorizontalTabs,
|
||||
SelectField,
|
||||
SelectWithValidation,
|
||||
SettingsToggle,
|
||||
showToast,
|
||||
SkeletonAvatar,
|
||||
SkeletonButton,
|
||||
SkeletonContainer,
|
||||
SkeletonText,
|
||||
Swatch,
|
||||
Switch,
|
||||
VerticalTabs,
|
||||
} from "./v2";
|
||||
export type { AlertProps } from "./v2";
|
||||
export { getReactSelectProps, Segment, SegmentOption } from "./v2/core";
|
||||
export { default as AllApps } from "./v2/core/apps/AllApps";
|
||||
export { default as AppCard } from "./v2/core/apps/AppCard";
|
||||
export { default as AppStoreCategories } from "./v2/core/apps/Categories";
|
||||
export { default as SkeletonLoader } from "./v2/core/apps/SkeletonLoader";
|
||||
export { default as TrendingAppsSlider } from "./v2/core/apps/TrendingAppsSlider";
|
||||
export { default as Banner } from "./v2/core/banner";
|
||||
export { default as ColorPicker } from "./v2/core/colorpicker";
|
||||
export { default as ConfirmationDialogContent } from "./v2/core/ConfirmationDialogContent";
|
||||
export {
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTrigger,
|
||||
} from "./v2/core/Dialog";
|
||||
export type { DialogProps } from "./v2/core/Dialog";
|
||||
export { default as Divider } from "./v2/core/Divider";
|
||||
export {
|
||||
Dropdown,
|
||||
DropdownItem,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuPortal,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "./v2/core/Dropdown";
|
||||
export { RadioGroup } from "./v2/core/form";
|
||||
export { BooleanToggleGroupField } from "./v2/core/form/BooleanToggleGroup";
|
||||
export { default as DateRangePicker } from "./v2/core/form/date-range-picker/DateRangePicker";
|
||||
export { default as DatePickerField } from "./v2/core/form/DatePicker";
|
||||
export { default as FormCard } from "./v2/core/form/FormCard";
|
||||
export { default as MultiSelectCheckboxes } from "./v2/core/form/MultiSelectCheckboxes";
|
||||
export type { Option as MultiSelectCheckboxesOptionType } from "./v2/core/form/MultiSelectCheckboxes";
|
||||
export { ToggleGroup } from "./v2/core/form/ToggleGroup";
|
||||
export { default as ImageUploader } from "./v2/core/ImageUploader";
|
||||
export { default as AdminLayout, getLayout as getAdminLayout } from "./v2/core/layouts/AdminLayout";
|
||||
export { default as AppsLayout } from "./v2/core/layouts/AppsLayout";
|
||||
export { default as BookingLayout } from "./v2/core/layouts/BookingLayout";
|
||||
export { default as InstalledAppsLayout } from "./v2/core/layouts/InstalledAppsLayout";
|
||||
export { default as SettingsLayout, getLayout as getSettingsLayout } from "./v2/core/layouts/SettingsLayout";
|
||||
export { default as WizardLayout, getLayout as getWizardLayout } from "./v2/core/layouts/WizardLayout";
|
||||
export { default as LinkIconButton } from "./v2/core/LinkIconButton";
|
||||
export { List, ListItem, ListItemText, ListItemTitle, ListLinkItem } from "./v2/core/List";
|
||||
export { default as MeetingTimeInTimezones } from "./v2/core/MeetingTimeInTimezones";
|
||||
export { default as Meta, MetaProvider } from "./v2/core/Meta";
|
||||
export { MobileNavigationMoreItems, ShellSubHeading } from "./v2/core/Shell";
|
||||
export { Skeleton } from "./v2/core/skeleton";
|
||||
export { StepCard } from "./v2/core/StepCard";
|
||||
export { default as Stepper } from "./v2/core/Stepper";
|
||||
export { Steps } from "./v2/core/Steps";
|
||||
export { default as TimezoneSelect } from "./v2/core/TimezoneSelect";
|
||||
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 { default as CreateEventTypeButton } from "./v2/modules/event-types/CreateEventType";
|
||||
export { EventTypeDescription } from "./v2/modules/event-types/EventTypeDescription";
|
||||
export { default as DisconnectIntegration } from "./v2/modules/integrations/DisconnectIntegration";
|
||||
export { default as Tips } from "./v2/modules/tips/Tips";
|
||||
@@ -3,6 +3,7 @@
|
||||
"sideEffects": false,
|
||||
"version": "0.0.0",
|
||||
"main": "./index.tsx",
|
||||
"exports": "./index.tsx",
|
||||
"types": "./index.tsx",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
@@ -2,9 +2,10 @@ import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import React, { PropsWithChildren, ReactNode } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Button } from "@calcom/ui/components";
|
||||
import { DialogClose, DialogContent } from "@calcom/ui/v2";
|
||||
|
||||
import { Icon } from "../../Icon";
|
||||
import { Button } from "../../components";
|
||||
import { DialogClose, DialogContent } from "./Dialog";
|
||||
|
||||
export type ConfirmationDialogContentProps = {
|
||||
confirmBtn?: ReactNode;
|
||||
|
||||
@@ -65,7 +65,7 @@ export function Dialog(props: DialogProps) {
|
||||
}
|
||||
type DialogContentProps = React.ComponentProps<typeof DialogPrimitive["Content"]> & {
|
||||
size?: "xl" | "lg" | "md";
|
||||
type: "creation" | "confirmation";
|
||||
type?: "creation" | "confirmation";
|
||||
title?: string;
|
||||
description?: string | JSX.Element | undefined;
|
||||
closeText?: string;
|
||||
@@ -80,7 +80,10 @@ type DialogContentProps = React.ComponentProps<typeof DialogPrimitive["Content"]
|
||||
};
|
||||
|
||||
export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps>(
|
||||
({ children, title, Icon, actionProps, useOwnActionButtons, ...props }, forwardedRef) => {
|
||||
(
|
||||
{ children, title, Icon, actionProps, useOwnActionButtons, type = "creation", ...props },
|
||||
forwardedRef
|
||||
) => {
|
||||
const { t } = useLocale();
|
||||
|
||||
return (
|
||||
@@ -102,14 +105,14 @@ export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps
|
||||
`${props.className || ""}`
|
||||
)}
|
||||
ref={forwardedRef}>
|
||||
{props.type === "creation" && (
|
||||
{type === "creation" && (
|
||||
<div>
|
||||
{title && <DialogHeader title={title} />}
|
||||
{props.description && <p className="pb-5 text-sm text-gray-500">{props.description}</p>}
|
||||
<div className="flex flex-col space-y-6">{children}</div>
|
||||
</div>
|
||||
)}
|
||||
{props.type === "confirmation" && (
|
||||
{type === "confirmation" && (
|
||||
<div className="flex">
|
||||
{Icon && (
|
||||
<div className="mr-4 inline-flex h-10 w-10 items-center justify-center rounded-full bg-gray-300">
|
||||
|
||||
@@ -3,8 +3,8 @@ import { FormEvent, useCallback, useEffect, useState } from "react";
|
||||
import Cropper from "react-easy-crop";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Dialog, DialogClose, DialogContent, DialogTrigger } from "@calcom/ui/Dialog";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
|
||||
import { Button, Dialog, DialogClose, DialogContent, DialogTrigger } from "../../";
|
||||
|
||||
type ReadAsMethod = "readAsText" | "readAsDataURL" | "readAsArrayBuffer" | "readAsBinaryString";
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { ReactNode } from "react";
|
||||
|
||||
import { Badge, badgeClassNameByVariant } from "../../components/badge";
|
||||
import { Badge, BadgeProps } from "../../components/badge";
|
||||
|
||||
type Props = {
|
||||
title: string;
|
||||
description?: string;
|
||||
badgeText?: string;
|
||||
badgeVariant?: keyof typeof badgeClassNameByVariant;
|
||||
badgeVariant?: BadgeProps["variant"];
|
||||
infoIcon?: string;
|
||||
rightAlignedComponent?: ReactNode;
|
||||
};
|
||||
|
||||
@@ -21,18 +21,20 @@ import isCalcom from "@calcom/lib/isCalcom";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
|
||||
import { SVGComponent } from "@calcom/types/SVGComponent";
|
||||
import Dropdown, {
|
||||
|
||||
import {
|
||||
Button,
|
||||
Dropdown,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuPortal,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "@calcom/ui/Dropdown";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import TimezoneChangeDialog from "@calcom/ui/TimezoneChangeDialog";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
import Tips from "@calcom/ui/v2/modules/tips/Tips";
|
||||
Icon,
|
||||
showToast,
|
||||
TimezoneChangeDialog,
|
||||
Tips,
|
||||
} from "../..";
|
||||
|
||||
/* TODO: Get this from endpoint */
|
||||
import pkg from "../../../../apps/web/package.json";
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import React, { FC } from "react";
|
||||
|
||||
import { SVGComponent } from "@calcom/types/SVGComponent";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
|
||||
import {
|
||||
Button,
|
||||
Dropdown,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
DropdownMenuPortal,
|
||||
} from "@calcom/ui/v2/core/Dropdown";
|
||||
import Dropdown from "@calcom/ui/v2/core/Dropdown";
|
||||
DropdownMenuTrigger,
|
||||
Icon,
|
||||
} from "../..";
|
||||
|
||||
export type ActionType = {
|
||||
id: string;
|
||||
|
||||
@@ -6,7 +6,7 @@ import BaseSelect, {
|
||||
Props as SelectProps,
|
||||
} from "react-timezone-select";
|
||||
|
||||
import { getReactSelectProps } from "@calcom/ui/v2/core/form/select";
|
||||
import { getReactSelectProps } from "../..";
|
||||
|
||||
function TimezoneSelect({ className, components, ...props }: SelectProps) {
|
||||
const reactSelectProps = useMemo(() => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import Stepper from "@calcom/ui/v2/core/Stepper";
|
||||
|
||||
import { Button, Stepper } from "../..";
|
||||
|
||||
type DefaultStep = {
|
||||
title: string;
|
||||
|
||||
@@ -5,9 +5,9 @@ import useAddAppMutation from "@calcom/app-store/_utils/useAddAppMutation";
|
||||
import { InstallAppButton } from "@calcom/app-store/components";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { App } from "@calcom/types/App";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import { showToast } from "@calcom/ui/v2";
|
||||
|
||||
import { Button, Icon } from "../../..";
|
||||
import { showToast } from "../notifications";
|
||||
|
||||
interface AppCardProps {
|
||||
app: App;
|
||||
@@ -71,6 +71,7 @@ export default function AppCard({ app, credentials }: AppCardProps) {
|
||||
render={({ useDefaultComponent, ...props }) => {
|
||||
if (useDefaultComponent) {
|
||||
props = {
|
||||
...props,
|
||||
onClick: () => {
|
||||
mutation.mutate({ type: app.type, variant: app.variant, slug: app.slug });
|
||||
},
|
||||
@@ -97,11 +98,14 @@ export default function AppCard({ app, credentials }: AppCardProps) {
|
||||
render={({ useDefaultComponent, ...props }) => {
|
||||
if (useDefaultComponent) {
|
||||
props = {
|
||||
...props,
|
||||
onClick: () => {
|
||||
mutation.mutate({ type: app.type, variant: app.variant, slug: app.slug });
|
||||
},
|
||||
};
|
||||
}
|
||||
props.color;
|
||||
// ^?
|
||||
return (
|
||||
<Button
|
||||
StartIcon={Icon.FiPlus}
|
||||
|
||||
@@ -4,8 +4,8 @@ import "@glidejs/glide/dist/css/glide.theme.min.css";
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
|
||||
import { Icon } from "../../..";
|
||||
import { SkeletonText } from "../skeleton";
|
||||
|
||||
const Slider = <T extends string | unknown>({
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
import { useEffect } from "react";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { HexColorInput, HexColorPicker } from "react-colorful";
|
||||
|
||||
import { isValidHexCode, fallBackHex } from "@calcom/lib/CustomBranding";
|
||||
import Swatch from "@calcom/ui/v2/core/Swatch";
|
||||
import { fallBackHex, isValidHexCode } from "@calcom/lib/CustomBranding";
|
||||
|
||||
import { Swatch } from "../..";
|
||||
|
||||
type Handler = (event: MouseEvent | Event) => void;
|
||||
function useEventListener<
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { classNames } from "@calcom/lib";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
|
||||
import { Icon } from "../../..";
|
||||
import Divider from "../Divider";
|
||||
|
||||
type Action = { check: () => boolean; fn: () => void };
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// @see: https://github.com/wojtekmaj/react-daterange-picker/issues/91
|
||||
import "@wojtekmaj/react-daterange-picker/dist/DateRangePicker.css";
|
||||
import PrimitiveDateRangePicker from "@wojtekmaj/react-daterange-picker/dist/entry.nostyle";
|
||||
import React from "react";
|
||||
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import "@calcom/ui/v2/core/form/date-range-picker/styles.css";
|
||||
import { Icon } from "../../../..";
|
||||
import "./styles.css";
|
||||
|
||||
type Props = {
|
||||
disabled?: boolean | undefined;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export * from "./radio-area";
|
||||
export { RadioGroup, /* TODO: solve this conflict -> Select, */ Radio } from "./radio-area";
|
||||
export { default as Checkbox } from "../../../components/form/checkbox/Checkbox";
|
||||
export { default as DatePicker } from "./DatePicker";
|
||||
export { default as Select, SelectWithValidation, SelectField, getReactSelectProps } from "./select";
|
||||
|
||||
@@ -4,7 +4,8 @@ import React from "react";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { RadioArea, RadioAreaGroup } from "@calcom/ui/v2/core/form/radio-area/RadioAreaGroup";
|
||||
|
||||
import { RadioArea, RadioAreaGroup } from "./RadioAreaGroup";
|
||||
|
||||
interface OptionProps
|
||||
extends Pick<React.OptionHTMLAttributes<HTMLOptionElement>, "value" | "label" | "className"> {
|
||||
|
||||
@@ -12,7 +12,8 @@ import {
|
||||
} from "react-select";
|
||||
|
||||
import { classNames } from "@calcom/lib";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
|
||||
import { Icon } from "../../../..";
|
||||
|
||||
export const InputComponent = <
|
||||
Option,
|
||||
|
||||
@@ -1,29 +1,58 @@
|
||||
export * from "./Alert";
|
||||
export * from "./Card";
|
||||
export * from "./Dialog";
|
||||
export { default as Dropdown } from "./Dropdown";
|
||||
export * from "./Dropdown";
|
||||
export { Alert } from "./Alert";
|
||||
export type { AlertProps } from "./Alert";
|
||||
export { default as Banner } from "./banner";
|
||||
export { Card } from "./Card";
|
||||
export type { BaseCardProps } from "./Card";
|
||||
export { default as ColorPicker } from "./colorpicker";
|
||||
export { Dialog, DialogClose, DialogContent, DialogFooter, DialogHeader, DialogTrigger } from "./Dialog";
|
||||
export type { DialogProps } from "./Dialog";
|
||||
export {
|
||||
ButtonOrLink,
|
||||
Dropdown,
|
||||
DropdownItem,
|
||||
DropdownMenuCheckboxItem,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuGroup,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuPortal,
|
||||
DropdownMenuRadioGroup,
|
||||
DropdownMenuRadioItem,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
DropdownMenuTriggerItem,
|
||||
} from "./Dropdown";
|
||||
export { default as EmptyScreen } from "./EmptyScreen";
|
||||
export {
|
||||
Checkbox,
|
||||
DatePicker,
|
||||
FormStep,
|
||||
getReactSelectProps,
|
||||
Radio,
|
||||
RadioGroup,
|
||||
Select,
|
||||
SelectField,
|
||||
SelectWithValidation,
|
||||
} from "./form";
|
||||
export { default as LinkIconButton } from "./LinkIconButton";
|
||||
export { List, ListItem } from "./List";
|
||||
export type { ListItemProps } from "./List";
|
||||
export { default as Loader } from "./Loader";
|
||||
export { default as MeetingTimeInTimezones } from "./MeetingTimeInTimezones";
|
||||
export type { HorizontalTabItemProps } from "./navigation/tabs/HorizontalTabItem";
|
||||
export { default as HorizontalTabs, HorizontalTabItem } from "./navigation/tabs/HorizontalTabs";
|
||||
export type { VerticalTabItemProps } from "./navigation/tabs/VerticalTabItem";
|
||||
export { default as VerticalTabs, VerticalTabItem } from "./navigation/tabs/VerticalTabs";
|
||||
export { default as showToast } from "./notifications";
|
||||
export { default as PageHeader } from "./PageHeader";
|
||||
export { Portal } from "./Portal";
|
||||
export { Segment, SegmentOption } from "./Segment";
|
||||
export { default as SettingsToggle } from "./SettingsToggle";
|
||||
export { default as Shell } from "./Shell";
|
||||
export { Skeleton, SkeletonAvatar, SkeletonButton, SkeletonContainer, SkeletonText } from "./skeleton";
|
||||
export { default as Stepper } from "./Stepper";
|
||||
export { default as Swatch } from "./Swatch";
|
||||
export { default as Switch } from "./Switch";
|
||||
export { default as Tooltip } from "./Tooltip";
|
||||
export { default as WizardForm } from "./WizardForm";
|
||||
export { default as Banner } from "./banner";
|
||||
export { default as ColorPicker } from "./colorpicker";
|
||||
export * from "./form";
|
||||
export { default as showToast } from "./notifications";
|
||||
export { default as LinkIconButton } from "./LinkIconButton";
|
||||
export { default as VerticalDivider } from "./VerticalDivider";
|
||||
export * from "./skeleton";
|
||||
export { default as VerticalTabs, VerticalTabItem } from "./navigation/tabs/VerticalTabs";
|
||||
export { default as HorizontalTabs, HorizontalTabItem } from "./navigation/tabs/HorizontalTabs";
|
||||
export type { VerticalTabItemProps } from "./navigation/tabs/VerticalTabItem";
|
||||
export type { HorizontalTabItemProps } from "./navigation/tabs/HorizontalTabItem";
|
||||
export * from "./Portal";
|
||||
export * from "./Segment";
|
||||
export { default as SettingsToggle } from "./SettingsToggle";
|
||||
export { default as WizardForm } from "./WizardForm";
|
||||
@@ -1,10 +1,8 @@
|
||||
import React, { ComponentProps } from "react";
|
||||
|
||||
import { Icon } from "@calcom/ui";
|
||||
import HorizontalTabs from "@calcom/ui/v2/core/navigation/tabs/HorizontalTabs";
|
||||
import type { VerticalTabItemProps } from "@calcom/ui/v2/core/navigation/tabs/VerticalTabItem";
|
||||
import VerticalTabs from "@calcom/ui/v2/core/navigation/tabs/VerticalTabs";
|
||||
|
||||
import type { VerticalTabItemProps } from "../";
|
||||
import { HorizontalTabs, VerticalTabs } from "../";
|
||||
import { Icon } from "../../../Icon";
|
||||
import Shell from "../Shell";
|
||||
import type { HorizontalTabItemProps } from "../navigation/tabs/HorizontalTabItem";
|
||||
|
||||
|
||||
@@ -6,16 +6,12 @@ import { useRouter } from "next/router";
|
||||
import React, { ComponentProps, useEffect, useState } from "react";
|
||||
|
||||
import { classNames } from "@calcom/lib";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { HOSTED_CAL_FEATURES } from "@calcom/lib/constants";
|
||||
import { HOSTED_CAL_FEATURES, WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
|
||||
import ErrorBoundary from "../../../ErrorBoundary";
|
||||
import { Icon } from "../../../Icon";
|
||||
import { Badge } from "../../../components/badge";
|
||||
import { Badge, Button, ErrorBoundary, Icon } from "../../..";
|
||||
import { useMeta } from "../Meta";
|
||||
import Shell from "../Shell";
|
||||
import { VerticalTabItemProps } from "../navigation/tabs/VerticalTabItem";
|
||||
|
||||
@@ -3,8 +3,7 @@ import { useRouter } from "next/router";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
import { StepCard } from "@calcom/ui/v2/core/StepCard";
|
||||
import { Steps } from "@calcom/ui/v2/core/Steps";
|
||||
import { StepCard, Steps } from "../../..";
|
||||
|
||||
export default function WizardLayout({
|
||||
children,
|
||||
|
||||
@@ -5,8 +5,8 @@ import { ComponentProps, Fragment } from "react";
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { SVGComponent } from "@calcom/types/SVGComponent";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
|
||||
import { Icon } from "../../../..";
|
||||
import { Skeleton } from "../../skeleton";
|
||||
|
||||
export type VerticalTabItemProps = {
|
||||
|
||||
@@ -2,7 +2,7 @@ import classNames from "classnames";
|
||||
import { Check, Info } from "react-feather";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
export default function showToast(message: string, variant: "success" | "warning" | "error") {
|
||||
export function showToast(message: string, variant: "success" | "warning" | "error") {
|
||||
switch (variant) {
|
||||
case "success":
|
||||
toast.custom(
|
||||
@@ -66,3 +66,4 @@ export default function showToast(message: string, variant: "success" | "warning
|
||||
break;
|
||||
}
|
||||
}
|
||||
export default showToast;
|
||||
@@ -1,2 +1,3 @@
|
||||
/* TODO: Make this index explicit */
|
||||
export * from "./core";
|
||||
export * from "./modules";
|
||||
@@ -7,8 +7,8 @@ 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 { Icon } from "@calcom/ui";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
|
||||
import { Button, Icon } from "../../..";
|
||||
|
||||
interface Props {
|
||||
samlTenantID: string;
|
||||
|
||||
@@ -6,7 +6,8 @@ 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 { SkeletonText } from "@calcom/ui/v2";
|
||||
|
||||
import { SkeletonText } from "../../..";
|
||||
|
||||
export type DatePickerProps = {
|
||||
/** which day of the week to render the calendar. Usually Sunday (=0) or Monday (=1) - default: Sunday */
|
||||
|
||||
@@ -3,10 +3,8 @@ import { Props } from "react-select";
|
||||
|
||||
import { classNames } from "@calcom/lib";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
|
||||
import { Avatar } from "../../../components";
|
||||
import { Select } from "../../core/form";
|
||||
import { Avatar, Icon, Select } from "../../..";
|
||||
|
||||
type CheckedSelectOption = {
|
||||
avatar: string;
|
||||
|
||||
@@ -13,21 +13,27 @@ import { HttpError } from "@calcom/lib/http-error";
|
||||
import slugify from "@calcom/lib/slugify";
|
||||
import { createEventTypeInput } from "@calcom/prisma/zod/custom/eventtype";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Alert } from "@calcom/ui/Alert";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Avatar } from "@calcom/ui/components/avatar";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import { Form, TextAreaField, TextField } from "@calcom/ui/components/form";
|
||||
import { Dialog, DialogClose, DialogContent } from "@calcom/ui/v2/core/Dialog";
|
||||
import Dropdown, {
|
||||
|
||||
import {
|
||||
Alert,
|
||||
Avatar,
|
||||
Button,
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
Dropdown,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "@calcom/ui/v2/core/Dropdown";
|
||||
import * as RadioArea from "@calcom/ui/v2/core/form/radio-area/RadioAreaGroup";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
Form,
|
||||
Icon,
|
||||
RadioGroup as RadioArea,
|
||||
showToast,
|
||||
TextAreaField,
|
||||
TextField,
|
||||
} from "../../..";
|
||||
|
||||
// this describes the uniform data needed to create a new event type on Profile or Team
|
||||
export interface EventTypeParent {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Icon } from "@calcom/ui";
|
||||
import { Badge } from "@calcom/ui/components/badge";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import { ButtonGroup } from "@calcom/ui/components/buttonGroup";
|
||||
|
||||
import { Badge, Button, ButtonGroup, Icon } from "../../..";
|
||||
|
||||
type Props = {
|
||||
required?: boolean;
|
||||
|
||||
@@ -8,8 +8,8 @@ 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 { Icon } from "@calcom/ui";
|
||||
import { Badge } from "@calcom/ui/components/badge";
|
||||
|
||||
import { Badge, Icon } from "../../..";
|
||||
|
||||
export type EventTypeDescriptionProps = {
|
||||
eventType: Pick<
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { components, GroupBase, Props, ValueContainerProps } from "react-select";
|
||||
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
|
||||
import { Select } from "../..";
|
||||
import { Icon } from "../../..";
|
||||
|
||||
const LimitedChipsContainer = <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({
|
||||
children,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
export { default as CheckedTeamSelect } from "./CheckedTeamSelect";
|
||||
export { default as CreateEventType } from "./CreateEventType";
|
||||
export { default as CustomInputItem } from "./CustomInputItem";
|
||||
export { default as CheckedTeamSelect } from "./CheckedTeamSelect";
|
||||
export const EventTypeDescriptionLazy = dynamic(() => import("./EventTypeDescription"));
|
||||
@@ -2,10 +2,8 @@ import { useState } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Icon } from "@calcom/ui";
|
||||
import { Button, ButtonProps } from "@calcom/ui/components/button";
|
||||
import { Dialog, DialogTrigger, DialogContent } from "@calcom/ui/v2/core/Dialog";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import { Button, ButtonProps, Dialog, DialogContent, DialogTrigger, Icon, showToast } from "../../..";
|
||||
|
||||
export default function DisconnectIntegration({
|
||||
credentialId,
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
import { MembershipRole } from "@prisma/client";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import React from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { TeamWithMembers } from "@calcom/lib/server/queries/teams";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import ConfirmationDialogContent from "@calcom/ui/ConfirmationDialogContent";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import { Dialog, DialogTrigger } from "@calcom/ui/v2/core/Dialog";
|
||||
import LinkIconButton from "@calcom/ui/v2/core/LinkIconButton";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import { ConfirmationDialogContent, Dialog, DialogTrigger, Icon, LinkIconButton, showToast } from "../../..";
|
||||
import CreateEventTypeButton from "../event-types/CreateEventType";
|
||||
|
||||
export default function TeamSettingsRightSidebar(props: { team: TeamWithMembers; role: MembershipRole }) {
|
||||
|
||||
Reference in new issue
Block a user