Lints calcom/ui

This commit is contained in:
zomars 2023-01-26 17:43:24 -07:00
parent 447a43129a
commit 6c26d779f0
21 changed files with 707 additions and 553 deletions

View File

@ -1,11 +1,21 @@
import { Meta } from '@storybook/addon-docs';
import { Meta } from "@storybook/addon-docs";
<Meta title="Introduction" />
<div className="text-center flex flex-col items-center">
<h1 style={{marginBottom: '24px', marginTop: '36px'}}>Welcome to Cal.com UI</h1>
<p>This is the beginning of our storybook impovments to match Figma as close as possible. Like our Figma library, we will be adding more components as we go along.</p>
<p>Our <a href="https://www.figma.com/file/9MOufQNLtdkpnDucmNX10R/%E2%9D%96-Cal-DS" target="_blank">Figma</a> library is avalible for anyone to view and use. If you have any questions or concerns, please reach out to the design team.</p>
<div className="flex flex-col items-center text-center">
<h1 style={{ marginBottom: "24px", marginTop: "36px" }}>Welcome to Cal.com UI</h1>
<p>
This is the beginning of our storybook impovments to match Figma as close as possible. Like our Figma
library, we will be adding more components as we go along.
</p>
<p>
Our{" "}
<a href="https://www.figma.com/file/9MOufQNLtdkpnDucmNX10R/%E2%9D%96-Cal-DS" target="_blank">
Figma
</a>{" "}
library is avalible for anyone to view and use. If you have any questions or concerns, please reach out to
the design team.
</p>
</div>
<img src="/sb-cover.jpg" />
<img src="/sb-cover.jpg" />

View File

@ -1,53 +1,92 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title, CustomArgsTable, VariantsTable,VariantRow } from '@calcom/storybook/components'
import { Alert } from './Alert';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import { Alert } from "./Alert";
<Meta title="UI/Alert" component={Alert} />
<Title title="Alert" suffix="Brief" subtitle="Version 2.0 — Last Update: 04 jan 2023"/>
<Title title="Alert" suffix="Brief" subtitle="Version 2.0 — Last Update: 04 jan 2023" />
## Definition
Alerts provide time-based feedback to the user after taking an action.
## Structure
Each alert has a state to represent neutral, positive or negative responses.
<CustomArgsTable of={Alert} />
<Examples title="Alert style">
<Example title="Error">
<Alert severity="error" title="Summarise what happened" message="Describe what can be done about it here." />
<Alert
severity="error"
title="Summarise what happened"
message="Describe what can be done about it here."
/>
</Example>
<Example title="Warning">
<Alert severity="warning" title="Summarise what happened" message="Describe what can be done about it here." />
<Alert
severity="warning"
title="Summarise what happened"
message="Describe what can be done about it here."
/>
</Example>
<Example title="With actions">
<Alert
severity="warning"
title="Summarise what happened"
message="Describe what can be done about it here."
actions={<><button>Cancel me</button></>}
/>
actions={
<>
<button>Cancel me</button>
</>
}
/>
</Example>
</Examples>
<Title offset title="Alert" suffix="Variants" />
<Canvas>
<Story
name="Alert">
<VariantsTable titles={['Default']} columnMinWidth={150}>
<Story name="Alert">
<VariantsTable titles={["Default"]} columnMinWidth={150}>
<VariantRow variant="Success">
<Alert severity="success" title="Summarise what happened" message="Describe what can be done about it here." />
<Alert
severity="success"
title="Summarise what happened"
message="Describe what can be done about it here."
/>
</VariantRow>
<VariantRow variant="Warning">
<Alert severity="warning" title="Summarise what happened" message="Describe what can be done about it here." />
<Alert
severity="warning"
title="Summarise what happened"
message="Describe what can be done about it here."
/>
</VariantRow>
<VariantRow variant="Error">
<Alert severity="error" title="Summarise what happened" message="Describe what can be done about it here." />
<Alert
severity="error"
title="Summarise what happened"
message="Describe what can be done about it here."
/>
</VariantRow>
<VariantRow variant="Neutral">
<Alert severity="neutral" title="Summarise what happened" message="Describe what can be done about it here." />
<Alert
severity="neutral"
title="Summarise what happened"
message="Describe what can be done about it here."
/>
</VariantRow>
</VariantsTable>
</Story>

View File

@ -1,7 +1,17 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title, CustomArgsTable, VariantsTable, VariantRow } from '@calcom/storybook/components';
import { AppStoreCategories as Categories } from './Categories';
import { _SBAppCategoryList } from './_storybookData';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import { AppStoreCategories as Categories } from "./Categories";
import { _SBAppCategoryList } from "./_storybookData";
<Meta title="UI/apps/Categories" component={Categories} />

View File

