chore: upgrade storybook 7.6.3 + use @storybook/nextjs (#12673)
* chore: upgrade storybook 7.6.3 + use @storybook/nextjs * fix: color picker tests
This commit is contained in:
1 parent
9a6d4e63e8
commit
80b92b5f11
13 files changed
+112
-83
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { TooltipProvider } from "@radix-ui/react-tooltip";
|
||||
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
|
||||
|
||||
import {
|
||||
@@ -9,6 +10,7 @@ import {
|
||||
VariantColumn,
|
||||
RowTitles,
|
||||
CustomArgsTable,
|
||||
VariantRow,
|
||||
} from "@calcom/storybook/components";
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
@@ -20,31 +22,36 @@ import { mockEvent } from "./event.mock.ts";
|
||||
<Meta title="Features/Events/Meta" component={EventDetails} />
|
||||
|
||||
<Title title="Event Meta" suffix="Brief" subtitle="Version 2.0 — Last Update: 12 Dec 2022" />
|
||||
|
||||
<Examples title="Combined event meta block">
|
||||
<div style={{ maxWidth: 300 }}>
|
||||
<Example title="Event Title">
|
||||
<EventTitle event={mockEvent} />
|
||||
</Example>
|
||||
<Example title="Event Details">
|
||||
<EventDetails event={mockEvent} />
|
||||
</Example>
|
||||
</div>
|
||||
</Examples>
|
||||
<TooltipProvider>
|
||||
<Examples title="Combined event meta block">
|
||||
<div style={{ maxWidth: 300 }}>
|
||||
<Example title="Event Title">
|
||||
<EventTitle event={mockEvent} />
|
||||
</Example>
|
||||
<Example title="Event Details">
|
||||
<EventDetails event={mockEvent} />
|
||||
</Example>
|
||||
</div>
|
||||
</Examples>
|
||||
</TooltipProvider>
|
||||
|
||||
<Canvas>
|
||||
<Story name="All variants">
|
||||
<VariantsTable titles={["Event Meta Components"]} columnMinWidth={150}>
|
||||
<VariantRow variant="">
|
||||
<div style={{ maxWidth: 300 }}>
|
||||
<EventMembers
|
||||
users={[
|
||||
{ name: "Pro example", username: "pro" },
|
||||
{ name: "Team example", username: "team" },
|
||||
]}
|
||||
/>
|
||||
<EventTitle>Quick catch-up</EventTitle>
|
||||
<EventDetails event={mockEvent} />
|
||||
<TooltipProvider>
|
||||
<EventMembers
|
||||
entity={{ name: "entityName" }}
|
||||
profile={{ name: "profileName" }}
|
||||
users={[
|
||||
{ name: "Pro example", username: "pro" },
|
||||
{ name: "Team example", username: "team" },
|
||||
]}
|
||||
/>
|
||||
<EventTitle>Quick catch-up</EventTitle>
|
||||
<EventDetails event={mockEvent} />
|
||||
</TooltipProvider>
|
||||
</div>
|
||||
</VariantRow>
|
||||
</VariantsTable>
|
||||
|
||||
@@ -24,6 +24,11 @@ This component contains an input form to capture a 6-digit verification code, er
|
||||
<Canvas>
|
||||
<Story
|
||||
name="VerifyCodeDialog"
|
||||
parameters={{
|
||||
nextjs: {
|
||||
appDirectory: true,
|
||||
},
|
||||
}}
|
||||
args={{
|
||||
isOpenDialog: true,
|
||||
setIsOpenDialog: () => {},
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
|
||||
import { Canvas, Meta, Story } from "@storybook/addon-docs";
|
||||
import { TooltipProvider } from "@radix-ui/react-tooltip";
|
||||
|
||||
import {
|
||||
Examples,
|
||||
Example,
|
||||
Note,
|
||||
|
||||
Title,
|
||||
CustomArgsTable,
|
||||
VariantsTable,
|
||||
VariantRow,
|
||||
} from "@calcom/storybook/components";
|
||||
|
||||
import { events, blockingDates } from "../_storybookData";
|
||||
import "../styles/styles.css";
|
||||
import { CalendarEvent } from "../types/events";
|
||||
import { Calendar } from "./Calendar";
|
||||
|
||||
<Meta title="UI/Calendar" component={Calendar} />
|
||||
@@ -29,7 +25,7 @@ The Args Table below shows you a breakdown of what props can be passed into the
|
||||
|
||||
There will be a few examples of how to use the Calendar component to show different usecases.
|
||||
|
||||
export const Template = (args) => <Calendar {...args} />;
|
||||
export const Template = (args) => <TooltipProvider><Calendar {...args} /></TooltipProvider>;
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
@@ -74,6 +70,7 @@ export const Template = (args) => <Calendar {...args} />;
|
||||
},
|
||||
}}>
|
||||
{({ ...args }) => (
|
||||
<TooltipProvider>
|
||||
<Calendar
|
||||
{...args}
|
||||
events={events}
|
||||
@@ -81,6 +78,7 @@ export const Template = (args) => <Calendar {...args} />;
|
||||
onEmptyCellClick={(date) => alert(date.toString())}
|
||||
sortEvents
|
||||
/>
|
||||
</TooltipProvider>
|
||||
)}
|
||||
</Story>
|
||||
</Canvas>
|
||||
@@ -53,6 +53,11 @@ The `Dialog` component is composed of the following components:
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Dialog"
|
||||
parameters={{
|
||||
nextjs: {
|
||||
appDirectory: true,
|
||||
},
|
||||
}}
|
||||
args={{
|
||||
title: "Example Dialog",
|
||||
description: "Example Dialog Description",
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { TooltipProvider } from "@radix-ui/react-tooltip";
|
||||
import {
|
||||
Tooltip,
|
||||
} from "@calcom/ui";
|
||||
import { Canvas, Meta, Story } from "@storybook/addon-docs";
|
||||
|
||||
import {
|
||||
|
||||
@@ -46,14 +46,9 @@ describe("Tests for ColorPicker component", () => {
|
||||
render(<ColorPicker defaultValue={defaultValue} onChange={onChange} />);
|
||||
|
||||
const colorInput = screen.getByRole("textbox");
|
||||
await act(async () => {
|
||||
userEvent.clear(colorInput);
|
||||
});
|
||||
await act(async () => userEvent.clear(colorInput));
|
||||
const newColorValue = "#00FF00";
|
||||
await act(async () => {
|
||||
userEvent.type(colorInput, newColorValue);
|
||||
});
|
||||
|
||||
await act(async () => userEvent.type(colorInput, newColorValue));
|
||||
expect(screen.getByRole("button", { name: "pick colors" })).toHaveStyle(
|
||||
`background-color: ${newColorValue}`
|
||||
);
|
||||
|
||||
@@ -27,6 +27,11 @@ To observe the actual step navigation behavior, please refer to the Storybook st
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
parameters={{
|
||||
nextjs: {
|
||||
appDirectory: true,
|
||||
},
|
||||
}}
|
||||
name="Basic"
|
||||
args={{
|
||||
href: "/wizard",
|
||||
|
||||
@@ -22,6 +22,11 @@ Below are the props for `Image uploader`
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
parameters={{
|
||||
nextjs: {
|
||||
appDirectory: true,
|
||||
},
|
||||
}}
|
||||
name="ImageUploader"
|
||||
play={({ canvasElement }) => {
|
||||
const darkVariantContainer = canvasElement.querySelector("#dark-variant");
|
||||
|
||||
@@ -26,7 +26,7 @@ Defines the spacing guide used in Cal.coms design system
|
||||
|
||||
<Examples title="Spacing">
|
||||
<TooltipPrimitive.Provider>
|
||||
<>
|
||||
<div className="flex flex-row gap-6">
|
||||
<Example title="0"></Example>
|
||||
<Example title="px">
|
||||
<Tooltip content="1px">
|
||||
@@ -78,6 +78,6 @@ Defines the spacing guide used in Cal.coms design system
|
||||
<div className="bg-inverted h-4 w-10 rounded-sm"> </div>
|
||||
</Tooltip>
|
||||
</Example>
|
||||
</>
|
||||
</div>
|
||||
</TooltipPrimitive.Provider>
|
||||
</Examples>
|
||||
Reference in new issue
Block a user