Skip to content

Commit

Permalink
Merge branch 'main' into fix-runStorybook
Browse files Browse the repository at this point in the history
  • Loading branch information
PeerRich committed Aug 31, 2023
2 parents 9ea0e80 + 3f51858 commit 177da90
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 6 deletions.
4 changes: 2 additions & 2 deletions apps/web/public/static/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
"location": "Ort",
"address": "Adresse",
"enter_address": "Geben Sie eine Adresse ein",
"in_person_attendee_address": "In Person (Adresse von Ihnen)",
"in_person_attendee_address": "Vor Ort (Adresse von Ihnen)",
"yes": "Ja",
"no": "Nein",
"additional_notes": "Zusätzliche Notizen",
Expand All @@ -539,7 +539,7 @@
"booking_confirmation": "Bestätigen Sie {{eventTypeTitle}} mit {{profileName}}",
"booking_reschedule_confirmation": "Planen Sie Ihr {{eventTypeTitle}} mit {{profileName}} um",
"in_person_meeting": "Vor-Ort-Termin",
"in_person": "Persönlich (Organisator-Adresse)",
"in_person": "Vor Ort (Organisator-Adresse)",
"link_meeting": "Termin verknüpfen",
"phone_number": "Telefonnummer",
"attendee_phone_number": "Telefonnummer",
Expand Down
4 changes: 2 additions & 2 deletions packages/features/shell/Shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ const NavigationItem: React.FC<{
aria-current={current ? "page" : undefined}>
{item.icon && (
<item.icon
className="mr-2 h-4 w-4 flex-shrink-0 ltr:mr-2 rtl:ml-2 [&[aria-current='page']]:text-inherit"
className="mr-2 h-4 w-4 flex-shrink-0 rtl:ml-2 md:ltr:mx-auto lg:ltr:mr-2 [&[aria-current='page']]:text-inherit"
aria-hidden="true"
aria-current={current ? "page" : undefined}
/>
Expand Down Expand Up @@ -906,7 +906,7 @@ function SideBar({ bannersHeight, user }: SideBarProps) {
<Icon
className={classNames(
"h-4 w-4 flex-shrink-0 [&[aria-current='page']]:text-inherit",
"me-3 md:ltr:mr-2 md:rtl:ml-2"
"me-3 md:mx-auto lg:ltr:mr-2 lg:rtl:ml-2"
)}
aria-hidden="true"
/>
Expand Down
7 changes: 5 additions & 2 deletions packages/ui/components/popover/AnimatedPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ export const AnimatedPopover = ({
) : (
<div className="max-w-36 flex items-center">
<Tooltip content={text}>
<div className="select-none truncate font-medium">
<div className="flex select-none truncate font-medium">
{text}
{count && count > 0 && (
<div className="flex h-4 w-4 items-center justify-center rounded-full">{count}</div>
<div className="text-emphasis flex items-center justify-center rounded-full font-semibold">
<span>&nbsp;</span>
{count}
</div>
)}
</div>
</Tooltip>
Expand Down
138 changes: 138 additions & 0 deletions packages/ui/components/popover/popover.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import { TooltipProvider } from "@radix-ui/react-tooltip";
import { Canvas, Meta, Story } from "@storybook/addon-docs";
import { Fragment } from "react";

import { FilterCheckboxFieldsContainer } from "@calcom/features/filters/components/TeamsFilter";
import {
CustomArgsTable,
Examples,
Example,
Title,
VariantsTable,
VariantRow,
} from "@calcom/storybook/components";
import { Button, CheckboxField } from "@calcom/ui";

import { List, ListItem } from "../list";
import { AnimatedPopover } from "./AnimatedPopover";

<Meta title="UI/Popover" component={AnimatedPopover} />

<Title title="Popover" suffix="Brief" subtitle="Version 1.0 — Last Update: 29 Aug 2023" />

## Definition

The `Popover` component is used to display rich content in a portal.

## Structure

The `Popover` component can be used to display a rich content in a portal.

<CustomArgsTable of={AnimatedPopover} />

## Examples

<Examples>
<Example title="Default">
<TooltipProvider>
<AnimatedPopover text="Go">
<FilterCheckboxFieldsContainer>
{["First", "Second", "Third"]?.map((eventType) => (
<div key={eventType.value} className="items-center hover:bg-muted flex cursor-pointer px-4 py-2">
<CheckboxField
checked={false}
onChange={(e) => {
console.log("changed ", e);
}}
description={eventType}
/>
</div>
))}
</FilterCheckboxFieldsContainer>
</AnimatedPopover>
</TooltipProvider>
</Example>
<Example title="With Trigger">
<TooltipProvider>
<AnimatedPopover text="Go" Trigger={<button>click here</button>}>
<FilterCheckboxFieldsContainer>
{["First", "Second", "Third"]?.map((eventType) => (
<div key={eventType.value} className="items-center hover:bg-muted flex cursor-pointer px-4 py-2">
<CheckboxField
checked={false}
onChange={(e) => {
console.log("changed ", e);
}}
description={eventType}
/>
</div>
))}
</FilterCheckboxFieldsContainer>
</AnimatedPopover>
</TooltipProvider>
</Example>
<Example title="With count">
<TooltipProvider>
<AnimatedPopover text="Go here" count={1}>
<FilterCheckboxFieldsContainer>
{["First", "Second", "Third"]?.map((eventType) => (
<div key={eventType.value} className="items-center hover:bg-muted flex cursor-pointer px-4 py-2">
<CheckboxField
checked={false}
onChange={(e) => {
console.log("changed ", e);
}}
description={eventType}
/>
</div>
))}
</FilterCheckboxFieldsContainer>
</AnimatedPopover>
</TooltipProvider>
</Example>
</Examples>

## Popover Story

<Canvas>
<Story
name="Popover"
args={{
text: "Go",
childrenText: "Here is it",
defaultOpen: false,
}}
argTypes={{
count: {
control: {
type: "number",
},
},
}}>
{({ text, childrenText, count, defaultOpen }) => (
<VariantsTable titles={["Default"]} columnMinWidth={50}>
<VariantRow>
<TooltipProvider>
<AnimatedPopover text={text} count={count} defaultOpen={defaultOpen}>
<FilterCheckboxFieldsContainer>
{["First", "Second", "Third"]?.map((eventType) => (
<div
key={eventType.value}
className="items-center hover:bg-muted flex cursor-pointer px-4 py-2">
<CheckboxField
checked={false}
onChange={(e) => {
console.log("changed ", e);
}}
description={eventType}
/>
</div>
))}
</FilterCheckboxFieldsContainer>
</AnimatedPopover>
</TooltipProvider>
</VariantRow>
</VariantsTable>
)}
</Story>
</Canvas>

0 comments on commit 177da90

Please sign in to comment.