@ -1,18 +1,28 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
import {Avatar} from './Avatar';
import {AvatarGroup} from './AvatarGroup';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import { Avatar } from "./Avatar";
import { AvatarGroup } from "./AvatarGroup";
<Meta title="UI/Avatar" component={Avatar} />
<Title title="Avatar" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022"/>
<Title title="Avatar" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />
## Definition
An avatar group signals that there is more than 1 person associated with an item
## Structure
Avatar group can be composed differently based on the number of user profile.
<CustomArgsTable of={Avatar} />
@ -29,104 +39,110 @@ Avatar group can be composed differently based on the number of user profile.
<ArgsTable of={Avatar} />
### Avatar Group
<ArgsTable of={AvatarGroup} />
<Examples title="Avatar Group ">
<Example title="Small">
<AvatarGroup size="sm" items={[
{
image: "https://cal.com/stakeholder/peer.jpg",
alt: "Peer",
title: "Peer Richelsen",
},
{
image: "https://cal.com/stakeholder/bailey.jpg",
alt: "Bailey",
title: "Bailey Pumfleet",
},
{
image: "https://cal.com/stakeholder/alex-van-andel.jpg",
alt: "Alex",
title: "Alex Van Andel",
},
{
image: "https://cal.com/stakeholder/ciaran.jpg",
alt: "Ciarán",
title: "Ciarán Hanrahan",
},
{
image: "https://cal.com/stakeholder/peer.jpg",
alt: "Peer",
title: "Peer Richelsen",
},
{
image: "https://cal.com/stakeholder/bailey.jpg",
alt: "Bailey",
title: "Bailey Pumfleet",
},
{
image: "https://cal.com/stakeholder/alex-van-andel.jpg",
alt: "Alex",
title: "Alex Van Andel",
},
{
image: "https://cal.com/stakeholder/ciaran.jpg",
alt: "Ciarán",
title: "Ciarán Hanrahan",
},
]}/>
<AvatarGroup
size="sm"
items={[
{
image: "https://cal.com/stakeholder/peer.jpg",
alt: "Peer",
title: "Peer Richelsen",
},
{
image: "https://cal.com/stakeholder/bailey.jpg",
alt: "Bailey",
title: "Bailey Pumfleet",
},
{
image: "https://cal.com/stakeholder/alex-van-andel.jpg",
alt: "Alex",
title: "Alex Van Andel",
},
{
image: "https://cal.com/stakeholder/ciaran.jpg",
alt: "Ciarán",
title: "Ciarán Hanrahan",
},
{
image: "https://cal.com/stakeholder/peer.jpg",
alt: "Peer",
title: "Peer Richelsen",
},
{
image: "https://cal.com/stakeholder/bailey.jpg",
alt: "Bailey",
title: "Bailey Pumfleet",
},
{
image: "https://cal.com/stakeholder/alex-van-andel.jpg",
alt: "Alex",
title: "Alex Van Andel",
},
{
image: "https://cal.com/stakeholder/ciaran.jpg",
alt: "Ciarán",
title: "Ciarán Hanrahan",
},
]}
/>
</Example>
<Example title="large">
<AvatarGroup size="lg" items={[
{
image: "https://cal.com/stakeholder/peer.jpg",
alt: "Peer",
title: "Peer Richelsen",
},
{
image: "https://cal.com/stakeholder/bailey.jpg",
alt: "Bailey",
title: "Bailey Pumfleet",
},
{
image: "https://cal.com/stakeholder/alex-van-andel.jpg",
alt: "Alex",
title: "Alex Van Andel",
},
{
image: "https://cal.com/stakeholder/ciaran.jpg",
alt: "Ciarán",
title: "Ciarán Hanrahan",
},
{
image: "https://cal.com/stakeholder/peer.jpg",
alt: "Peer",
title: "Peer Richelsen",
},
{
image: "https://cal.com/stakeholder/bailey.jpg",
alt: "Bailey",
title: "Bailey Pumfleet",
},
{
image: "https://cal.com/stakeholder/alex-van-andel.jpg",
alt: "Alex",
title: "Alex Van Andel",
},
{
image: "https://cal.com/stakeholder/ciaran.jpg",
alt: "Ciarán",
title: "Ciarán Hanrahan",
},
]}/>
<Example title="large">
<AvatarGroup
size="lg"
items={[
{
image: "https://cal.com/stakeholder/peer.jpg",
alt: "Peer",
title: "Peer Richelsen",
},
{
image: "https://cal.com/stakeholder/bailey.jpg",
alt: "Bailey",
title: "Bailey Pumfleet",
},
{
image: "https://cal.com/stakeholder/alex-van-andel.jpg",
alt: "Alex",
title: "Alex Van Andel",
},
{
image: "https://cal.com/stakeholder/ciaran.jpg",
alt: "Ciarán",
title: "Ciarán Hanrahan",
},
{
image: "https://cal.com/stakeholder/peer.jpg",
alt: "Peer",
title: "Peer Richelsen",
},
{
image: "https://cal.com/stakeholder/bailey.jpg",
alt: "Bailey",
title: "Bailey Pumfleet",
},
{
image: "https://cal.com/stakeholder/alex-van-andel.jpg",
alt: "Alex",
title: "Alex Van Andel",
},
{
image: "https://cal.com/stakeholder/ciaran.jpg",
alt: "Ciarán",
title: "Ciarán Hanrahan",
},
]}
/>
</Example>
</Examples>
<Title offset title="Avatar" suffix="Variants" />
<Canvas>
<Story
name="Avatar">
<VariantsTable titles={['Default']} columnMinWidth={150}>
<Story name="Avatar">
<VariantsTable titles={["Default"]} columnMinWidth={150}>
<VariantRow variant="Sm">
<Avatar size="sm" alt="Avatar Story" gravatarFallbackMd5="Ui@CAL.com" />
</VariantRow>

View File

@ -1,83 +1,60 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable, VariantRow } from '@calcom/storybook/components'
import { FiPlus } from '../icon';
import { Badge } from './Badge';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import { FiPlus } from "../icon";
import { Badge } from "./Badge";
<Meta title="UI/Badge" component={Badge} />
<Title title="Bages" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022"/>
<Title title="Bages" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />
## Definition
Badges are small status descriptors for UI elements. A badge consists of a small circle, typically containing a number or other short set of characters, that appears in proximity to another object. We provide three different type of badge such as status, alert, and brand badge.
Status badge communicate status information. It is generally used within a container such as accordion and tables to label status for easy scanning.
Status badge communicate status information. It is generally used within a container such as accordion and tables to label status for easy scanning.
## Structure
<CustomArgsTable of={Badge} />
<Examples title="Badge style">
<Example title="Gray">
<Badge variant="gray" >Badge text</Badge>
</Example>
<Example title="Green/Success">
<Badge variant="success">Badge text</Badge>
</Example>
<Example title="Orange/Default">
<Badge variant="default">Badge text</Badge>
</Example>
<Example title="Red/Error">
<Badge variant="red">Badge text</Badge>
</Example>
<Example title="Gray" />
<Example title="Green/Success" />
<Example title="Orange/Default" />
<Example title="Red/Error" />
</Examples>
<Examples title="Variants">
<Example title="Default">
<Badge>Button text</Badge>
</Example>
<Example title="With Dot">
<Badge withDot>Button Text</Badge>
</Example>
<Example title="With Icon">
<Badge StartIcon={FiPlus}>Button Text</Badge>
</Example>
<Example title="Default" />
<Example title="With Dot" />
<Example title="With Icon" />
</Examples>
## Alert Badges
## Usage
Alet badge is used in conjunction with an item, profile or label to indicate numeric value and messages assocciated with them.
<Title offset title="Badge" suffix="Variants" />
<Canvas>
<Story name="All Variants">
<VariantsTable titles={['Default','With Dot', 'With Icon']} columnMinWidth={150}>
<VariantRow variant="Default">
<Badge variant="default" >Badge text</Badge>
<Badge variant="default" withDot>Badge text</Badge>
<Badge variant="default" StartIcon={FiPlus}>Badge text</Badge>
</VariantRow>
<VariantRow variant="Success">
<Badge variant="success" >Badge text</Badge>
<Badge variant="success" withDot>Badge text</Badge>
<Badge variant="success" StartIcon={FiPlus}>Badge text</Badge>
</VariantRow>
<VariantRow variant="gray">
<Badge variant="gray" >Badge text</Badge>
<Badge variant="gray" withDot>Badge text</Badge>
<Badge variant="gray" StartIcon={FiPlus}>Badge text</Badge>
</VariantRow>
<VariantRow variant="error">
<Badge variant="error" >Badge text</Badge>
<Badge variant="error" withDot>Badge text</Badge>
<Badge variant="error" StartIcon={FiPlus}>Badge text</Badge>
</VariantRow>
<VariantsTable titles={["Default", "With Dot", "With Icon"]} columnMinWidth={150}>
<VariantRow variant="Default" />
<VariantRow variant="Success" />
<VariantRow variant="gray" />
<VariantRow variant="error" />
</VariantsTable>
</Story>
</Canvas>

