1- import { Collapsible , CollapsibleContent , CollapsibleTrigger } from "@radix-ui/react-collapsible" ;
1+ import { Collapsible , CollapsibleContent } from "@radix-ui/react-collapsible" ;
22import classNames from "classnames" ;
33import type { NextRouter } from "next/router" ;
44import { useRouter } from "next/router" ;
@@ -22,7 +22,7 @@ import {
2222 TextField ,
2323 ColorPicker ,
2424} from "@calcom/ui" ;
25- import { FiCode , FiTrello , FiSun , FiArrowLeft , FiChevronRight } from "@calcom/ui/components/icon" ;
25+ import { FiCode , FiTrello , FiSun , FiArrowLeft } from "@calcom/ui/components/icon" ;
2626
2727import Select from "@components/ui/form/Select" ;
2828
@@ -313,7 +313,7 @@ const embeds: {
313313} [ ] = [
314314 {
315315 title : "Inline Embed" ,
316- subtitle : "Loads your Cal scheduling page directly inline with your other website content" ,
316+ subtitle : "Loads your event type directly inline with your other website content. " ,
317317 type : "inline" ,
318318 illustration : (
319319 < svg
@@ -798,7 +798,7 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
798798 }
799799
800800 const ThemeOptions = [
801- { value : Theme . auto , label : "Auto Theme " } ,
801+ { value : Theme . auto , label : "Auto" } ,
802802 { value : Theme . dark , label : "Dark Theme" } ,
803803 { value : Theme . light , label : "Light Theme" } ,
804804 ] ;
@@ -815,67 +815,62 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
815815 ] ;
816816
817817 return (
818- < DialogContent ref = { dialogContentRef } size = "xl" className = "p-0.5" type = "creation" >
818+ < DialogContent
819+ ref = { dialogContentRef }
820+ className = "rounded-lg p-0.5 sm:max-w-[80rem]"
821+ enableOverflow
822+ type = "creation" >
819823 < div className = "flex" >
820824 < div className = "flex w-1/3 flex-col bg-gray-50 p-8" >
821- < h3 className = "mb-2 flex text-xl font-bold leading-6 text-gray-900" id = "modal-title" >
825+ < h3
826+ className = "mb-2.5 flex items-center text-xl font-semibold leading-5 text-gray-900"
827+ id = "modal-title" >
822828 < button
829+ className = "h-6 w-6"
823830 onClick = { ( ) => {
824831 removeQueryParams ( router , [ "embedType" , "embedTabName" ] ) ;
825832 } } >
826833 < FiArrowLeft className = "mr-4 w-4" />
827834 </ button >
828835 { embed . title }
829836 </ h3 >
830- < hr className = { classNames ( "mt-4" , embedType === "element-click" ? "hidden" : "" ) } / >
831- < div className = "flex flex-col overflow-y-auto " >
832- < div className = { classNames ( "mt-4 font-medium" , embedType === "element-click" ? "hidden" : "" ) } >
837+ < h4 className = "mb-6 text-sm font-normal text-gray-500" > { embed . subtitle } </ h4 >
838+ < div className = "flex flex-col" >
839+ < div className = { classNames ( "font-medium" , embedType === "element-click" ? "hidden" : "" ) } >
833840 < Collapsible
834841 open = { isEmbedCustomizationOpen }
835842 onOpenChange = { ( ) => setIsEmbedCustomizationOpen ( ( val ) => ! val ) } >
836- < CollapsibleTrigger
837- type = "button"
838- className = "flex w-full items-center text-base font-medium text-gray-900" >
839- < div >
840- { embedType === "inline"
841- ? "Inline Embed Customization"
842- : embedType === "floating-popup"
843- ? "Floating Popup Customization"
844- : "Element Click Customization" }
845- </ div >
846- < FiChevronRight
847- className = { `${
848- isEmbedCustomizationOpen ? "rotate-90 transform" : ""
849- } ml-auto h-5 w-5 text-gray-500`}
850- />
851- </ CollapsibleTrigger >
852843 < CollapsibleContent className = "text-sm" >
853- < div className = { classNames ( "mt-6" , embedType === "inline" ? "block" : "hidden" ) } >
844+ < div className = { classNames ( embedType === "inline" ? "block" : "hidden" ) } >
854845 { /*TODO: Add Auto/Fixed toggle from Figma */ }
855- < div className = "text-sm" > Embed Window Sizing</ div >
856- < div className = "justify-left flex items-center" >
857- < TextField
858- labelProps = { { className : "hidden" } }
859- required
860- value = { previewState . inline . width }
861- onChange = { ( e ) => {
862- setPreviewState ( ( previewState ) => {
863- const width = e . target . value || "100%" ;
846+ < div className = "mb-[9px] text-sm" > Window sizing</ div >
847+ < div className = "justify-left flex items-center !font-normal" >
848+ < div className = "mr-[9px]" >
849+ < TextField
850+ labelProps = { { className : "hidden" } }
851+ className = "focus:ring-offset-0"
852+ required
853+ value = { previewState . inline . width }
854+ onChange = { ( e ) => {
855+ setPreviewState ( ( previewState ) => {
856+ const width = e . target . value || "100%" ;
857+
858+ return {
859+ ...previewState ,
860+ inline : {
861+ ...previewState . inline ,
862+ width,
863+ } ,
864+ } ;
865+ } ) ;
866+ } }
867+ addOnLeading = { < > W</ > }
868+ />
869+ </ div >
864870
865- return {
866- ...previewState ,
867- inline : {
868- ...previewState . inline ,
869- width,
870- } ,
871- } ;
872- } ) ;
873- } }
874- addOnLeading = { < > W</ > }
875- />
876- < span className = "p-2" > ×</ span >
877871 < TextField
878872 labelProps = { { className : "hidden" } }
873+ className = "focus:ring-offset-0"
879874 value = { previewState . inline . height }
880875 required
881876 onChange = { ( e ) => {
@@ -1007,22 +1002,13 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
10071002 </ CollapsibleContent >
10081003 </ Collapsible >
10091004 </ div >
1010- < hr className = "mt-4" />
1011- < div className = "mt-4 font-medium" >
1005+ < div className = "font-medium" >
10121006 < Collapsible
10131007 open = { isBookingCustomizationOpen }
10141008 onOpenChange = { ( ) => setIsBookingCustomizationOpen ( ( val ) => ! val ) } >
1015- < CollapsibleTrigger className = "flex w-full" type = "button" >
1016- < div className = "text-base font-medium text-gray-900" > Cal Booking Customization</ div >
1017- < FiChevronRight
1018- className = { `${
1019- isBookingCustomizationOpen ? "rotate-90 transform" : ""
1020- } ml-auto h-5 w-5 text-gray-500`}
1021- />
1022- </ CollapsibleTrigger >
10231009 < CollapsibleContent >
10241010 < div className = "mt-6 text-sm" >
1025- < div className = "mb-4 flex items-center justify-start space-x-2 rtl:space-x-reverse" >
1011+ < div className = "mb-6 flex items-center justify-start space-x-2 rtl:space-x-reverse" >
10261012 < Switch
10271013 checked = { previewState . hideEventTypeDetails }
10281014 onCheckedChange = { ( checked ) => {
@@ -1036,28 +1022,6 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
10361022 />
10371023 < div className = "text-sm" > { t ( "hide_eventtype_details" ) } </ div >
10381024 </ div >
1039- < Label className = "" >
1040- < div className = "mb-2" > Theme</ div >
1041- < Select
1042- className = "w-full"
1043- defaultValue = { ThemeOptions [ 0 ] }
1044- components = { {
1045- Control : ThemeSelectControl ,
1046- } }
1047- onChange = { ( option ) => {
1048- if ( ! option ) {
1049- return ;
1050- }
1051- setPreviewState ( ( previewState ) => {
1052- return {
1053- ...previewState ,
1054- theme : option . value ,
1055- } ;
1056- } ) ;
1057- } }
1058- options = { ThemeOptions }
1059- />
1060- </ Label >
10611025 { [
10621026 { name : "brandColor" , title : "Brand Color" } ,
10631027 // { name: "lightColor", title: "Light Color" },
@@ -1066,8 +1030,8 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
10661030 // { name: "highlightColor", title: "Highlight Color" },
10671031 // { name: "medianColor", title: "Median Color" },
10681032 ] . map ( ( palette ) => (
1069- < Label key = { palette . name } className = "pb-4 " >
1070- < div className = "mb-2 pt-2 " > { palette . title } </ div >
1033+ < Label key = { palette . name } className = "mb-6 " >
1034+ < div className = "mb-2" > { palette . title } </ div >
10711035 < div className = "w-full" >
10721036 < ColorPicker
10731037 popoverAlign = "start"
@@ -1082,6 +1046,29 @@ const EmbedTypeCodeAndPreviewDialogContent = ({
10821046 </ div >
10831047 </ Label >
10841048 ) ) }
1049+ < Label >
1050+ < div className = "mb-2" > Theme</ div >
1051+ < Select
1052+ className = "w-full"
1053+ defaultValue = { ThemeOptions [ 0 ] }
1054+ components = { {
1055+ Control : ThemeSelectControl ,
1056+ IndicatorSeparator : ( ) => null ,
1057+ } }
1058+ onChange = { ( option ) => {
1059+ if ( ! option ) {
1060+ return ;
1061+ }
1062+ setPreviewState ( ( previewState ) => {
1063+ return {
1064+ ...previewState ,
1065+ theme : option . value ,
1066+ } ;
1067+ } ) ;
1068+ } }
1069+ options = { ThemeOptions }
1070+ />
1071+ </ Label >
10851072 </ div >
10861073 </ CollapsibleContent >
10871074 </ Collapsible >
0 commit comments