Compare commits
5 Commits
main
...
gh-readonl
Author | SHA1 | Date | |
---|---|---|---|
|
c3843472ce | ||
|
04a8c60aaa | ||
|
61e524e4e4 | ||
|
7a06020659 | ||
|
7c7efaf427 |
|
@ -0,0 +1,21 @@
|
||||||
|
name: "Validate PRs"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- edited
|
||||||
|
- synchronize
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate-pr:
|
||||||
|
name: Validate PR title
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: amannn/action-semantic-pull-request@v5
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -238,20 +238,34 @@ function EventTypeSingleLayout({
|
||||||
<div className="flex items-center justify-end">
|
<div className="flex items-center justify-end">
|
||||||
{!eventType.metadata.managedEventConfig && (
|
{!eventType.metadata.managedEventConfig && (
|
||||||
<>
|
<>
|
||||||
<div className="sm:hover:bg-muted hidden items-center rounded-md px-2 lg:flex">
|
<div
|
||||||
<Skeleton
|
className={classNames(
|
||||||
as={Label}
|
"sm:hover:bg-muted hidden cursor-pointer items-center rounded-md",
|
||||||
htmlFor="hiddenSwitch"
|
formMethods.watch("hidden") ? "px-2" : "",
|
||||||
className="mt-2 hidden cursor-pointer self-center whitespace-nowrap pr-2 sm:inline">
|
"lg:flex"
|
||||||
{t("hide_from_profile")}
|
)}>
|
||||||
</Skeleton>
|
{formMethods.watch("hidden") && (
|
||||||
<Switch
|
<Skeleton
|
||||||
id="hiddenSwitch"
|
as={Label}
|
||||||
checked={formMethods.watch("hidden")}
|
htmlFor="hiddenSwitch"
|
||||||
onCheckedChange={(e) => {
|
className="mt-2 hidden cursor-pointer self-center whitespace-nowrap pr-2 sm:inline">
|
||||||
formMethods.setValue("hidden", e);
|
{t("hidden")}
|
||||||
}}
|
</Skeleton>
|
||||||
/>
|
)}
|
||||||
|
<Tooltip
|
||||||
|
content={
|
||||||
|
formMethods.watch("hidden") ? t("show_eventtype_on_profile") : t("hide_from_profile")
|
||||||
|
}>
|
||||||
|
<div className="self-center rounded-md p-2">
|
||||||
|
<Switch
|
||||||
|
id="hiddenSwitch"
|
||||||
|
checked={!formMethods.watch("hidden")}
|
||||||
|
onCheckedChange={(e) => {
|
||||||
|
formMethods.setValue("hidden", !e);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<VerticalDivider className="hidden lg:block" />
|
<VerticalDivider className="hidden lg:block" />
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -109,6 +109,7 @@
|
||||||
"react-intl": "^5.25.1",
|
"react-intl": "^5.25.1",
|
||||||
"react-live-chat-loader": "^2.7.3",
|
"react-live-chat-loader": "^2.7.3",
|
||||||
"react-multi-email": "^0.5.3",
|
"react-multi-email": "^0.5.3",
|
||||||
|
"react-phone-input-2": "^2.15.1",
|
||||||
"react-phone-number-input": "^3.2.7",
|
"react-phone-number-input": "^3.2.7",
|
||||||
"react-schemaorg": "^2.0.0",
|
"react-schemaorg": "^2.0.0",
|
||||||
"react-select": "^5.7.0",
|
"react-select": "^5.7.0",
|
||||||
|
|
|
@ -416,7 +416,8 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
|
||||||
{!isManagedEventType && (
|
{!isManagedEventType && (
|
||||||
<>
|
<>
|
||||||
{type.hidden && <Badge variant="gray">{t("hidden")}</Badge>}
|
{type.hidden && <Badge variant="gray">{t("hidden")}</Badge>}
|
||||||
<Tooltip content={t("show_eventtype_on_profile")}>
|
<Tooltip
|
||||||
|
content={type.hidden ? t("show_eventtype_on_profile") : t("hide_from_profile")}>
|
||||||
<div className="self-center rounded-md p-2">
|
<div className="self-center rounded-md p-2">
|
||||||
<Switch
|
<Switch
|
||||||
name="Hidden"
|
name="Hidden"
|
||||||
|
|
|
@ -179,7 +179,7 @@ html.todesktop-platform-darwin.light main.bg-default{
|
||||||
background: rgba(255,255,255,0.8) !important
|
background: rgba(255,255,255,0.8) !important
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
html.todesktop aside a {
|
html.todesktop aside a {
|
||||||
height: 28px;
|
height: 28px;
|
||||||
padding: 0px 8px;
|
padding: 0px 8px;
|
||||||
|
@ -497,4 +497,16 @@ select:focus {
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.react-tel-input .country-list .country:hover,
|
||||||
|
.react-tel-input .country-list .country.highlight {
|
||||||
|
@apply !bg-emphasis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.react-tel-input .flag-dropdown .selected-flag,
|
||||||
|
.react-tel-input .flag-dropdown.open .selected-flag {
|
||||||
|
@apply !bg-default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.react-tel-input .flag-dropdown {
|
||||||
|
@apply !border-r-default !border-y-0 !border-l-0 left-0.5;
|
||||||
|
}
|
||||||
|
|
|
@ -129,7 +129,7 @@ function NumberWidget({ value, setValue, ...remainingProps }: TextLikeComponentP
|
||||||
type="number"
|
type="number"
|
||||||
labelSrOnly={remainingProps.noLabel}
|
labelSrOnly={remainingProps.noLabel}
|
||||||
containerClassName="w-full"
|
containerClassName="w-full"
|
||||||
className="focus:border-brand-default bg-default dark:bg-muted border-default disabled:bg-emphasis focus:ring-brand block w-full rounded-md text-sm disabled:hover:cursor-not-allowed"
|
className="bg-default border-default disabled:bg-emphasis focus:ring-brand-default dark:focus:border-emphasis block w-full rounded-md text-sm focus:border-neutral-300 disabled:hover:cursor-not-allowed"
|
||||||
value={value}
|
value={value}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setValue(e.target.value);
|
setValue(e.target.value);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
The Cal.com Enterprise Edition (EE) license (the “EE License”)
|
The Cal.com Commercial License (EE) license (the “EE License”)
|
||||||
Copyright (c) 2020-present Cal.com, Inc
|
Copyright (c) 2020-present Cal.com, Inc
|
||||||
|
|
||||||
With regard to the Cal.com Software:
|
With regard to the Cal.com Software:
|
||||||
|
@ -8,7 +8,7 @@ used in production, if you (and any entity that you represent) have agreed to,
|
||||||
and are in compliance with, the Cal.com Subscription Terms available
|
and are in compliance with, the Cal.com Subscription Terms available
|
||||||
at https://cal.com/terms (the “EE Terms”), or other agreements governing
|
at https://cal.com/terms (the “EE Terms”), or other agreements governing
|
||||||
the use of the Software, as mutually agreed by you and Cal.com, Inc ("Cal.com"),
|
the use of the Software, as mutually agreed by you and Cal.com, Inc ("Cal.com"),
|
||||||
and otherwise have a valid Cal.com Enterprise Edition subscription ("EE Subscription")
|
and otherwise have a valid Cal.com Commercial License subscription ("EE Subscription")
|
||||||
for the correct number of hosts as defined in the EE Terms ("Hosts"). Subject to the foregoing sentence,
|
for the correct number of hosts as defined in the EE Terms ("Hosts"). Subject to the foregoing sentence,
|
||||||
you are free to modify this Software and publish patches to the Software. You agree
|
you are free to modify this Software and publish patches to the Software. You agree
|
||||||
that Cal.com and/or its licensors (as applicable) retain all right, title and interest in
|
that Cal.com and/or its licensors (as applicable) retain all right, title and interest in
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dx": "docker compose up -d"
|
"dx": "docker compose up -d || docker-compose up -d"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@calcom/dayjs": "*",
|
"@calcom/dayjs": "*",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
The Cal.com Enterprise Edition (EE) license (the “EE License”)
|
The Cal.com Commercial License (EE) license (the “EE License”)
|
||||||
Copyright (c) 2020-present Cal.com, Inc
|
Copyright (c) 2020-present Cal.com, Inc
|
||||||
|
|
||||||
With regard to the Cal.com Software:
|
With regard to the Cal.com Software:
|
||||||
|
@ -8,7 +8,7 @@ used in production, if you (and any entity that you represent) have agreed to,
|
||||||
and are in compliance with, the Cal.com Subscription Terms available
|
and are in compliance with, the Cal.com Subscription Terms available
|
||||||
at https://cal.com/terms (the “EE Terms”), or other agreements governing
|
at https://cal.com/terms (the “EE Terms”), or other agreements governing
|
||||||
the use of the Software, as mutually agreed by you and Cal.com, Inc ("Cal.com"),
|
the use of the Software, as mutually agreed by you and Cal.com, Inc ("Cal.com"),
|
||||||
and otherwise have a valid Cal.com Enterprise Edition subscription ("EE Subscription")
|
and otherwise have a valid Cal.com Commercial License subscription ("EE Subscription")
|
||||||
for the correct number of hosts as defined in the EE Terms ("Hosts"). Subject to the foregoing sentence,
|
for the correct number of hosts as defined in the EE Terms ("Hosts"). Subject to the foregoing sentence,
|
||||||
you are free to modify this Software and publish patches to the Software. You agree
|
you are free to modify this Software and publish patches to the Software. You agree
|
||||||
that Cal.com and/or its licensors (as applicable) retain all right, title and interest in
|
that Cal.com and/or its licensors (as applicable) retain all right, title and interest in
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
The Cal.com Enterprise Edition (EE) license (the “EE License”)
|
The Cal.com Commercial License (EE) license (the “EE License”)
|
||||||
Copyright (c) 2020-present Cal.com, Inc
|
Copyright (c) 2020-present Cal.com, Inc
|
||||||
|
|
||||||
With regard to the Cal.com Software:
|
With regard to the Cal.com Software:
|
||||||
|
@ -8,7 +8,7 @@ used in production, if you (and any entity that you represent) have agreed to,
|
||||||
and are in compliance with, the Cal.com Subscription Terms available
|
and are in compliance with, the Cal.com Subscription Terms available
|
||||||
at https://cal.com/terms (the “EE Terms”), or other agreements governing
|
at https://cal.com/terms (the “EE Terms”), or other agreements governing
|
||||||
the use of the Software, as mutually agreed by you and Cal.com, Inc ("Cal.com"),
|
the use of the Software, as mutually agreed by you and Cal.com, Inc ("Cal.com"),
|
||||||
and otherwise have a valid Cal.com Enterprise Edition subscription ("EE Subscription")
|
and otherwise have a valid Cal.com Commercial License subscription ("EE Subscription")
|
||||||
for the correct number of hosts as defined in the EE Terms ("Hosts"). Subject to the foregoing sentence,
|
for the correct number of hosts as defined in the EE Terms ("Hosts"). Subject to the foregoing sentence,
|
||||||
you are free to modify this Software and publish patches to the Software. You agree
|
you are free to modify this Software and publish patches to the Software. You agree
|
||||||
that Cal.com and/or its licensors (as applicable) retain all right, title and interest in
|
that Cal.com and/or its licensors (as applicable) retain all right, title and interest in
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
The Cal.com Enterprise Edition (EE) license (the “EE License”)
|
The Cal.com Commercial License (EE) license (the “EE License”)
|
||||||
Copyright (c) 2020-present Cal.com, Inc
|
Copyright (c) 2020-present Cal.com, Inc
|
||||||
|
|
||||||
With regard to the Cal.com Software:
|
With regard to the Cal.com Software:
|
||||||
|
@ -8,7 +8,7 @@ used in production, if you (and any entity that you represent) have agreed to,
|
||||||
and are in compliance with, the Cal.com Subscription Terms available
|
and are in compliance with, the Cal.com Subscription Terms available
|
||||||
at https://cal.com/terms (the “EE Terms”), or other agreements governing
|
at https://cal.com/terms (the “EE Terms”), or other agreements governing
|
||||||
the use of the Software, as mutually agreed by you and Cal.com, Inc ("Cal.com"),
|
the use of the Software, as mutually agreed by you and Cal.com, Inc ("Cal.com"),
|
||||||
and otherwise have a valid Cal.com Enterprise Edition subscription ("EE Subscription")
|
and otherwise have a valid Cal.com Commercial License subscription ("EE Subscription")
|
||||||
for the correct number of hosts as defined in the EE Terms ("Hosts"). Subject to the foregoing sentence,
|
for the correct number of hosts as defined in the EE Terms ("Hosts"). Subject to the foregoing sentence,
|
||||||
you are free to modify this Software and publish patches to the Software. You agree
|
you are free to modify this Software and publish patches to the Software. You agree
|
||||||
that Cal.com and/or its licensors (as applicable) retain all right, title and interest in
|
that Cal.com and/or its licensors (as applicable) retain all right, title and interest in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@calcom/ee",
|
"name": "@calcom/ee",
|
||||||
"description": "Cal.com Enterprise Edition features",
|
"description": "Cal.com Commercial License features",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "See license in LICENSE",
|
"license": "See license in LICENSE",
|
||||||
|
|
|
@ -134,7 +134,7 @@ export const Components: Record<BookingFieldType, Component> = {
|
||||||
const { t } = useLocale();
|
const { t } = useLocale();
|
||||||
value = value || [];
|
value = value || [];
|
||||||
const inputClassName =
|
const inputClassName =
|
||||||
"dark:placeholder:text-darkgray-600 focus:border-brand-default border-subtle block w-full rounded-md border-default text-sm focus:ring-black disabled:bg-emphasis disabled:hover:cursor-not-allowed dark:bg-transparent dark:selection:bg-green-500 disabled:dark:text-subtle";
|
"dark:placeholder:text-muted focus:border-emphasis border-subtle block w-full rounded-md border-default text-sm focus:ring-black disabled:bg-emphasis disabled:hover:cursor-not-allowed dark:selection:bg-green-500 disabled:dark:text-subtle bg-default";
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{value.length ? (
|
{value.length ? (
|
||||||
|
@ -148,11 +148,11 @@ export const Components: Record<BookingFieldType, Component> = {
|
||||||
<EmailField
|
<EmailField
|
||||||
disabled={readOnly}
|
disabled={readOnly}
|
||||||
value={value[index]}
|
value={value[index]}
|
||||||
|
className={inputClassName}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
value[index] = e.target.value;
|
value[index] = e.target.value;
|
||||||
setValue(value);
|
setValue(value);
|
||||||
}}
|
}}
|
||||||
className={inputClassName}
|
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
label={<></>}
|
label={<></>}
|
||||||
required
|
required
|
||||||
|
@ -251,7 +251,7 @@ export const Components: Record<BookingFieldType, Component> = {
|
||||||
}
|
}
|
||||||
setValue(newValue);
|
setValue(newValue);
|
||||||
}}
|
}}
|
||||||
className="dark:bg-darkgray-300 border-subtle text-emphasis h-4 w-4 rounded focus:ring-black ltr:mr-2 rtl:ml-2"
|
className="border-default dark:border-default hover:bg-subtle checked:hover:bg-brand-default checked:bg-brand-default dark:checked:bg-brand-default dark:bg-darkgray-100 dark:hover:bg-subtle dark:checked:hover:bg-brand-default h-4 w-4 cursor-pointer rounded ltr:mr-2 rtl:ml-2"
|
||||||
value={option.value}
|
value={option.value}
|
||||||
checked={value.includes(option.value)}
|
checked={value.includes(option.value)}
|
||||||
/>
|
/>
|
||||||
|
@ -310,7 +310,7 @@ export const Components: Record<BookingFieldType, Component> = {
|
||||||
type="radio"
|
type="radio"
|
||||||
disabled={readOnly}
|
disabled={readOnly}
|
||||||
name={name}
|
name={name}
|
||||||
className="dark:bg-darkgray-300 border-subtle text-emphasis h-4 w-4 focus:ring-black ltr:mr-2 rtl:ml-2"
|
className="dark:checked:bg-brand-default dark:bg-darkgray-100 dark:hover:bg-subtle dark:checked:hover:bg-brand-default focus:border-brand-default focus:ring-brand-default border-emphasis h-4 w-4 cursor-pointer text-[--cal-brand] focus:ring-2 ltr:mr-2 rtl:ml-2"
|
||||||
value={option.value}
|
value={option.value}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setValue({
|
setValue({
|
||||||
|
|
|
@ -201,7 +201,7 @@ const SettingsSidebarContainer = ({
|
||||||
alt="User Avatar"
|
alt="User Avatar"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<p className="text-sm font-medium leading-5 truncate">{t(tab.name)}</p>
|
<p className="truncate text-sm font-medium leading-5">{t(tab.name)}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="my-3 space-y-0.5">
|
<div className="my-3 space-y-0.5">
|
||||||
|
@ -226,7 +226,7 @@ const SettingsSidebarContainer = ({
|
||||||
{tab && tab.icon && (
|
{tab && tab.icon && (
|
||||||
<tab.icon className="h-[16px] w-[16px] stroke-[2px] ltr:mr-3 rtl:ml-3 md:mt-0" />
|
<tab.icon className="h-[16px] w-[16px] stroke-[2px] ltr:mr-3 rtl:ml-3 md:mt-0" />
|
||||||
)}
|
)}
|
||||||
<p className="text-sm font-medium leading-5 truncate">{t(tab.name)}</p>
|
<p className="truncate text-sm font-medium leading-5">{t(tab.name)}</p>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
{teams &&
|
{teams &&
|
||||||
|
|
|
@ -23,7 +23,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(function Input(
|
||||||
{...props}
|
{...props}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"hover:border-emphasis border-default bg-default placeholder:text-muted text-emphasis disabled:hover:border-default disabled:bg-subtle mb-2 block h-9 rounded-md border py-2 px-3 text-sm leading-4 focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-neutral-800 focus:ring-offset-1 disabled:cursor-not-allowed",
|
"hover:border-emphasis dark:focus:border-emphasis border-default bg-default placeholder:text-muted text-emphasis disabled:hover:border-default disabled:bg-subtle focus:ring-brand-default mb-2 block h-9 rounded-md border py-2 px-3 text-sm leading-4 focus:border-neutral-300 focus:outline-none focus:ring-2 disabled:cursor-not-allowed",
|
||||||
isFullWidth && "w-full",
|
isFullWidth && "w-full",
|
||||||
props.className
|
props.className
|
||||||
)}
|
)}
|
||||||
|
@ -129,7 +129,7 @@ export const InputField = forwardRef<HTMLInputElement, InputFieldProps>(function
|
||||||
{addOnLeading || addOnSuffix ? (
|
{addOnLeading || addOnSuffix ? (
|
||||||
<div
|
<div
|
||||||
dir="ltr"
|
dir="ltr"
|
||||||
className="group relative mb-1 flex items-center rounded-md focus-within:outline-none focus-within:ring-2 focus-within:ring-neutral-800 focus-within:ring-offset-1">
|
className="focus-within:ring-brand-default group relative mb-1 flex items-center rounded-md focus-within:outline-none focus-within:ring-2">
|
||||||
{addOnLeading && (
|
{addOnLeading && (
|
||||||
<Addon isFilled={addOnFilled} className={classNames("rounded-l-md border-r-0", addOnClassname)}>
|
<Addon isFilled={addOnFilled} className={classNames("rounded-l-md border-r-0", addOnClassname)}>
|
||||||
{addOnLeading}
|
{addOnLeading}
|
||||||
|
@ -280,7 +280,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(function
|
||||||
ref={ref}
|
ref={ref}
|
||||||
{...props}
|
{...props}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"hover:border-emphasis border-default bg-default placeholder:text-muted text-emphasis disabled:hover:border-default disabled:bg-subtle mb-2 block w-full rounded-md border py-2 px-3 text-sm focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-neutral-800 focus:ring-offset-1 disabled:cursor-not-allowed",
|
"hover:border-emphasis border-default bg-default placeholder:text-muted text-emphasis disabled:hover:border-default disabled:bg-subtle focus:ring-brand-default mb-2 block w-full rounded-md border py-2 px-3 text-sm focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-offset-1 disabled:cursor-not-allowed",
|
||||||
props.className
|
props.className
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -51,7 +51,7 @@ export const Select = <
|
||||||
dropdownIndicator: () => "text-default",
|
dropdownIndicator: () => "text-default",
|
||||||
control: (state) =>
|
control: (state) =>
|
||||||
cx(
|
cx(
|
||||||
"bg-default border-default !min-h-9 h-9 text-sm leading-4 placeholder:text-sm placeholder:font-normal focus-within:ring-2 focus-within:ring-emphasis hover:border-emphasis rounded-md border ",
|
"bg-default border-default !min-h-9 h-9 text-sm leading-4 placeholder:text-sm placeholder:font-normal dark:focus:border-emphasis focus-within:outline-none focus-within:ring-2 focus-within:ring-brand-default hover:border-emphasis rounded-md border",
|
||||||
state.isMulti
|
state.isMulti
|
||||||
? variant === "checkbox"
|
? variant === "checkbox"
|
||||||
? "px-3 py-2 h-fit"
|
? "px-3 py-2 h-fit"
|
||||||
|
|
|
@ -1,53 +1,69 @@
|
||||||
import { isSupportedCountry } from "libphonenumber-js";
|
import { isSupportedCountry } from "libphonenumber-js";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import BasePhoneInput from "react-phone-number-input";
|
import PhoneInput from "react-phone-input-2";
|
||||||
import type { Props, Country } from "react-phone-number-input";
|
import "react-phone-input-2/lib/style.css";
|
||||||
import "react-phone-number-input/style.css";
|
|
||||||
|
|
||||||
import { classNames } from "@calcom/lib";
|
import { classNames } from "@calcom/lib";
|
||||||
import { trpc } from "@calcom/trpc/react";
|
import { trpc } from "@calcom/trpc/react";
|
||||||
|
|
||||||
export type PhoneInputProps = Props<{
|
export type PhoneInputProps = {
|
||||||
value: string;
|
value?: string;
|
||||||
id?: string;
|
id?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
required?: boolean;
|
required?: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
}>;
|
disabled?: boolean;
|
||||||
|
onChange: (value: string) => void;
|
||||||
|
};
|
||||||
|
|
||||||
function PhoneInput({ name, className = "", onChange, ...rest }: PhoneInputProps) {
|
function BasePhoneInput({ name, className = "", onChange, ...rest }: PhoneInputProps) {
|
||||||
const defaultCountry = useDefaultCountry();
|
const defaultCountry = useDefaultCountry();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BasePhoneInput
|
<PhoneInput
|
||||||
{...rest}
|
{...rest}
|
||||||
flagUrl="/country-flag-icons/3x2/{XX}.svg"
|
country={defaultCountry}
|
||||||
international
|
enableSearch
|
||||||
defaultCountry={defaultCountry}
|
disableSearchIcon
|
||||||
name={name}
|
inputProps={{
|
||||||
onChange={onChange}
|
name: name,
|
||||||
countrySelectProps={{ className: "text-emphasis" }}
|
required: rest.required,
|
||||||
numberInputProps={{
|
placeholder: rest.placeholder,
|
||||||
className: "border-0 text-sm focus:ring-0 bg-default text-default",
|
|
||||||
}}
|
}}
|
||||||
className={classNames(
|
onChange={(value) => onChange(value)}
|
||||||
"hover:border-emphasis border-default bg-default rounded-md border py-px pl-3 focus-within:border-neutral-300 focus-within:outline-none focus-within:ring-2 focus-within:ring-neutral-800 focus-within:ring-offset-1 disabled:cursor-not-allowed",
|
containerClass={classNames(
|
||||||
|
"hover:border-emphasis dark:focus:border-emphasis border-default !bg-default rounded-md border focus-within:outline-none focus-within:ring-2 focus-within:ring-brand-default disabled:cursor-not-allowed",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
|
inputClass="text-sm focus:ring-0 !bg-default text-default"
|
||||||
|
buttonClass="text-emphasis !bg-default hover:!bg-emphasis"
|
||||||
|
searchClass="!text-default !bg-default hover:!bg-emphasis"
|
||||||
|
dropdownClass="!text-default !bg-default"
|
||||||
|
inputStyle={{ width: "inherit", border: 0 }}
|
||||||
|
searchStyle={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "row",
|
||||||
|
alignItems: "center",
|
||||||
|
padding: "6px 12px",
|
||||||
|
gap: "8px",
|
||||||
|
width: "296px",
|
||||||
|
height: "28px",
|
||||||
|
marginLeft: "-4px",
|
||||||
|
}}
|
||||||
|
dropdownStyle={{ width: "max-content" }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const useDefaultCountry = () => {
|
const useDefaultCountry = () => {
|
||||||
const [defaultCountry, setDefaultCountry] = useState<Country>("US");
|
const [defaultCountry, setDefaultCountry] = useState("us");
|
||||||
trpc.viewer.public.countryCode.useQuery(undefined, {
|
trpc.viewer.public.countryCode.useQuery(undefined, {
|
||||||
refetchOnWindowFocus: false,
|
refetchOnWindowFocus: false,
|
||||||
refetchOnReconnect: false,
|
refetchOnReconnect: false,
|
||||||
retry: false,
|
retry: false,
|
||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
if (isSupportedCountry(data?.countryCode)) {
|
if (isSupportedCountry(data?.countryCode)) {
|
||||||
setDefaultCountry(data.countryCode as Country);
|
setDefaultCountry(data.countryCode);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -55,4 +71,4 @@ const useDefaultCountry = () => {
|
||||||
return defaultCountry;
|
return defaultCountry;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PhoneInput;
|
export default BasePhoneInput;
|
||||||
|
|
|
@ -11,7 +11,7 @@ export const Radio = (props: RadioGroupPrimitive.RadioGroupItemProps & { childre
|
||||||
<RadioGroupPrimitive.Item
|
<RadioGroupPrimitive.Item
|
||||||
{...props}
|
{...props}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"hover:bg-subtle border-default focus:ring-emphasis mt-0.5 h-4 w-4 flex-shrink-0 rounded-full border focus:ring-2",
|
"hover:bg-subtle border-default dark:checked:bg-brand-default dark:bg-darkgray-100 dark:hover:bg-subtle dark:checked:hover:bg-brand-default focus:ring-brand-default me-1.5 mt-0.5 h-4 w-4 flex-shrink-0 rounded-full border text-[--cal-brand] focus:ring-2 focus:ring-offset-1",
|
||||||
props.disabled && "opacity-60"
|
props.disabled && "opacity-60"
|
||||||
)}>
|
)}>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
@ -21,7 +21,7 @@ export const Indicator = ({ disabled }: { disabled?: boolean }) => (
|
||||||
<RadioGroupPrimitive.Indicator
|
<RadioGroupPrimitive.Indicator
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"after:bg-default dark:after:bg-inverted relative flex h-full w-full items-center justify-center rounded-full bg-black after:h-[6px] after:w-[6px] after:rounded-full after:content-['']",
|
"after:bg-default dark:after:bg-inverted relative flex h-full w-full items-center justify-center rounded-full bg-black after:h-[6px] after:w-[6px] after:rounded-full after:content-['']",
|
||||||
disabled ? "after:bg-muted" : "bg-black"
|
disabled ? "after:bg-muted" : "bg-brand-default"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
65
yarn.lock
65
yarn.lock
|
@ -5212,6 +5212,7 @@ __metadata:
|
||||||
react-intl: ^5.25.1
|
react-intl: ^5.25.1
|
||||||
react-live-chat-loader: ^2.7.3
|
react-live-chat-loader: ^2.7.3
|
||||||
react-multi-email: ^0.5.3
|
react-multi-email: ^0.5.3
|
||||||
|
react-phone-input-2: ^2.15.1
|
||||||
react-phone-number-input: ^3.2.7
|
react-phone-number-input: ^3.2.7
|
||||||
react-schemaorg: ^2.0.0
|
react-schemaorg: ^2.0.0
|
||||||
react-select: ^5.7.0
|
react-select: ^5.7.0
|
||||||
|
@ -17960,7 +17961,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"classnames@npm:^2.2.5":
|
"classnames@npm:^2.2.5, classnames@npm:^2.2.6":
|
||||||
version: 2.3.2
|
version: 2.3.2
|
||||||
resolution: "classnames@npm:2.3.2"
|
resolution: "classnames@npm:2.3.2"
|
||||||
checksum: 2c62199789618d95545c872787137262e741f9db13328e216b093eea91c85ef2bfb152c1f9e63027204e2559a006a92eb74147d46c800a9f96297ae1d9f96f4e
|
checksum: 2c62199789618d95545c872787137262e741f9db13328e216b093eea91c85ef2bfb152c1f9e63027204e2559a006a92eb74147d46c800a9f96297ae1d9f96f4e
|
||||||
|
@ -28162,6 +28163,13 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"lodash.memoize@npm:^4.1.2":
|
||||||
|
version: 4.1.2
|
||||||
|
resolution: "lodash.memoize@npm:4.1.2"
|
||||||
|
checksum: 9ff3942feeccffa4f1fafa88d32f0d24fdc62fd15ded5a74a5f950ff5f0c6f61916157246744c620173dddf38d37095a92327d5fd3861e2063e736a5c207d089
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"lodash.merge@npm:^4.6.2":
|
"lodash.merge@npm:^4.6.2":
|
||||||
version: 4.6.2
|
version: 4.6.2
|
||||||
resolution: "lodash.merge@npm:4.6.2"
|
resolution: "lodash.merge@npm:4.6.2"
|
||||||
|
@ -28183,6 +28191,13 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"lodash.reduce@npm:^4.6.0":
|
||||||
|
version: 4.6.0
|
||||||
|
resolution: "lodash.reduce@npm:4.6.0"
|
||||||
|
checksum: 81f2a1045440554f8427f895ef479f1de5c141edd7852dde85a894879312801efae0295116e5cf830c531c1a51cdab8f3628c3ad39fa21a9874bb9158d9ea075
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"lodash.startcase@npm:^4.4.0":
|
"lodash.startcase@npm:^4.4.0":
|
||||||
version: 4.4.0
|
version: 4.4.0
|
||||||
resolution: "lodash.startcase@npm:4.4.0"
|
resolution: "lodash.startcase@npm:4.4.0"
|
||||||
|
@ -28190,6 +28205,13 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"lodash.startswith@npm:^4.2.1":
|
||||||
|
version: 4.2.1
|
||||||
|
resolution: "lodash.startswith@npm:4.2.1"
|
||||||
|
checksum: 1847371cbf6f32c4125a555847aff8a1ff1a977f40882b0ad4e2656a32e364793cfa7602915c9165cc0bba61fbd802e561888126d242faadcf3fc77215bab19b
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"lodash.uniq@npm:4.5.0":
|
"lodash.uniq@npm:4.5.0":
|
||||||
version: 4.5.0
|
version: 4.5.0
|
||||||
resolution: "lodash.uniq@npm:4.5.0"
|
resolution: "lodash.uniq@npm:4.5.0"
|
||||||
|
@ -32013,21 +32035,23 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"playwright-core@npm:1.34.0":
|
"playwright-core@npm:1.33.0":
|
||||||
version: 1.34.0
|
version: 1.33.0
|
||||||
resolution: "playwright-core@npm:1.34.0"
|
resolution: "playwright-core@npm:1.33.0"
|
||||||
checksum: 1821ab254b3c756e52c144c26cae7250dd5a1c779277cdd583bd289501d45cceaea40a8185ebf7eaa56b8291e4a042e3eef65f511da2306349c275794c9a582d
|
bin:
|
||||||
|
playwright: cli.js
|
||||||
|
checksum: 5fb7bda06a8b73b56b85b5a0b8f711211dde57a375d9379289e22239b2de879c6d93c8fdc9ba44b932bf100914ab1ca1a55697ad88440fdd0a39101fc020b77f
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"playwright@npm:^1.31.2":
|
"playwright@npm:^1.31.2":
|
||||||
version: 1.34.0
|
version: 1.33.0
|
||||||
resolution: "playwright@npm:1.34.0"
|
resolution: "playwright@npm:1.33.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
playwright-core: 1.34.0
|
playwright-core: 1.33.0
|
||||||
bin:
|
bin:
|
||||||
playwright: cli.js
|
playwright: cli.js
|
||||||
checksum: 5e5586e7c4e42f206526fe4306e35c68b7af353d6e3701c9e1045940aa3a916ac50b0b7c27a8eaeb3831ddc4f1146a367f98a5b6b841f977e9770b925e81877f
|
checksum: fb3934c56ed749cf412ea35b82052f013872d7f7b7747ab7042580af473dfc1b038956a31c132ee8c0098f74150c75e2073e9c737fd4c1ed54700a23fffc079f
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
@ -33489,12 +33513,12 @@ __metadata:
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"react-fast-marquee@npm:^1.3.5":
|
"react-fast-marquee@npm:^1.3.5":
|
||||||
version: 1.6.0
|
version: 1.5.2
|
||||||
resolution: "react-fast-marquee@npm:1.6.0"
|
resolution: "react-fast-marquee@npm:1.5.2"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ">= 16.8.0 || 18.0.0"
|
react: ">= 16.8.0 || 18.0.0"
|
||||||
react-dom: ">= 16.8.0 || 18.0.0"
|
react-dom: ">= 16.8.0 || 18.0.0"
|
||||||
checksum: f448341d30ef417292d8f7618d4931190a6d4aa353fbd276da4dcecc49bb6a7a32962f9cc74fe0af2ea9617d7b453ed3efccf7a0e8709a8b66e04ec04f4ae18c
|
checksum: 2db7a61470a9e02707aa5a80792ec009a8694ef7283b01e30ec516893297794d7f466ae3230c59773bab357684803767c1ffab875175471c41b28a5055345130
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
@ -33724,6 +33748,23 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"react-phone-input-2@npm:^2.15.1":
|
||||||
|
version: 2.15.1
|
||||||
|
resolution: "react-phone-input-2@npm:2.15.1"
|
||||||
|
dependencies:
|
||||||
|
classnames: ^2.2.6
|
||||||
|
lodash.debounce: ^4.0.8
|
||||||
|
lodash.memoize: ^4.1.2
|
||||||
|
lodash.reduce: ^4.6.0
|
||||||
|
lodash.startswith: ^4.2.1
|
||||||
|
prop-types: ^15.7.2
|
||||||
|
peerDependencies:
|
||||||
|
react: ^16.12.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0
|
||||||
|
react-dom: ^16.12.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0
|
||||||
|
checksum: 60cee455c7044da648a23312cae0077b4108dd24e26173a954904123decefae9875a1f8225a722a6c4d74c37b18ad3038ec6c302b64857f75089e544e8d48847
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"react-phone-number-input@npm:^3.2.7":
|
"react-phone-number-input@npm:^3.2.7":
|
||||||
version: 3.2.7
|
version: 3.2.7
|
||||||
resolution: "react-phone-number-input@npm:3.2.7"
|
resolution: "react-phone-number-input@npm:3.2.7"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user