View File

@ -1,26 +1,23 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable } from '@calcom/storybook/components'
import { Breadcrumb } from './Breadcrumb';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import { Examples, Example, Note, Title, CustomArgsTable } from "@calcom/storybook/components";
import { Breadcrumb } from "./Breadcrumb";
<Meta title="UI/Breadcrumbs" component={Breadcrumb} />
<Title title="Breadcrumbs" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022"/>
<Title title="Breadcrumbs" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />
## Structure
<CustomArgsTable of={Breadcrumb} />
<Examples title="Breadcrumb style"
>
<Examples title="Breadcrumb style">
<Example title="Primary">
<Breadcrumb>
<BreadcrumbItem href="/">Home</BreadcrumbItem>
<BreadcrumbItem href="/">Test</BreadcrumbItem>
</Breadcrumb>
<Breadcrumb />
</Example>
</Examples>
## Usage
When hovering over the button, there should be a tooltip to explain the context of the button, so the user can understand the result of action.

View File

@ -1,130 +1,121 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title, VariantsTable, VariantColumn, RowTitles, CustomArgsTable} from '@calcom/storybook/components'
import { FiPlus, FiX } from '../icon';
import { Button } from './Button';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
VariantsTable,
VariantColumn,
VariantRow,
RowTitles,
CustomArgsTable,
} from "@calcom/storybook/components";
import { FiPlus, FiX } from "../icon";
import { Button } from "./Button";
<Meta title="UI/Button" component={Button} />
<Title title="Buttons" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022"/>
<Title title="Buttons" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />
## Definition
Button are clickable elements that initiates user actions. Labels in the button guide users to what action will occur when the user interacts with it.
## Structure
<CustomArgsTable of={Button} />
<Examples title="Button style" footnote={
<ul>
<li>Primary: Signals most important actions at any given point in the application.</li>
<li>Secondary: Gives visual weight to actions that are important</li>
<li>Minimal: Used for actions that we want to give very little significane to</li>
</ul>
}>
<Example title="Primary">
<Button className="sb-fake-pseudo--focus">Button text</Button>
</Example>
<Example title="Secondary">
<Button color="secondary">Button text</Button>
</Example>
<Example title="Minimal">
<Button color="minimal">Button text</Button>
</Example>
<Examples
title="Button style"
footnote={
<ul>
<li>Primary: Signals most important actions at any given point in the application.</li>
<li>Secondary: Gives visual weight to actions that are important</li>
<li>Minimal: Used for actions that we want to give very little significane to</li>
</ul>
}>
<Example title="Primary" />
<Example title="Secondary" />
<Example title="Minimal" />
</Examples>
<Examples title="State">
<Example title="Default">
<Button>Button text</Button>
</Example>
<Example title="Hover">
<Button className="sb-pseudo--hover">Button text</Button>
</Example>
<Example title="Focus">
<Button className="sb-pseudo--focus">Button text</Button>
</Example>
<Example title="Disabled">
<Button disabled>Button text</Button>
</Example>
<Example title="Loading">
<Button loading>Button text</Button>
</Example>
<Example title="Default" />
<Example title="Hover" />
<Example title="Focus" />
<Example title="Disabled" />
<Example title="Loading" />
</Examples>
<Examples title="Icons">
<Example title="Default">
<Button>Button text</Button>
</Example>
<Example title="Icon left">
<Button StartIcon={FiPlus}>Button text</Button>
</Example>
<Example title="Icon right">
<Button EndIcon={FiPlus}>Button text</Button>
</Example>
<Example title="Default" />
<Example title="Icon left" />
<Example title="Icon right" />
</Examples>
<Examples title="Icons">
<Example title="Icon Normal">
<Button StartIcon={FiX} variant="icon" size="base" color="minimal"></Button>
<Button StartIcon={FiX} variant="icon" size="base" color="minimal" />
</Example>
<Example title="Icon Small">
<Button StartIcon={FiX} variant="icon" size="sm" color="minimal"></Button>
<Button StartIcon={FiX} variant="icon" size="sm" color="minimal" />
</Example>
<Example title="Icon Loading">
<Button StartIcon={FiX} variant="icon" size="sm" color="minimal" loading></Button>
<Example title="Icon Loading">
<Button StartIcon={FiX} variant="icon" size="sm" color="minimal" loading />
</Example>
</Examples>
## Anatomy
Button are clickable elements that initiates user actions. Labels in the button guide users to what action will occur when the user interacts with it.
## Usage
<Note>In general, there should be only one Primary button in any application context</Note>
<Note>Aim to use maximum 2 words for the button label. Button size can be flexible based on the visual hierarchy and devices. </Note>
<Note>Hover state variant for Mobile button is an option for assistive device.</Note>
<Note />
<Note />
<Note />
<Title offset title="Buttons" suffix="Variants" />
<Canvas>
<Story name="All variants">
<VariantsTable titles={['Primary', 'Secondary', 'Minimal', 'Destructive',"Icon"]} columnMinWidth={150}>
<VariantsTable titles={["Primary", "Secondary", "Minimal", "Destructive", "Icon"]} columnMinWidth={150}>
<VariantRow variant="Default">
<Button>Button text</Button>
<Button color="secondary">Button text</Button>
<Button color="minimal">Button text</Button>
<Button color="destructive">Button text</Button>
<Button color="destructive" variant="icon" StartIcon={FiX}></Button>
<Button />
<Button color="secondary" />
<Button color="minimal" />
<Button color="destructive" />
<Button color="destructive" variant="icon" StartIcon={FiX} />
</VariantRow>
<VariantRow variant="Hover">
<Button className="sb-pseudo--hover">Button text</Button>
<Button className="sb-pseudo--hover" color="secondary">Button text</Button>
<Button className="sb-pseudo--hover" color="minimal">Button text</Button>
<Button className="sb-pseudo--hover" color="destructive">Button text</Button>
<Button className="sb-pseudo--hover" color="destructive" variant="icon" StartIcon={FiX}></Button>
<Button className="sb-pseudo--hover" />
<Button className="sb-pseudo--hover" color="secondary" />
<Button className="sb-pseudo--hover" color="minimal" />
<Button className="sb-pseudo--hover" color="destructive" />
<Button className="sb-pseudo--hover" color="destructive" variant="icon" StartIcon={FiX} />
</VariantRow>
<VariantRow variant="Focus">
<Button className="sb-pseudo--focus">Button text</Button>
<Button className="sb-pseudo--focus" color="secondary">Button text</Button>
<Button className="sb-pseudo--focus" color="minimal">Button text</Button>
<Button className="sb-pseudo--focus" color="destructive">Button text</Button>
<Button className="sb-pseudo--focus" color="destructive" variant="icon" StartIcon={FiX}></Button>
<Button className="sb-pseudo--focus" />
<Button className="sb-pseudo--focus" color="secondary" />
<Button className="sb-pseudo--focus" color="minimal" />
<Button className="sb-pseudo--focus" color="destructive" />
<Button className="sb-pseudo--focus" color="destructive" variant="icon" StartIcon={FiX} />
</VariantRow>
<VariantRow variant="Loading">
<Button loading>Button text</Button>
<Button loading color="secondary">Button text</Button>
<Button loading color="minimal">Button text</Button>
<Button loading color="destructive">Button text</Button>
<Button loading color="destructive" variant="icon" StartIcon={FiX}></Button>
<Button loading />
<Button loading color="secondary" />
<Button loading color="minimal" />
<Button loading color="destructive" />
<Button loading color="destructive" variant="icon" StartIcon={FiX} />
</VariantRow>
<VariantRow variant="Disabled">
<Button disabled>Button text</Button>
<Button disabled color="secondary">Button text</Button>
<Button disabled color="minimal">Button text</Button>
<Button disabled color="destructive">Button text</Button>
<Button disabled color="destructive" variant="icon" StartIcon={FiX}></Button>
<Button disabled />
<Button disabled color="secondary" />
<Button disabled color="minimal" />
<Button disabled color="destructive" />
<Button disabled color="destructive" variant="icon" StartIcon={FiX} />
</VariantRow>
</VariantsTable>
</Story>

