feat: Salesforce Event Type App v3 designs (#21100)
* section component * more section UI * wip * core components styled * all components using sections * match icons to figma * small inputs * fix select small to be the same as small text * center flex rows * enforce inputs to be full spanning grid * tidy up section container for single inputs * fix select and i18n * wip * install available apps * raw heading * app install card * fix app logos width x height * fix gap * match design for other button * fix prop name * push i18n string * fix doc snippets * fix docs * chore: remove yarn.lock changes --------- Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
1 parent
d0e39cf2dd
commit
073faf9e10
14 files changed
+966
-302
No files matched your search
@@ -24,7 +24,7 @@ export const RenderComponentWithSnippet: React.FC<PropsWithChildren<Props>> = (p
|
||||
// },
|
||||
// });
|
||||
return (
|
||||
<div className="border-gray-6 bg-gray-1 rounded-lg border">
|
||||
<div className="border-gray-6 bg-default rounded-lg border">
|
||||
<div className={className("not-prose p-8 xl:p-12", props.className)}>{props.children}</div>
|
||||
|
||||
<div className="bg-gray-3 border-gray-6 flex items-center justify-start border-b border-t p-2">
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
"use client";
|
||||
|
||||
import { RenderComponentWithSnippet } from "@/app/components/render";
|
||||
import { useState } from "react";
|
||||
|
||||
import { Switch } from "@calcom/ui/components/form";
|
||||
import { Section } from "@calcom/ui/components/section";
|
||||
|
||||
export const BasicExample = () => {
|
||||
const [isOpen, setIsOpen] = useState(true);
|
||||
|
||||
return (
|
||||
<RenderComponentWithSnippet>
|
||||
<Section>
|
||||
<Section.Header
|
||||
title="Basic Section"
|
||||
description="This is a basic section with a title and description">
|
||||
<Switch size="sm" checked={isOpen} onCheckedChange={setIsOpen} />
|
||||
</Section.Header>
|
||||
{isOpen && (
|
||||
<Section.Content>
|
||||
<p>This is the main content of the section.</p>
|
||||
</Section.Content>
|
||||
)}
|
||||
</Section>
|
||||
</RenderComponentWithSnippet>
|
||||
);
|
||||
};
|
||||
|
||||
export const BasicExampleSnippet = `
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { Section } from "@calcom/ui/components/section";
|
||||
import { Switch } from "@calcom/ui/components/form";
|
||||
|
||||
const BasicSection = () => {
|
||||
const [isOpen, setIsOpen] = useState(true);
|
||||
|
||||
return (
|
||||
<Section>
|
||||
<Section.Header
|
||||
title="Basic Section"
|
||||
description="This is a basic section with a title and description"
|
||||
>
|
||||
<Section.HeaderRight>
|
||||
<Switch size="sm" checked={isOpen} onCheckedChange={setIsOpen} />
|
||||
</Section.HeaderRight>
|
||||
</Section.Header>
|
||||
{isOpen && (
|
||||
<Section.Content>
|
||||
<p>This is the main content of the section.</p>
|
||||
</Section.Content>
|
||||
)}
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
`;
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
title: Section
|
||||
---
|
||||
import { Section } from "@calcom/ui/components/section"
|
||||
import { RenderComponentWithSnippet } from "@/app/components/render"
|
||||
import { Row } from "@/app/components/row"
|
||||
import { BasicExample } from "./section.basic"
|
||||
import { WithIconExample } from "./section.withIcon"
|
||||
import { SubSectionExample } from "./section.subsection"
|
||||
|
||||
## Basic Usage
|
||||
|
||||
The Section component provides a structured way to organize content with a consistent visual hierarchy. It includes several subcomponents for different parts of the section.
|
||||
|
||||
<BasicExample/>
|
||||
|
||||
## With Icon
|
||||
|
||||
Sections can include an icon in the header to provide visual context.
|
||||
|
||||
<WithIconExample/>
|
||||
|
||||
## SubSections
|
||||
|
||||
Sections can contain subsections for organizing related content in a nested structure.
|
||||
|
||||
<SubSectionExample/>
|
||||
|
||||
## Components
|
||||
|
||||
The Section component is composed of several subcomponents:
|
||||
|
||||
- `Section` - The root container
|
||||
- `Section.Header` - Container for the section header
|
||||
- `Section.Title` - The section title
|
||||
- `Section.Description` - Optional description text
|
||||
- `Section.Content` - The main content area
|
||||
- `Section.SubSection` - A nested section
|
||||
- `Section.SubSectionHeader` - Header for a subsection
|
||||
- `Section.SubSectionContent` - Content area for a subsection
|
||||
@@ -0,0 +1,151 @@
|
||||
"use client";
|
||||
|
||||
import { RenderComponentWithSnippet } from "@/app/components/render";
|
||||
import { useState } from "react";
|
||||
|
||||
import { Input, Switch } from "@calcom/ui/components/form";
|
||||
import { Section } from "@calcom/ui/components/section";
|
||||
|
||||
export const SubSectionExample = () => {
|
||||
const [isMainOpen, setIsMainOpen] = useState(true);
|
||||
const [isFirstSubsectionOpen, setIsFirstSubsectionOpen] = useState(true);
|
||||
const [isSecondSubsectionOpen, setIsSecondSubsectionOpen] = useState(true);
|
||||
|
||||
return (
|
||||
<RenderComponentWithSnippet>
|
||||
<Section>
|
||||
<Section.Header
|
||||
icon="calendar"
|
||||
title="Section with Subsections"
|
||||
description="This section contains nested subsections">
|
||||
<Switch size="sm" checked={isMainOpen} onCheckedChange={setIsMainOpen} />
|
||||
</Section.Header>
|
||||
{isMainOpen && (
|
||||
<Section.Content>
|
||||
<Section.SubSection>
|
||||
<Section.SubSectionHeader icon="zap" title="Automatic Sync (Justify Start)" justify="start">
|
||||
<Switch size="sm" />
|
||||
</Section.SubSectionHeader>
|
||||
</Section.SubSection>
|
||||
<Section.SubSection>
|
||||
<Section.SubSectionHeader icon="user" title="Create new records for guests added">
|
||||
<Switch
|
||||
size="sm"
|
||||
checked={isFirstSubsectionOpen}
|
||||
onCheckedChange={setIsFirstSubsectionOpen}
|
||||
/>
|
||||
</Section.SubSectionHeader>
|
||||
{isFirstSubsectionOpen && (
|
||||
<Section.SubSectionContent>
|
||||
<p>This is the content of the first subsection.</p>
|
||||
</Section.SubSectionContent>
|
||||
)}
|
||||
</Section.SubSection>
|
||||
<Section.SubSection>
|
||||
<Section.SubSectionHeader icon="settings" title="Open Settings">
|
||||
<Switch
|
||||
size="sm"
|
||||
checked={isSecondSubsectionOpen}
|
||||
onCheckedChange={setIsSecondSubsectionOpen}
|
||||
/>
|
||||
</Section.SubSectionHeader>
|
||||
{isSecondSubsectionOpen && (
|
||||
<Section.SubSectionContent>
|
||||
<div className="flex gap-3 px-3 py-1.5">
|
||||
<div className="text-subtle w-full text-sm font-medium">Field Name</div>
|
||||
<div className="text-subtle w-full text-sm font-medium">Field Type</div>
|
||||
<div className="text-subtle w-full text-sm font-medium">Value</div>
|
||||
<div className="text-subtle w-full text-sm font-medium">When to Write</div>
|
||||
</div>
|
||||
<Section.SubSectionNested>
|
||||
<div className="flex gap-3">
|
||||
<Input value="Customer Name" className="w-full" />
|
||||
<Input value="Text" className="w-full" />
|
||||
<Input value="John Doe" className="w-full" />
|
||||
<Input value="On Create" className="w-full" />
|
||||
</div>
|
||||
</Section.SubSectionNested>
|
||||
</Section.SubSectionContent>
|
||||
)}
|
||||
</Section.SubSection>
|
||||
</Section.Content>
|
||||
)}
|
||||
</Section>
|
||||
</RenderComponentWithSnippet>
|
||||
);
|
||||
};
|
||||
|
||||
export const SubSectionExampleSnippet = `
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { Section } from "@calcom/ui/components/section";
|
||||
import { Switch } from "@calcom/ui/components/form";
|
||||
|
||||
const SectionWithSubsections = () => {
|
||||
const [isMainOpen, setIsMainOpen] = useState(true);
|
||||
const [isFirstSubsectionOpen, setIsFirstSubsectionOpen] = useState(true);
|
||||
const [isSecondSubsectionOpen, setIsSecondSubsectionOpen] = useState(true);
|
||||
|
||||
return (
|
||||
<Section>
|
||||
<Section.Header
|
||||
icon="calendar"
|
||||
title="Section with Subsections"
|
||||
description="This section contains nested subsections">
|
||||
<Switch size="sm" checked={isMainOpen} onCheckedChange={setIsMainOpen} />
|
||||
</Section.Header>
|
||||
{isMainOpen && (
|
||||
<Section.Content>
|
||||
<Section.SubSection>
|
||||
<Section.SubSectionHeader icon="zap" title="Automatic Sync (Justify Start)" justify="start">
|
||||
<Switch size="sm" />
|
||||
</Section.SubSectionHeader>
|
||||
</Section.SubSection>
|
||||
<Section.SubSection>
|
||||
<Section.SubSectionHeader icon="user" title="Create new records for guests added">
|
||||
<Switch
|
||||
size="sm"
|
||||
checked={isFirstSubsectionOpen}
|
||||
onCheckedChange={setIsFirstSubsectionOpen}
|
||||
/>
|
||||
</Section.SubSectionHeader>
|
||||
{isFirstSubsectionOpen && (
|
||||
<Section.SubSectionContent>
|
||||
<p>This is the content of the first subsection.</p>
|
||||
</Section.SubSectionContent>
|
||||
)}
|
||||
</Section.SubSection>
|
||||
<Section.SubSection>
|
||||
<Section.SubSectionHeader icon="settings" title="Open Settings">
|
||||
<Switch
|
||||
size="sm"
|
||||
checked={isSecondSubsectionOpen}
|
||||
onCheckedChange={setIsSecondSubsectionOpen}
|
||||
/>
|
||||
</Section.SubSectionHeader>
|
||||
{isSecondSubsectionOpen && (
|
||||
<Section.SubSectionContent>
|
||||
<div className="flex gap-3 px-3 py-1.5">
|
||||
<div className="text-subtle w-full text-sm font-medium">Field Name</div>
|
||||
<div className="text-subtle w-full text-sm font-medium">Field Type</div>
|
||||
<div className="text-subtle w-full text-sm font-medium">Value</div>
|
||||
<div className="text-subtle w-full text-sm font-medium">When to Write</div>
|
||||
</div>
|
||||
<Section.SubSectionNested>
|
||||
<div className="flex gap-3">
|
||||
<Input value="Customer Name" className="w-full" />
|
||||
<Input value="Text" className="w-full" />
|
||||
<Input value="John Doe" className="w-full" />
|
||||
<Input value="On Create" className="w-full" />
|
||||
</div>
|
||||
</Section.SubSectionNested>
|
||||
</Section.SubSectionContent>
|
||||
)}
|
||||
</Section.SubSection>
|
||||
</Section.Content>
|
||||
)}
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
`;
|
||||
@@ -0,0 +1,63 @@
|
||||
"use client";
|
||||
|
||||
import { RenderComponentWithSnippet } from "@/app/components/render";
|
||||
import { useState } from "react";
|
||||
|
||||
import { Switch } from "@calcom/ui/components/form";
|
||||
import { Section } from "@calcom/ui/components/section";
|
||||
|
||||
export const WithIconExample = () => {
|
||||
const [isOpen, setIsOpen] = useState(true);
|
||||
|
||||
return (
|
||||
<RenderComponentWithSnippet>
|
||||
<Section>
|
||||
<Section.Header
|
||||
icon="calendar"
|
||||
title="Section with Icon"
|
||||
description="This section includes an icon in the header. Toggle to see auto-animation.">
|
||||
<Switch size="sm" checked={isOpen} onCheckedChange={setIsOpen} />
|
||||
</Section.Header>
|
||||
{isOpen && (
|
||||
<Section.Content>
|
||||
<p>
|
||||
This section demonstrates how to include an icon in the header and uses FormKit auto-animate for
|
||||
smooth transitions when toggling content visibility.
|
||||
</p>
|
||||
</Section.Content>
|
||||
)}
|
||||
</Section>
|
||||
</RenderComponentWithSnippet>
|
||||
);
|
||||
};
|
||||
|
||||
export const WithIconExampleSnippet = `
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { Section } from "@calcom/ui/components/section";
|
||||
import { Switch } from "@calcom/ui/components/form";
|
||||
|
||||
const SectionWithIcon = () => {
|
||||
const [isOpen, setIsOpen] = useState(true);
|
||||
|
||||
return (
|
||||
<Section>
|
||||
<Section.Header
|
||||
icon="calendar"
|
||||
title="Section with Icon"
|
||||
description="This section includes an icon in the header. Toggle to see auto-animation.">
|
||||
<Switch size="sm" checked={isOpen} onCheckedChange={setIsOpen} />
|
||||
</Section.Header>
|
||||
{isOpen && (
|
||||
<Section.Content>
|
||||
<p>
|
||||
This section demonstrates how to include an icon in the header and uses FormKit auto-animate for
|
||||
smooth transitions when toggling content visibility.
|
||||
</p>
|
||||
</Section.Content>
|
||||
)}
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
`;
|
||||
@@ -2812,6 +2812,7 @@
|
||||
"salesforce_skip_entry_creation": "Skip creating {{entry}} record if they do not exist in Salesforce",
|
||||
"salesforce_if_account_does_not_exist": "If the contact does not exist under an account, create new lead from attendee",
|
||||
"salesforce_create_new_contact_under_account": "Create a new contact under an account based on email domain of attendee and existing contacts",
|
||||
"salesforce_change_record_owner_on_booking":"Change record owner on booking",
|
||||
"mass_assign_attributes": "Mass assign attributes",
|
||||
"reroute_preview_custom_message": "It results in showing custom message. Try changing the response to route to an event",
|
||||
"reroute_preview_external_redirect": "It results in redirecting to {{externalUrl}}. Try changing the response to route to an event",
|
||||
@@ -2908,6 +2909,7 @@
|
||||
"routing_form_insights_assignment_reason": "Assignment Reason",
|
||||
"access_denied": "Access Denied",
|
||||
"salesforce_route_to_owner": "Contact owner will be the Round Robin host if available",
|
||||
"salesforce_add_attendees_as":"Add new attendees as",
|
||||
"salesforce_do_not_route_to_owner": "Contact owner will not be forced (can still be host if it matches the attributes and Round Robin criteria)",
|
||||
"salesforce_route_to_custom_lookup_field": "Route to a user that matches a lookup field on an account",
|
||||
"salesforce_option": "Salesforce Option",
|
||||
|
||||
Reference in new issue
Block a user