diff --git a/apps/storybook/stories/Cards.stories.tsx b/apps/storybook/stories/Cards.stories.tsx new file mode 100644 index 0000000000..8faa78076a --- /dev/null +++ b/apps/storybook/stories/Cards.stories.tsx @@ -0,0 +1,53 @@ +import { ComponentMeta } from "@storybook/react"; + +import { BaseCardProps, Card } from "@calcom/ui/v2/Card"; + +export default { + title: "Cards", + component: Card, +} as ComponentMeta; + +const profileProps: BaseCardProps[] = [ + { + variant: "ProfileCard", + title: "Alex Fisher", + image: + "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80", + description: "Co-founder at Attio. Book a meeting to discuss enterprise deals.", + }, + { + variant: "ProfileCard", + title: "Julian Wan", + image: + "https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1760&q=80", + description: "Co-founder at Attio. Book a meeting to discuss enterprise deals.", + }, +]; + +export const Profile = () => { + return ( +
+ + +
+ ); +}; + +const appStoreProps: BaseCardProps = { + variant: "AppStore", + title: "Giphy", + image: "https://app.cal.com/api/app-store/giphy/icon.svg", + description: "Add GIFs to spice up your booking confirmations.", + actionButton: { + href: "#", + child: "View Details", + }, +}; + +export const AppStore = () => { + return ( +
+ +
+ ); +}; diff --git a/apps/storybook/stories/HorizontalTab.stories.tsx b/apps/storybook/stories/HorizontalTab.stories.tsx new file mode 100644 index 0000000000..784a2c7b67 --- /dev/null +++ b/apps/storybook/stories/HorizontalTab.stories.tsx @@ -0,0 +1,30 @@ +// Disabling until we figure out what is happening with the RouterMock. +import { ComponentMeta } from "@storybook/react"; + +import { HorizontalTabs } from "@calcom/ui/v2/navigation/tabs"; +import { HorizontalTabItemProps } from "@calcom/ui/v2/navigation/tabs/HorizontalTabItem"; + +export default { + title: "Horizontal Tabs", + component: HorizontalTabs, +} as ComponentMeta; + +const HorizontalTabsPropsDefault: HorizontalTabItemProps[] = [ + { + name: "Tab One", + href: "/tab-one", + }, +]; + +export const Default = () => ( +
+ +
+); + +Default.parameters = { + nextRouter: { + path: "/[page]", + asPath: "/profile", + }, +}; diff --git a/packages/lib/defaultAvatarImage.ts b/packages/lib/defaultAvatarImage.ts index 2ef123d980..94ca0e75b9 100644 --- a/packages/lib/defaultAvatarImage.ts +++ b/packages/lib/defaultAvatarImage.ts @@ -9,3 +9,10 @@ export const defaultAvatarSrc = function ({ email, md5 }: { md5?: string; email? return `https://www.gravatar.com/avatar/${md5}?s=160&d=identicon&r=PG`; }; + +export function getPlaceholderAvatar(avatar: string | null | undefined, name: string | null) { + return avatar + ? avatar + : "https://eu.ui-avatars.com/api/?background=fff&color=f9f9f9&bold=true&background=000000&name=" + + encodeURIComponent(name || ""); +} diff --git a/packages/ui/package.json b/packages/ui/package.json index e509093522..cc8b80cb25 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -22,6 +22,7 @@ "@calcom/config": "*", "@calcom/lib": "*", "@calcom/tsconfig": "*", + "@calcom/trpc": "*", "@types/react": "18.0.9", "@types/react-dom": "18.0.4", "typescript": "^4.6.4" diff --git a/packages/ui/v2/Breadcrumb.tsx b/packages/ui/v2/Breadcrumb.tsx index 9a15061201..f156ab7149 100644 --- a/packages/ui/v2/Breadcrumb.tsx +++ b/packages/ui/v2/Breadcrumb.tsx @@ -23,8 +23,8 @@ export const Breadcrumb = ({ children }: BreadcrumbProps) => { }); return ( -