View File

@ -1,34 +1,43 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
import { FiTrash, FiNavigation, FiClipboard } from '../icon';
import { ButtonGroup} from './ButtonGroup';
import { Button} from '../button/Button';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import { Button } from "../button/Button";
import { FiTrash, FiNavigation, FiClipboard } from "../icon";
import { ButtonGroup } from "./ButtonGroup";
<Meta title="UI/Button Group" component={ButtonGroup} />
<Title title="Button Group" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022"/>
<Title title="Button Group" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />
## Definition
Button group enables multiple buttons to be combined into a single unit. It offers users access to frequently performed, related actions.
## Structure
<CustomArgsTable of={ButtonGroup} />
<Examples title="Breadcrumb style"
footNote ={
<Examples
title="Breadcrumb style"
footNote={
<ul>
<li>
Seperated: In general, seperated button group style can be included in container such as card, modal, and page.
</li>
<li>
Combined: Combined button group can be used standalone e.g. mini toggles for calendars
Seperated: In general, seperated button group style can be included in container such as card, modal,
and page.
</li>
<li>Combined: Combined button group can be used standalone e.g. mini toggles for calendars</li>
</ul>
}
>
<Example title="Default" >
}>
<Example title="Default">
<ButtonGroup>
<Button StartIcon={FiTrash} variant="icon" color="secondary" />
<Button StartIcon={FiNavigation} variant="icon" color="secondary" />
@ -44,16 +53,14 @@ Button group enables multiple buttons to be combined into a single unit. It offe
</Example>
</Examples>
<Canvas>
<Story
name="All Variatns">
<VariantsTable titles={["Default",'Secondary',"Minimal"]} columnMinWidth={150}>
<Story name="All Variatns">
<VariantsTable titles={["Default", "Secondary", "Minimal"]} columnMinWidth={150}>
<VariantRow variant="Default">
<ButtonGroup>
<Button StartIcon={FiTrash} variant="icon" />
<Button StartIcon={FiNavigation} variant="icon"/>
<Button StartIcon={FiClipboard} variant="icon" />
<Button StartIcon={FiTrash} variant="icon" />
<Button StartIcon={FiNavigation} variant="icon" />
<Button StartIcon={FiClipboard} variant="icon" />
</ButtonGroup>
<ButtonGroup>
<Button StartIcon={FiTrash} variant="icon" color="secondary" />
@ -68,14 +75,14 @@ Button group enables multiple buttons to be combined into a single unit. It offe
</VariantRow>
<VariantRow variant="Combined">
<ButtonGroup combined>
<Button StartIcon={FiTrash} variant="icon" />
<Button StartIcon={FiNavigation} variant="icon" />
<Button StartIcon={FiClipboard} variant="icon" />
<Button StartIcon={FiTrash} variant="icon" />
<Button StartIcon={FiNavigation} variant="icon" />
<Button StartIcon={FiClipboard} variant="icon" />
</ButtonGroup>
<ButtonGroup combined>
<Button StartIcon={FiTrash} variant="icon" color="secondary" />
<Button StartIcon={FiNavigation} variant="icon" color="secondary" />
<Button StartIcon={FiClipboard} variant="icon" color="secondary" />
<ButtonGroup combined>
<Button StartIcon={FiTrash} variant="icon" color="secondary" />
<Button StartIcon={FiNavigation} variant="icon" color="secondary" />
<Button StartIcon={FiClipboard} variant="icon" color="secondary" />
</ButtonGroup>
</VariantRow>
</VariantsTable>

