🧹 Removed old root UI components. (#6249)
* 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
This commit is contained in:
1 parent
268bf68532
commit
37159914cf
42 files changed
+102
-8342
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { ShellSubHeading } from "../../Shell";
|
||||
import Meta from "../../v2/core/Meta";
|
||||
import { ShellSubHeading } from "../../v2/core/Shell";
|
||||
import { SkeletonText } from "../skeleton";
|
||||
|
||||
export function SkeletonLoader({
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useEffect, useRef } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
|
||||
import { Icon } from "../../Icon";
|
||||
import { Icon } from "../../components/icon";
|
||||
import { SkeletonText } from "../skeleton";
|
||||
|
||||
export const Slider = <T extends string | unknown>({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantsRow } from '@calcom/storybook/components'
|
||||
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
import { ButtonGroup} from './ButtonGroup';
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import React, { ErrorInfo } from "react";
|
||||
|
||||
class ErrorBoundary extends React.Component<
|
||||
{ children: React.ReactNode; message?: string },
|
||||
{ error: Error | null; errorInfo: ErrorInfo | null }
|
||||
> {
|
||||
constructor(props: { children: React.ReactNode } | Readonly<{ children: React.ReactNode }>) {
|
||||
super(props);
|
||||
this.state = { error: null, errorInfo: null };
|
||||
}
|
||||
|
||||
componentDidCatch?(error: Error, errorInfo: ErrorInfo) {
|
||||
// Catch errors in any components below and re-render with error message
|
||||
this.setState({ error, errorInfo });
|
||||
// You can also log error messages to an error reporting service here
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.errorInfo) {
|
||||
// Error path
|
||||
return (
|
||||
<div>
|
||||
<h2>{this.props.message || "Something went wrong."}</h2>
|
||||
<details style={{ whiteSpace: "pre-wrap" }}>
|
||||
{this.state.error && this.state.error.toString()}
|
||||
</details>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
// Normally, just render children
|
||||
return this.props.children;
|
||||
}
|
||||
}
|
||||
|
||||
export default ErrorBoundary;
|
||||
@@ -0,0 +1 @@
|
||||
export { default as ErrorBoundary } from "./ErrorBoundary";
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantsRow } from '@calcom/storybook/components'
|
||||
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
import Checkbox from './Checkbox';
|
||||
@@ -49,18 +49,18 @@ Checkboxes are used in forms and databases to indicate an answer to a question,
|
||||
<Canvas>
|
||||
<Story name="Checkbox">
|
||||
<VariantsTable titles={[""]} columnMinWidth={150}>
|
||||
<VariantsRow variant="Default">
|
||||
<VariantRow variant="Default">
|
||||
<Checkbox label="Default" />
|
||||
<Checkbox label="Error" error/>
|
||||
<Checkbox label="Disabled" disabled/>
|
||||
<Checkbox label="Disabled Checked" checked disabled />
|
||||
</VariantsRow>
|
||||
<VariantsRow variant="Description As Label">
|
||||
</VariantRow>
|
||||
<VariantRow variant="Description As Label">
|
||||
<Checkbox description="Default" descriptionAsLabel />
|
||||
<Checkbox description="Error" error descriptionAsLabel/>
|
||||
<Checkbox description="Disabled" disabled descriptionAsLabel/>
|
||||
<Checkbox description="Disabled Checked" checked disabled descriptionAsLabel/>
|
||||
</VariantsRow>
|
||||
</VariantRow>
|
||||
</VariantsTable>
|
||||
</Story>
|
||||
</Canvas>
|
||||
@@ -1,7 +1,6 @@
|
||||
import { FieldValues, useFormContext } from "react-hook-form";
|
||||
|
||||
// TODO: Refactor import once V1 migration has happened
|
||||
import { Icon } from "../../../Icon";
|
||||
import { Icon } from "../../../components/icon";
|
||||
|
||||
export function HintsOrErrors<T extends FieldValues = FieldValues>(props: {
|
||||
hintErrors?: string[];
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
|
||||
import { classNames } from "@calcom/lib";
|
||||
|
||||
import { Icon } from "../../../Icon";
|
||||
import { Icon } from "../../../components/icon";
|
||||
|
||||
export const InputComponent = <
|
||||
Option,
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// if feather icon is missing, use "@heroicons/react/outline";
|
||||
import { CollectionIcon } from "@heroicons/react/outline";
|
||||
import { ShieldCheckIcon } from "@heroicons/react/outline";
|
||||
import { BadgeCheckIcon } from "@heroicons/react/outline";
|
||||
import { ClipboardCopyIcon } from "@heroicons/react/outline";
|
||||
import { StarIcon as StarIconSolid } from "@heroicons/react/solid";
|
||||
// find all feather icons at https://feathericons.com/
|
||||
// github https://github.com/feathericons/feather
|
||||
import * as ReactIcons from "react-icons/fi";
|
||||
|
||||
export const Icon = {
|
||||
...ReactIcons,
|
||||
CollectionIcon,
|
||||
ShieldCheckIcon,
|
||||
BadgeCheckIcon,
|
||||
ClipboardCopyIcon,
|
||||
StarIconSolid,
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./Icon";
|
||||
@@ -41,4 +41,7 @@ export type { TopBannerProps } from "./top-banner";
|
||||
export { AnimatedPopover } from "./popover/index";
|
||||
export { TableActions, DropdownActions } from "./table/TableActions";
|
||||
export type { ActionType } from "./table/TableActions";
|
||||
export { Icon } from "./icon";
|
||||
export { ErrorBoundary } from "./errorBoundary";
|
||||
export { Logo } from "./logo";
|
||||
export { Skeleton, SkeletonAvatar, SkeletonButton, SkeletonContainer, SkeletonText } from "./skeleton";
|
||||
@@ -0,0 +1,15 @@
|
||||
import { LOGO_ICON, LOGO } from "@calcom/lib/constants";
|
||||
|
||||
export default function Logo({ small, icon }: { small?: boolean; icon?: boolean }) {
|
||||
return (
|
||||
<h1 className="logo inline">
|
||||
<strong>
|
||||
{icon ? (
|
||||
<img className="mx-auto w-9" alt="Cal" title="Cal" src={LOGO_ICON} />
|
||||
) : (
|
||||
<img className={small ? "h-4 w-auto" : "h-5 w-auto"} alt="Cal" title="Cal" src={LOGO} />
|
||||
)}
|
||||
</strong>
|
||||
</h1>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export { default as Logo } from "./Logo";
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
|
||||
import Logo from './Logo';
|
||||
|
||||
<Meta title="UI/Logo" component={Logo} />
|
||||
|
||||
<Title title="Logo" suffix="Brief" subtitle="Version 2.0 — Last Update: 02 Jan 2023"/>
|
||||
|
||||
## Definition
|
||||
Main Cal.com brand logo
|
||||
|
||||
<CustomArgsTable of={Logo} />
|
||||
|
||||
<Canvas>
|
||||
<Story name="Logo">
|
||||
<VariantsTable titles={['']} columnMinWidth={150}>
|
||||
<VariantRow variant="Small">
|
||||
<Logo small />
|
||||
</VariantRow>
|
||||
<VariantRow variant="Default">
|
||||
<Logo />
|
||||
</VariantRow>
|
||||
</VariantsTable>
|
||||
</Story>
|
||||
</Canvas>
|
||||
Reference in new issue
Block a user