View File

@ -1,39 +1,49 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
import Card from './Card';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import Card from "./Card";
<Meta title="UI/Card" component={Card} />
<Title title="Card" suffix="Brief" subtitle="Version 2.0 — Last Update: 06 Jan 2023"/>
<Title title="Card" suffix="Brief" subtitle="Version 2.0 — Last Update: 06 Jan 2023" />
## Definition
All Cards used in Cal.com
<CustomArgsTable of={Card} />
export const tip = {
id: 1,
thumbnailUrl: "https://img.youtube.com/vi/60HJt8DOVNo/0.jpg",
mediaLink: "https://go.cal.com/dynamic-video",
title: "Dynamic booking links",
description: "Booking link that allows people to quickly schedule meetings.",
href: "https://cal.com/blog/cal-v-1-9",
}
id: 1,
thumbnailUrl: "https://img.youtube.com/vi/60HJt8DOVNo/0.jpg",
mediaLink: "https://go.cal.com/dynamic-video",
title: "Dynamic booking links",
description: "Booking link that allows people to quickly schedule meetings.",
href: "https://cal.com/blog/cal-v-1-9",
};
<Canvas>
<Story name="Card">
<VariantsTable titles={['']} columnMinWidth={150}>
<VariantsTable titles={[""]} columnMinWidth={150}>
<VariantRow variant="Sidebar Card">
<Card
variant="SidebarCard"
thumbnailUrl={tip.thumbnailUrl}
mediaLink={tip.mediaLink}
title={tip.title}
description={tip.description}
learnMore={{ href: tip.href, text: "learn more" }}
actionButton={{ onClick: () => console.log("Clicked") }}
/>
<Card
variant="SidebarCard"
thumbnailUrl={tip.thumbnailUrl}
mediaLink={tip.mediaLink}
title={tip.title}
description={tip.description}
learnMore={{ href: tip.href, text: "learn more" }}
actionButton={{ onClick: () => console.log("Clicked") }}
/>
</VariantRow>
</VariantsTable>
</Story>

View File

@ -1,17 +1,27 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
import Credits from './Credits';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import Credits from "./Credits";
<Meta title="UI/Credits" component={Credits} />
<Title title="Credits" suffix="Brief" subtitle="Version 2.0 — Last Update: 05 jan 2023"/>
<Title title="Credits" suffix="Brief" subtitle="Version 2.0 — Last Update: 05 jan 2023" />
## Definition
Shows the current copy right as well as app version name.
<Canvas>
<Story
name="Credits">
<Story name="Credits">
<VariantsTable titles={[]} columnMinWidth={150}>
<VariantRow variant="Default">
<Credits />

View File

@ -1,17 +1,27 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
import {Divider, VerticalDivider} from './Divider';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import { Divider, VerticalDivider } from "./Divider";
<Meta title="UI/Divider" component={Divider} />
<Title title="Divider" suffix="Brief" subtitle="Version 2.0 — Last Update: 05 jan 2023"/>
<Title title="Divider" suffix="Brief" subtitle="Version 2.0 — Last Update: 05 jan 2023" />
## Definition
Shows the current copy right as well as app version name.
<Canvas>
<Story
name="Divider">
<Story name="Divider">
<VariantsTable titles={[]} columnMinWidth={150}>
<VariantRow variant="Horizontal">
<div className="dark:text-white">

View File

@ -1,19 +1,29 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import { FiCalendar } from "../icon";
import { EmptyScreen } from './EmptyScreen';
import { EmptyScreen } from "./EmptyScreen";
<Meta title="UI/EmptyScreen" component={EmptyScreen} />
<Title title="EmptyScreen" suffix="Brief" subtitle="Version 2.0 — Last Update: 05 jan 2023"/>
<Title title="EmptyScreen" suffix="Brief" subtitle="Version 2.0 — Last Update: 05 jan 2023" />
## Definition
An empty state is where no info/ apps are added to a page with typically content. There must be a text that prompts users to learn more about why they see this state if necessary.
The CTA button can prompt the user to add the info/ apps needed for the page.
<Canvas>
<Story
name="EmptyScreen">
<Story name="EmptyScreen">
<VariantsTable titles={[]} columnMinWidth={150}>
<VariantRow variant="Default">
<EmptyScreen

View File

@ -1,46 +1,56 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
import Checkbox from './Checkbox';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import Checkbox from "./Checkbox";
<Meta title="UI/Form/Checkbox" component={Checkbox} />
<Title title="Checkbox " suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022"/>
<Title title="Checkbox " suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />
## Definition
Checkboxes are used in forms and databases to indicate an answer to a question, apply a batch of settings or allow the user to make a multi-selection from a list. Alternatively, a single checkbox may be used for making single selections
## Structure
<CustomArgsTable of={Checkbox} />
<Examples title="Checkbox style">
<Example title="Default" >
<Checkbox label="Default" />
<Example title="Default">
<Checkbox label="Default" />
</Example>
<Example title="Error" >
<Checkbox label="Error" error/>
<Example title="Error">
<Checkbox label="Error" error />
</Example>
<Example title="Disabled" >
<Checkbox label="Disabled" disabled/>
<Example title="Disabled">
<Checkbox label="Disabled" disabled />
</Example>
<Example title="Disabled" >
<Checkbox label="Disabled Checked" checked disabled />
<Example title="Disabled">
<Checkbox label="Disabled Checked" checked disabled />
</Example>
</Examples>
<Examples title="Description As Label">
<Example title="Default" >
<Checkbox descriptionAsLabel description="Default Description" />
<Example title="Default">
<Checkbox descriptionAsLabel description="Default Description" />
</Example>
<Example title="Error" >
<Checkbox descriptionAsLabel description="Default Description" error/>
<Example title="Error">
<Checkbox descriptionAsLabel description="Default Description" error />
</Example>
<Example title="Disabled" >
<Checkbox descriptionAsLabel description="Default Description" disabled/>
<Example title="Disabled">
<Checkbox descriptionAsLabel description="Default Description" disabled />
</Example>
<Example title="Disabled" >
<Checkbox descriptionAsLabel description="Default Description" disabled checked/>
<Example title="Disabled">
<Checkbox descriptionAsLabel description="Default Description" disabled checked />
</Example>
</Examples>
@ -48,16 +58,16 @@ Checkboxes are used in forms and databases to indicate an answer to a question,
<Story name="Checkbox">
<VariantsTable titles={[""]} columnMinWidth={150}>
<VariantRow variant="Default">
<Checkbox label="Default" />
<Checkbox label="Error" error/>
<Checkbox label="Disabled" disabled/>
<Checkbox label="Disabled Checked" checked disabled />
<Checkbox label="Default" />
<Checkbox label="Error" error />
<Checkbox label="Disabled" disabled />
<Checkbox label="Disabled Checked" checked disabled />
</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/>
<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 />
</VariantRow>
</VariantsTable>
</Story>

View File

@ -1,52 +1,67 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable, VariantRow,VariantsTable} from '@calcom/storybook/components'
import { Select, UnstyledSelect } from "../select";
import { InputFieldWithSelect } from './Input';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {InputField} from "./Input"
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantRow,
VariantsTable,
} from "@calcom/storybook/components";
import { Select, UnstyledSelect } from "../select";
import { InputFieldWithSelect } from "./Input";
import { InputField } from "./Input";
<Meta title="UI/Form/Input Field" component={InputField} />
<Title title="Inputs" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022"/>
<Title title="Inputs" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />
## Definition
Text fields allow users to input and edit text into the product. Usually appear in forms and modals. Various options can be shown with the field to communicate the input requirements.## Structure
## Structure
<CustomArgsTable of={InputField} />
<Examples title="Inputs" footnote={
<ul>
<li>The width is flexible but the height is fixed for both desktop and mobile. </li>
</ul>
}>
<Examples
title="Inputs"
footnote={
<ul>
<li>The width is flexible but the height is fixed for both desktop and mobile. </li>
</ul>
}>
<Example title="Default">
<InputField placeholder="Default"/>
<InputField placeholder="Default" />
</Example>
</Examples>
<Examples title="Input Types">
<Example title="Default">
<InputField placeholder="Default"/>
<InputField placeholder="Default" />
</Example>
<Example title="Prefix">
<InputField placeholder="Prefix" addOnLeading={<>Prefix</>}/>
<InputField placeholder="Prefix" addOnLeading={<>Prefix</>} />
</Example>
<Example title="Suffix">
<InputField placeholder="Suffic" addOnSuffix={<>Suffix</>}/>
<InputField placeholder="Suffic" addOnSuffix={<>Suffix</>} />
</Example>
<Example title="Suffix With Select">
<InputFieldWithSelect placeholder="Suffix" selectProps={{options:[{value:"TEXT",label:"Text"}]}}/>
<InputFieldWithSelect
placeholder="Suffix"
selectProps={{ options: [{ value: "TEXT", label: "Text" }] }}
/>
</Example>
<Example title="Focused">
<InputField placeholder="Focused" className="sb-pseudo--focus"/>
<InputField placeholder="Focused" className="sb-pseudo--focus" />
</Example>
<Example title="Hovered">
<InputField placeholder="Hovered" className="sb-pseudo--hover"/>
<InputField placeholder="Hovered" className="sb-pseudo--hover" />
</Example>
<Example title="Error">
<InputField placeholder="Error" error="Error"/>
<InputField placeholder="Error" error="Error" />
</Example>
</Examples>
@ -55,10 +70,10 @@ Text fields allow users to input and edit text into the product. Usually appear
<InputField />
</Example>
<Example title="Placeholder">
<InputField placeholder="Placeholder"/>
<InputField placeholder="Placeholder" />
</Example>
<Example title="Filled">
<InputField value="Filled"/>
<InputField value="Filled" />
</Example>
</Examples>
@ -66,21 +81,21 @@ Text fields allow users to input and edit text into the product. Usually appear
<Canvas>
<Story name="All Variants">
<VariantsTable titles={['Default','Focused', 'Hovered']} columnMinWidth={150}>
<VariantsTable titles={["Default", "Focused", "Hovered"]} columnMinWidth={150}>
<VariantRow variant="Default">
<InputField placeholder="Default"/>
<InputField placeholder="Focused" className="sb-pseudo--focus"/>
<InputField placeholder="Hovered" className="sb-pseudo--hover"/>
<InputField placeholder="Default" />
<InputField placeholder="Focused" className="sb-pseudo--focus" />
<InputField placeholder="Hovered" className="sb-pseudo--hover" />
</VariantRow>
<VariantRow variant="Prefixed">
<InputField placeholder="Default" addOnLeading={<>Prefix</>}/>
<InputField placeholder="Focused" className="sb-pseudo--focus" addOnLeading={<>Prefix</>}/>
<InputField placeholder="Hovered" className="sb-pseudo--hover" addOnLeading={<>Prefix</>}/>
<InputField placeholder="Default" addOnLeading={<>Prefix</>} />
<InputField placeholder="Focused" className="sb-pseudo--focus" addOnLeading={<>Prefix</>} />
<InputField placeholder="Hovered" className="sb-pseudo--hover" addOnLeading={<>Prefix</>} />
</VariantRow>
<VariantRow variant="Suffix">
<InputField placeholder="Default" addOnSuffix={<>Prefix</>}/>
<InputField placeholder="Focused" className="sb-pseudo--focus" addOnSuffix={<>Prefix</>}/>
<InputField placeholder="Hovered" className="sb-pseudo--hover" addOnSuffix={<>Prefix</>}/>
<InputField placeholder="Default" addOnSuffix={<>Prefix</>} />
<InputField placeholder="Focused" className="sb-pseudo--focus" addOnSuffix={<>Prefix</>} />
<InputField placeholder="Hovered" className="sb-pseudo--hover" addOnSuffix={<>Prefix</>} />
</VariantRow>
</VariantsTable>
</Story>

View File

@ -1,102 +1,89 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable, VariantRow,VariantsTable} from '@calcom/storybook/components'
import { FiPlus } from "../icon";
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {SelectField} from "./Select"
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantRow,
VariantsTable,
} from "@calcom/storybook/components";
import { FiPlus } from "../icon";
import { SelectField } from "./Select";
<Meta title="UI/Form/Select Field" component={SelectField} />
<Title title="Select" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022"/>
<Title title="Select" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />
## Definition
Dropdown fields allow users to input existing options that is preset by the deisgner/ developer. It can be just one choice per field, or they might be multiple choices depends on the circumstances.
## Structure
<CustomArgsTable of={SelectField} />
export const options = [
{ value: 0, label: "Option One" },
{ value: 1, label: "Option Two" },
{ value: 0, label: "Option One" },
{ value: 1, label: "Option Two" },
];
## Examples
<Examples title=" Single Selected / Unselected" footnote={
<ul>
<li>The difference between the types are when they are filled. </li>
</ul>
}>
<Examples
title=" Single Selected / Unselected"
footnote={
<ul>
<li>The difference between the types are when they are filled. </li>
</ul>
}>
<Example title="Single Select [Unselected]">
<SelectField
label={"Single Select"}
options={options}
/>
<SelectField label="Single Select" options={options} />
</Example>
<Example title="Single Select [Selected]">
<SelectField
label={"Single Select"}
options={options}
defaultValue={options[0]}
/>
<Example title="Single Select [Selected]">
<SelectField label="Single Select" options={options} defaultValue={options[0]} />
</Example>
<Example title="Multi Select [Unselected]">
<SelectField
label={"Multi Select"}
options={options}
isMulti={true}
/>
<SelectField label="Multi Select" options={options} isMulti={true} />
</Example>
<Example title="Multi Select [Selected]">
<SelectField
label={"Multi Select"}
options={options}
isMulti={true}
defaultValue={options[0]}
/>
<SelectField label="Multi Select" options={options} isMulti={true} defaultValue={options[0]} />
</Example>
</Examples>
<Examples title="Variants">
<Example title="Default">
<SelectField
label={"Default Select"}
options={options}/>
</Example>
<Example title="Icon Left">
WIP
{/* <SelectField options={options} components={{ Control }}/> */}
<SelectField label="Default Select" options={options} />
</Example>
<Example title="Icon Left" />
</Examples>
## Variant Caviats (WIP) - To be updated
Using Icons is a bit of a strange one cause you can't simpily pass in an icon as a prop. You have to pass in a component. To the select field.
```js
// Bad: Inline declaration will cause remounting issues
const BadSelect = props => (
<Select {...props} components={{
Control: ({ children, ...rest }) => (
<components.Control {...rest}>
👎 {children}
</components.Control>
)}}
const BadSelect = (props) => (
<Select
{...props}
components={{
Control: ({ children, ...rest }) => <components.Control {...rest}>👎 {children}</components.Control>,
}}
/>
)
);
// Good: Custom component declared outside of the Select scope
const Control = <IconLeading icon={FiPlus}/>
const GoodSelect = props => <Select {...props} components={{ Control }} />
const Control = <IconLeading icon={FiPlus} />;
const GoodSelect = (props) => <Select {...props} components={{ Control }} />;
```
<Examples title="States ">
<Example title="Default">
<SelectField options={options} label={"Default Select"}/>
<SelectField options={options} label="Default Select" />
</Example>
{/* <Example title="Hover">
<SelectField options={options} className="sb-pseudo--hover"/>
@ -106,10 +93,10 @@ const GoodSelect = props => <Select {...props} components={{ Control }} />
</Example> */}
</Examples>
## Select Story
<Canvas>
<Story name="Default">
<SelectField options={options} label={"Default Select"}/>
<SelectField options={options} label="Default Select" />
</Story>
</Canvas>

View File

@ -1,21 +1,29 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
import { List, ListItem } from './List';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import { List, ListItem } from "./List";
<Meta title="UI/List" component={List} />
<Title title="List" suffix="Brief" subtitle="Version 2.0 — Last Update: 05 jan 2023"/>
<Title title="List" suffix="Brief" subtitle="Version 2.0 — Last Update: 05 jan 2023" />
## Definition
Sums it up nicely.
<Canvas>
<Story
name="List">
<Story name="List">
<VariantsTable titles={[]} columnMinWidth={150}>
<VariantRow variant="Default">
TODO!
</VariantRow>
<VariantRow variant="Default" />
</VariantsTable>
</Story>
</Canvas>

View File

@ -1,24 +1,35 @@
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';
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"/>
<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}>
<VariantsTable titles={[""]} columnMinWidth={150}>
<VariantRow variant="Small">
<Logo small />
</VariantRow>
<VariantRow variant="Default">
<Logo />
<Logo />
</VariantRow>
</VariantsTable>
</Story>

View File

@ -1,35 +1,44 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title, VariantsTable, VariantColumn, RowTitles, CustomArgsTable} from '@calcom/storybook/components'
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import { Skeleton, SkeletonAvatar, SkeletonText, SkeletonButton, SkeletonContainer } from './';
import {
Examples,
Example,
Note,
Title,
VariantsTable,
VariantColumn,
RowTitles,
CustomArgsTable,
} from "@calcom/storybook/components";
import { Skeleton, SkeletonAvatar, SkeletonText, SkeletonButton, SkeletonContainer } from "./";
<Meta title="UI/Skeleton" component={Skeleton} />
<Title title="Skeleton" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022"/>
<Title title="Skeleton" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />
## Definition
Skeletons are used as a placeholder to the content while the content is being loaded. It is used to improve the user experience by providing a visual cue that the content is loading.
## Structure
<CustomArgsTable of={Skeleton} />
<Examples title="Skeleton Avatar" >
<Examples title="Skeleton Avatar">
<Example title="Primary">
<SkeletonAvatar className="h-8 w-8" />
</Example>
</Examples>
<Examples title="Skeleton Text" >
<Examples title="Skeleton Text">
<Example title="Primary">
<SkeletonText className="h-4 w-32"/>
<SkeletonText className="h-4 w-32" />
</Example>
</Examples>
<Examples title="Skeleton Button" >
<Examples title="Skeleton Button">
<Example title="Primary">
<SkeletonButton className="h-8 w-32"/>
<SkeletonButton className="h-8 w-32" />
</Example>
</Examples>

View File

@ -1,32 +1,41 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title, VariantsTable, VariantColumn, RowTitles, CustomArgsTable} from '@calcom/storybook/components'
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import { SuccessToast,ErrorToast,WarningToast,DefaultToast } from './';
import {
Examples,
Example,
Note,
Title,
VariantsTable,
VariantColumn,
RowTitles,
CustomArgsTable,
} from "@calcom/storybook/components";
import { SuccessToast, ErrorToast, WarningToast, DefaultToast } from "./";
<Meta title="UI/Toasts" component={DefaultToast} />
<Title title="Toasts" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022"/>
<Title title="Toasts" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />
## Definition
Toasts are used to show an action has had a impact. If a user submits a form a toast should be shown to notify the user there has been a success
## Structure
<CustomArgsTable of={DefaultToast} />
<Examples title="Toasts" >
<Examples title="Toasts">
<Example title="Default">
<DefaultToast message="Default Toast" toastVisible={true}/>
<DefaultToast message="Default Toast" toastVisible={true} />
</Example>
<Example title="Success">
<SuccessToast message="Success Toast" toastVisible={true}/>
<SuccessToast message="Success Toast" toastVisible={true} />
</Example>
<Example title="Warning">
<WarningToast message="Warning Toast" toastVisible={true}/>
<WarningToast message="Warning Toast" toastVisible={true} />
</Example>
<Example title="Error">
<ErrorToast message="Error Toast" toastVisible={true}/>
<ErrorToast message="Error Toast" toastVisible={true} />
</Example>
</Examples>

View File

@ -1,32 +1,40 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable,VariantRow } from '@calcom/storybook/components'
import { TooltipProvider } from "@radix-ui/react-tooltip";
import Tooltip from './Tooltip';
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import Tooltip from "./Tooltip";
<Meta title="UI/Tooltip" component={Tooltip} />
<Title title="Tooltip" suffix="Brief" subtitle="Version 2.0 — Last Update: 06 Jan 2023"/>
<Title title="Tooltip" suffix="Brief" subtitle="Version 2.0 — Last Update: 06 Jan 2023" />
## Definition
Tooltip components can be used to provide additional information about an element when the user hovers over or focuses on the element.
<CustomArgsTable of={Tooltip} />
<Canvas>
<Story name="Tooltip">
<TooltipProvider>
<VariantsTable titles={['']} columnMinWidth={150}>
<VariantsTable titles={[""]} columnMinWidth={150}>
<VariantRow variant="Default">
<Tooltip content="Copy to clipboard">
<span
className="dark:text-darkgray-50 p-2 bg-brand-500 rounded-md text-gray-100 dark:bg-darkgray-900 hover:cursor-pointer"
className="dark:text-darkgray-50 bg-brand-500 dark:bg-darkgray-900 rounded-md p-2 text-gray-100 hover:cursor-pointer"
onClick={() => {
alert('Copied!');
}}>
Hover Me
</span>
alert("Copied!");
}}
/>
</Tooltip>
</VariantRow>
</VariantsTable>

View File

@ -1,64 +1,74 @@
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
import { Examples, Example, Note, Title,CustomArgsTable,VariantsTable, VariantRow } from '@calcom/storybook/components'
import { TopBanner } from './TopBanner'
import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs";
import {
Examples,
Example,
Note,
Title,
CustomArgsTable,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import { TopBanner } from "./TopBanner";
<Meta title="UI/TopBanner" component={TopBanner} />
<Title title="TopBanner" suffix="Brief" />
## Definition
Top banner will be position on the very top of the page to communicate on whats wrong or whats new.
## Structure
Each toast has a state to represent neutral, positive or negative responses.
<CustomArgsTable of={TopBanner} />
<Examples title="Top Banner Style">
<Example title="Default" isFullWidth={true} >
<TopBanner
actions={
<button
className="border-b border-black text-sm"
onClick={() => {
console.log("test");
}}>
Action
</button>
}
text="Something big is happening we want you to know about."
/>
</Example>
<Example title="Warning" isFullWidth={true} >
<Example title="Default" isFullWidth={true}>
<TopBanner
actions={
<button
className="border-b border-black text-sm"
onClick={() => {
console.log("test");
}}>
Action
</button>
}
variant="warning"
text="An app wide warning is occuring that should be resolved."
/>
</Example>
<Example title="Error" isFullWidth={true} >
actions={
<button
className="border-b border-black text-sm"
onClick={() => {
console.log("test");
}}>
Action
</button>
}
text="Something big is happening we want you to know about."
/>
</Example>
<Example title="Warning" isFullWidth={true}>
<TopBanner
actions={
<button
className="border-b border-black text-sm"
onClick={() => {
console.log("test");
}}>
Action
</button>
}
variant="error"
text="A major error is occuring that must be resolved."
/>
</Example>
actions={
<button
className="border-b border-black text-sm"
onClick={() => {
console.log("test");
}}>
Action
</button>
}
variant="warning"
text="An app wide warning is occuring that should be resolved."
/>
</Example>
<Example title="Error" isFullWidth={true}>
<TopBanner
actions={
<button
className="border-b border-black text-sm"
onClick={() => {
console.log("test");
}}>
Action
</button>
}
variant="error"
text="A major error is occuring that must be resolved."
/>
</Example>
</Examples>