feat: upgrade tailwind v4 (#24598)

* chore: refactor config files to prevent migration tool errors

* refactor: upgrade with the tailwind migration tool

* chore: restore pre-commit command + mc

* refactor(wip): update dependencies and migrate to Tailwind CSS v4 (mainly web)

* chore: resolve Tailwind v4 migration conflicts from merging main

* chore: remove unused Tailwind packages from config and update dependencies for v4 migration

* chore: uncomment Tailwind CSS utility classes in globals.css

* fix: resolve token conflicts between calcom and coss ui

* fix: textarea scrollbar

* Fix CUI-16

* fix: added @tailwindcss/forms plugin and cleaned up CSS classes in various components to remove unnecessary dark mode styles

* fix: selects and inputs of different sizes

* fix: remove unnecessary leading-20 class from modal titles in various components

* fix: update Checkbox component styles to remove unnecessary border on checked state

* fix: clean up styles in RequiresConfirmationController, Checkbox, and Radio components to enhance consistency

* fix: update button and filter component styles to remove unnecessary rounded classes for consistency

* fix: calendar

* fix: update KBarSearch

* fix: refine styles in Empty and Checkbox components for improved consistency

* Fix focus state email input

* fix: update button hover and active states to use 'not-disabled' instead of 'enabled'

* fix: line-height issues

* fix: update class name for muted background in BookingListItem component

* fix: sidebar spacing

* chore: update class names to use new Tailwind CSS color utilities

* fix embed

* chore: upgrade Tailwind CSS to version 4.1.16 and update related dependencies

* Map css variables and add a playground test for heavy css customization

* suggestion for coss-ui

* refactor: update CSS variable usage and clean up styles

- Replace instances of `--cal-brand-color` with `--cal-brand` in embed-related HTML files.
- Remove the now-unnecessary `addAppCssVars` function from the embed core.
- Import theme tokens in the embed core styles for better consistency.
- Clean up whitespace and formatting in CSS files for improved readability.
- Add a comment in `tokens.css` regarding its usage in both embed and webapp contexts.

* Handle within tokens.css instead of fixing coss-ui

* Remove initial, not needed. Also, remove tailwind.config.js as tailwidn scans the html automaically

* fix: examples app breaking

* fix: modal not resizing correctly

* feat: upgrade atoms to tailwind v4

* fix: atoms build breaking

* fix: atoms build breaking

* chore: upgrate examples/base to tailwind 4

* chore: update globals.css

* fix: add missing scheduler css variables

* fix: PlatformAdditionalCalendarSelector

* chore: update global styles

* chore: update tailwindcss and postcss dependencies to stable versions

* chore: remove unneeded class

* fix: dialog and toast animation

* fix: replace flex-shrink-0 with shrink-0 for consistent styling in various components

* fix: dialog modal for Apple connect

* add margin in SaveFilterSegmentButton

* Fix radix button nested states

* add cursor pointer to buttons but keep dsabled state

* Fix commandK selectors and adds cursor pointer

* Fix teams filter

* fix - round checkboxes

* fix filter checkbox

* fix select indicator's margin

* command group font size

* style: fix badge and tooltip radius

* chore: remove unneeded files

* Delete PR_REVIEW_MANAGED_EVENT_REASSIGNMENT.md

* remove ui-playground leftover

* fix: add missing react phone input styles in atoms

* Delete managed-event-reassignment-flow-and-architecture.mermaid

* fix: inter font not loading

* Add theme to skeleton container so that it can support dark mode

* fix: create custom stack-y-* utilities post tw4 upgrade

* fix: typo

* fix: atoms stack class + remove unused css file

* fix default radius valiue

* fix space-y in embed

* fix skeleton background

* Hardcode radius values to match production

* fix border in embed

* add missing externalThemeClass

* feat: create a custom stack-y-* utility

* fix: add stack utility to atom global css

* fix: Skeleton loader class modalbox

* Add stack-y utility in embed

* fix: add missing stack utilities in atoms globals.css

* update yarn.lock

* add popover portla

* update

---------

Co-authored-by: Sean Brydon <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Ryukemeister <[email protected]>
Co-authored-by: cal.com <[email protected]>
Co-authored-by: Eunjae Lee <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-11-25 17:32:28 -03:00
1 parent 625c260e40
commit d6546c3107
447 files changed
+14783 -28932

No files matched your search

@@ -20,7 +20,7 @@ export const AppDependencyComponent = ({
<div
className={classNames(
"rounded-md px-4 py-3",
dependencyData && dependencyData.some((dependency) => !dependency.installed) ? "bg-info" : "bg-subtle"
dependencyData && dependencyData.some((dependency) => !dependency.installed) ? "bg-cal-info" : "bg-subtle"
)}>
{dependencyData &&
dependencyData.map((dependency) => {
@@ -145,7 +145,7 @@ export const KeyField: React.FC<InputFieldProps & { defaultValue: string }> = fo
addOnLeading && "rounded-l-none border-l-0",
isPasswordVisible && "inline-block",
!isPasswordVisible && "hidden",
"!my-0 !ring-0"
"my-0! ring-0!"
)}
{...passThrough}
ref={ref}
@@ -160,7 +160,7 @@ export const KeyField: React.FC<InputFieldProps & { defaultValue: string }> = fo
addOnLeading && "rounded-l-none border-l-0",
!isPasswordVisible && "inline-block",
isPasswordVisible && "hidden",
"!my-0 !ring-0"
"my-0! ring-0!"
)}
disabled
value={getHiddenKey()}
@@ -118,7 +118,7 @@ export const SearchDialog = (props: ISearchDialog) => {
return (
<Dialog open={isOpenDialog} onOpenChange={setIsOpenDialog}>
<DialogContent>
<h3 className="leading-16 font-cal text-emphasis text-xl" id="modal-title">
<h3 className="font-cal text-emphasis text-xl" id="modal-title">
{t("add_gif_to_confirmation")}
</h3>
<p className="text-subtle mb-3 text-sm font-light">{t("find_gif_spice_confirmation")}</p>
@@ -127,7 +127,7 @@ export const SearchDialog = (props: ISearchDialog) => {
{renderTab("link", t("add_link_from_giphy"), MODE_URL)}
</div>
<form
className="flex w-full justify-center space-x-2 space-y-2 rtl:space-x-reverse"
className="flex w-full justify-center space-x-2 stack-y-2 rtl:space-x-reverse"
onSubmit={handleFormSubmit}>
<div className="relative block w-full pt-2">
<Input
@@ -148,7 +148,7 @@ export const SearchDialog = (props: ISearchDialog) => {
</Button>
</form>
{gifImage && (
<div className="flex flex-col items-center space-x-2 space-y-2 pt-3 rtl:space-x-reverse">
<div className="flex flex-col items-center space-x-2 stack-y-2 pt-3 rtl:space-x-reverse">
<div className="bg-subtle flex w-full items-center justify-center">
{isPending ? (
<div className="flex h-[200px] w-full items-center justify-center bg-gray-400 pb-3 pt-3">
@@ -16,7 +16,7 @@ export default function SelectGifInput(props: ISelectGifInput) {
const [showDialog, setShowDialog] = useState(false);
return (
<div className="flex flex-col items-start space-x-2 space-y-2 rtl:space-x-reverse">
<div className="flex flex-col items-start space-x-2 stack-y-2 rtl:space-x-reverse">
{selectedGif && (
<div className="min-h-[200px]">
<img alt="Selected Gif Image" src={selectedGif} />
@@ -145,7 +145,7 @@ export const KeyField: React.FC<InputFieldProps & { defaultValue: string }> = fo
addOnLeading && "rounded-l-none border-l-0",
isPasswordVisible && "inline-block",
!isPasswordVisible && "hidden",
"!my-0 !ring-0"
"my-0! ring-0!"
)}
{...passThrough}
ref={ref}
@@ -160,7 +160,7 @@ export const KeyField: React.FC<InputFieldProps & { defaultValue: string }> = fo
addOnLeading && "rounded-l-none border-l-0",
!isPasswordVisible && "inline-block",
isPasswordVisible && "hidden",
"!my-0 !ring-0"
"my-0! ring-0!"
)}
disabled
value={getHiddenKey()}
@@ -20,7 +20,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
}}
switchChecked={enabled}
teamId={eventType.team?.id || undefined}>
<fieldset className="space-y-2" disabled={disabled}>
<fieldset className="stack-y-2" disabled={disabled}>
<TextField
disabled={disabled}
name="Site ID"
@@ -19,7 +19,7 @@ const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({ eventTyp
<a download href={QR_URL} target="_blank" rel="noreferrer">
<img
className={classNames(
"hover:bg-muted border-default border transition hover:shadow-sm",
"hover:bg-cal-muted border-default border transition hover:shadow-sm",
size >= 256 && "min-h-32"
)}
style={{ padding: size / 16, borderRadius: size / 20 }}
@@ -54,7 +54,7 @@ export default function FormInputFields(props: FormInputFieldsProps) {
const fieldIdentifier = getFieldIdentifier(field);
return (
<div key={field.id} className="block flex-col sm:flex ">
<div className="min-w-48 mb-2 flex-grow">
<div className="min-w-48 mb-2 grow">
<label id="slug-label" htmlFor="slug" className="text-default flex text-sm font-medium">
{field.label}
</label>
@@ -23,7 +23,7 @@ export const EmptyState = ({
buttonDataTestId,
}: EmptyStateProps) => {
return (
<div className="border-sublte bg-muted flex flex-col items-center gap-6 rounded-xl border p-11">
<div className="border-sublte bg-cal-muted flex flex-col items-center gap-6 rounded-xl border p-11">
<div className="mb-3 grid">
{/* Icon card - Top */}
<div className="bg-default border-subtle z-30 col-start-1 col-end-1 row-start-1 row-end-1 h-10 w-10 transform rounded-md border shadow-sm">
@@ -84,7 +84,7 @@ export const ResultsView = ({
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -20 }}
transition={{ duration: 0.2 }}
className="space-y-4">
className="stack-y-4">
<div className="bg-default border-muted mb-0.5 flex flex-col gap-0.5 rounded-2xl border p-1">
<div className="flex items-center gap-2 px-2 py-1">
<div className="border-subtle rounded-lg border p-1">
@@ -112,7 +112,7 @@ export const ResultsView = ({
<div className="h-4 w-24 animate-pulse rounded bg-gray-200" />
</div>
<div className="border-subtle rounded-xl border px-3 py-2">
<div className="space-y-3">
<div className="stack-y-3">
{[1, 2, 3].map((i) => (
<div key={i} className="flex items-center justify-between">
<div className="h-4 w-32 animate-pulse rounded bg-gray-200" />
@@ -134,7 +134,7 @@ export const ResultsView = ({
<div className="divide-subtle divide-y">
{[1, 2, 3].map((i) => (
<div key={i} className="flex items-center justify-between py-3 first:pt-0 last:pb-0">
<div className="space-y-2">
<div className="stack-y-2">
<div className="h-4 w-32 animate-pulse rounded bg-gray-200" />
<div className="h-4 w-24 animate-pulse rounded bg-gray-200" />
</div>
@@ -158,7 +158,7 @@ export const ResultsView = ({
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -20 }}
transition={{ duration: 0.2 }}
className="space-y-4">
className="stack-y-4">
{chosenRoute.action.type === "externalRedirectUrl" && (
<ResultsSection title={chosenRoute.name ?? "External Redirect"} icon="zap">
<div className="flex items-center gap-2">
@@ -211,7 +211,7 @@ export const ResultsView = ({
<ResultsSection title="Matching" icon="atom">
<div className="relative flex flex-col gap-3">
{/* Seperator */}
<div className="absolute bottom-3 left-[0.75rem] top-3 w-[1px] bg-gray-200" />
<div className="absolute bottom-3 left-3 top-3 w-px bg-gray-200" />
<div className="flex items-center justify-between">
<div className="flex items-center gap-1">
@@ -296,7 +296,7 @@ export const ResultsView = ({
{membersMatchResult.mainWarnings && membersMatchResult.mainWarnings.length > 0 && (
<ResultsSection title="Warnings" icon="triangle-alert">
<div className="space-y-2">
<div className="stack-y-2">
{membersMatchResult.mainWarnings.map((warning, index) => (
<div data-testid="alert" key={index} className="text-warning">
{warning}
@@ -308,7 +308,7 @@ export const ResultsView = ({
{membersMatchResult.fallbackWarnings && membersMatchResult.fallbackWarnings.length > 0 && (
<ResultsSection title="Fallback Warnings" icon="triangle-alert">
<div className="space-y-2">
<div className="stack-y-2">
{membersMatchResult.fallbackWarnings.map((warning, index) => (
<div data-testid="alert" key={index} className="text-warning">
{warning}
@@ -2,7 +2,7 @@ export function RoutingSkeleton() {
return (
<div className="w-full py-4 lg:py-8">
<div className="flex w-full flex-col rounded-md">
<div className="bg-muted border-muted rounded-2xl border p-2.5">
<div className="bg-cal-muted border-muted rounded-2xl border p-2.5">
{[1, 2, 3].map((index) => (
<div key={index}>
{/* Title */}
@@ -25,14 +25,14 @@ export function RoutingSkeleton() {
<div className="bg-subtle h-4 w-32 animate-pulse rounded" />
</div>
<div className="bg-muted rounded-xl p-0.5">
<div className="bg-cal-muted rounded-xl p-0.5">
<div className="flex items-center gap-2 py-1 pl-3">
{/* If booker selects */}
<div className="bg-subtle h-4 w-32 animate-pulse rounded" />
<div className="bg-subtle h-4 w-16 animate-pulse rounded" />
</div>
<div className="bg-default rounded-[10px] px-3 py-2 ">
<div className="space-y-3">
<div className="stack-y-3">
{/* Label Field */}
<div className="flex items-center justify-between gap-[10px]">
<div className="bg-subtle h-4 w-full animate-pulse rounded" />
@@ -82,7 +82,7 @@ export const TeamMemberSelect = ({
return (
<div>
<Label htmlFor="routing-form-select-members">{t("routing_form_select_members_to_email")}</Label>
<div className="space-y-4">
<div className="stack-y-4">
<Select
id="routing-form-select-members"
data-testid="routing-form-select-members"
@@ -83,7 +83,7 @@ export const TeamMembersMatchResult = ({
};
return (
<div className="text-default mt-2 space-y-2">
<div className="text-default mt-2 stack-y-2">
<div className="mt-4">
{membersMatchResult.contactOwnerEmail ? (
<div data-testid="contact-owner-email">
@@ -309,7 +309,7 @@ function Conjs({ not, setNot, config, conjunctionOptions, setConjunction, disabl
const selectValue = options.find((option) => option.value === value);
const summary = !config.operators.__calReporting ? "If booker selects" : "Query where";
return (
<div className="mb-[1px] flex items-center text-sm">
<div className="mb-px flex items-center text-sm">
<span>{summary}</span>
<Select
className="flex px-2"
@@ -170,7 +170,7 @@ const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
<RadioGroup.Root
disabled={disabled || paymentOption === "HOLD"}
defaultValue="never"
className="flex flex-col space-y-2"
className="flex flex-col stack-y-2"
value={getAppData("refundPolicy")}
onValueChange={(val) => {
setAppData("refundPolicy", val);
@@ -9,7 +9,7 @@ export default function AppSettings() {
const [input, setInput] = useState("");
return (
<div className="space-y-4 px-4 pb-4 pt-4 text-sm">
<div className="stack-y-4 px-4 pb-4 pt-4 text-sm">
<TextField
placeholder="Some Input"
value={input}
@@ -25,7 +25,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
}}
switchChecked={enabled}
teamId={eventType.team?.id || undefined}>
<fieldset className="space-y-2" disabled={disabled}>
<fieldset className="stack-y-2" disabled={disabled}>
<TextField
disabled={disabled}
name="Script URL"
@@ -10,7 +10,7 @@ export default function AppSettings() {
const [location, setLocation] = useState("");
return (
<div className="space-y-4 text-sm">
<div className="stack-y-4 text-sm">
<TextField
placeholder="San Francisco"
value={location}
+5 -6
View File
@@ -11,25 +11,24 @@
],
"dependencies": {
"@calcom/eslint-plugin-eslint": "workspace:*",
"@tailwindcss/forms": "^0.5.10",
"@todesktop/tailwind-variants": "^1.0.0",
"eslint-config-next": "^13.2.1",
"eslint-config-prettier": "^8.6.0",
"eslint-config-turbo": "^0.0.7",
"eslint-plugin-playwright": "^0.12.0",
"eslint-plugin-prettier": "^4.2.1"
"eslint-plugin-prettier": "^4.2.1",
"tailwind-scrollbar": "^4.0.2",
"tailwindcss-radix": "^4.0.2",
"tw-animate-css": "^1.4.0"
},
"devDependencies": {
"@savvywombat/tailwindcss-grid-areas": "^3.0.0",
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/line-clamp": "^0.4.0",
"@tailwindcss/typography": "^0.5.4",
"@trivago/prettier-plugin-sort-imports": "4.1.1",
"@typescript-eslint/eslint-plugin": "^5.52.0",
"@typescript-eslint/parser": "^5.52.0",
"prettier": "^2.8.6",
"prettier-plugin-tailwindcss": "^0.2.5",
"tailwind-scrollbar": "^2.0.1",
"tailwindcss": "^3.3.3",
"typescript": "^5.9.0-beta"
}
}
-348
View File
@@ -1,348 +0,0 @@
const plugin = require("tailwindcss/plugin");
const { fontFamily } = require("tailwindcss/defaultTheme");
const colors = require("tailwindcss/colors");
/** @type {import('tailwindcss').Config} */
const subtleColor = "#E5E7EB";
module.exports = {
content: [
"../../apps/web/pages/**/*.{js,ts,jsx,tsx}",
"../../apps/web/app/**/*.{js,ts,jsx,tsx}",
"../../apps/web/modules/**/*.{js,ts,jsx,tsx}",
"../../apps/web/components/**/*.{js,ts,jsx,tsx}",
"../../packages/app-store/!(node_modules)/**/*{components,pages}/**/*.{js,ts,jsx,tsx}",
"../../packages/features/!(node_modules)/**/*.{js,ts,jsx,tsx}",
"../../packages/ui/!(node_modules)/**/*.{js,ts,jsx,tsx}",
"../../packages/platform/atoms/!(node_modules)/**/*.{js,ts,jsx,tsx}",
],
darkMode: "class",
theme: {
spacing: {
0: "var(--cal-spacing-0)",
px: "var(--cal-spacing-px)",
0.5: "var(--cal-spacing-0_5)",
1: "var(--cal-spacing-1)",
1.5: "var(--cal-spacing-1_5)",
2: "var(--cal-spacing-2)",
2.5: "var(--cal-spacing-2_5)",
3: "var(--cal-spacing-3)",
3.5: "var(--cal-spacing-3_5)",
4: "var(--cal-spacing-4)",
5: "var(--cal-spacing-5)",
6: "var(--cal-spacing-6)",
7: "var(--cal-spacing-7)",
8: "var(--cal-spacing-8)",
9: "var(--cal-spacing-9)",
10: "var(--cal-spacing-10)",
11: "var(--cal-spacing-11)",
12: "var(--cal-spacing-12)",
14: "var(--cal-spacing-14)",
16: "var(--cal-spacing-16)",
20: "var(--cal-spacing-20)",
24: "var(--cal-spacing-24)",
28: "var(--cal-spacing-28)",
32: "var(--cal-spacing-32)",
36: "var(--cal-spacing-36)",
40: "var(--cal-spacing-40)",
44: "var(--cal-spacing-44)",
48: "var(--cal-spacing-48)",
52: "var(--cal-spacing-52)",
56: "var(--cal-spacing-56)",
60: "var(--cal-spacing-60)",
64: "var(--cal-spacing-64)",
72: "var(--cal-spacing-72)",
80: "var(--cal-spacing-80)",
96: "var(--cal-spacing-96)",
},
borderRadius: {
none: "var(--cal-radius-none)",
sm: "var(--cal-radius-sm)",
DEFAULT: "var(--cal-radius)",
md: "var(--cal-radius-md)",
lg: "var(--cal-radius-lg)",
xl: "var(--cal-radius-xl)",
"2xl": "var(--cal-radius-2xl)",
"3xl": "var(--cal-radius-3xl)",
full: "var(--cal-radius-full)",
},
extend: {
colors: {
// Standard Background
emphasis: "var(--cal-bg-emphasis)",
default: "var(--cal-bg, white)",
subtle: "var(--cal-bg-subtle)",
muted: "var(--cal-bg-muted)",
inverted: "var(--cal-bg-inverted)",
// Primary Background
primary: {
default: "var(--cal-bg-primary)",
emphasis: "var(--cal-bg-primary-emphasis)",
muted: "var(--cal-bg-primary-muted)",
},
// Brand
brand: {
default: "var(--cal-brand,#111827)",
emphasis: "var(--cal-brand-emphasis,#101010)",
subtle: "var(--cal-brand-subtle,#9CA3AF)",
accent: "var(--cal-brand-accent,white)",
},
// Semantic Background
semantic: {
info: {
subtle: "var(--cal-bg-semantic-info-subtle)",
emphasis: "var(--cal-bg-semantic-info-emphasis)",
},
success: {
subtle: "var(--cal-bg-semantic-success-subtle)",
emphasis: "var(--cal-bg-semantic-success-emphasis)",
},
attention: {
subtle: "var(--cal-bg-semantic-attention-subtle)",
emphasis: "var(--cal-bg-semantic-attention-emphasis)",
},
error: {
subtle: "var(--cal-bg-semantic-error-subtle)",
emphasis: "var(--cal-bg-semantic-error-emphasis)",
},
},
// Visualization Background
visualization: {
1: {
subtle: "var(--cal-bg-visualization-1-subtle)",
emphasis: "var(--cal-bg-visualization-1-emphasis)",
},
2: {
subtle: "var(--cal-bg-visualization-2-subtle)",
emphasis: "var(--cal-bg-visualization-2-emphasis)",
},
3: {
subtle: "var(--cal-bg-visualization-3-subtle)",
emphasis: "var(--cal-bg-visualization-3-emphasis)",
},
4: {
subtle: "var(--cal-bg-visualization-4-subtle)",
emphasis: "var(--cal-bg-visualization-4-emphasis)",
},
5: {
subtle: "var(--cal-bg-visualization-5-subtle)",
emphasis: "var(--cal-bg-visualization-5-emphasis)",
},
6: {
subtle: "var(--cal-bg-visualization-6-subtle)",
emphasis: "var(--cal-bg-visualization-6-emphasis)",
},
7: {
subtle: "var(--cal-bg-visualization-7-subtle)",
emphasis: "var(--cal-bg-visualization-7-emphasis)",
},
},
// Legacy - Consider deprecating
info: "var(--cal-bg-info)",
success: "var(--cal-bg-success)",
attention: "var(--cal-bg-attention)",
error: "var(--cal-bg-error)",
darkerror: "var(--cal-bg-dark-error)",
// Launch colors
"launch-dark": "var(--cal-bg-launch-dark)",
// Base colors
black: "#111111",
gray: colors.gray,
darkgray: colors.slate,
},
borderColor: {
// Standard Borders
emphasis: "var(--cal-border-emphasis)",
default: "var(--cal-border)",
subtle: "var(--cal-border-subtle)",
muted: "var(--cal-border-muted)",
// Semantic Borders
semantic: {
error: "var(--cal-border-semantic-error)",
"attention-subtle": "var(--cal-border-semantic-attention-subtle)",
"error-subtle": "var(--cal-border-semantic-error-subtle)",
},
// Used in booker embed customization
booker: `var(--cal-border-booker, ${subtleColor})`,
// Legacy - Consider deprecating
error: "var(--cal-border-error)",
"cal-bg": "var(--cal-bg)",
"cal-bg-muted": "var(--cal-bg-muted)",
},
textColor: {
// Standard Text
emphasis: "var(--cal-text-emphasis)",
default: "var(--cal-text)",
subtle: "var(--cal-text-subtle)",
muted: "var(--cal-text-muted)",
inverted: "var(--cal-text-inverted)",
// Semantic Text
semantic: {
info: "var(--cal-text-semantic-info)",
success: "var(--cal-text-semantic-success)",
attention: "var(--cal-text-semantic-attention)",
error: "var(--cal-text-semantic-error)",
},
// Semantic Text Emphasis
"semantic-info-emphasis": "var(--cal-text-semantic-info-emphasis)",
"semantic-success-emphasis": "var(--cal-text-semantic-success-emphasis)",
"semantic-attention-emphasis": "var(--cal-text-semantic-attention-emphasis)",
"semantic-error-emphasis": "var(--cal-text-semantic-error-emphasis)",
// Legacy - Consider deprecating
info: "var(--cal-text-info)",
success: "var(--cal-text-success)",
attention: "var(--cal-text-attention)",
error: "var(--cal-text-error)",
brand: "var(--cal-brand-text)",
},
fill: {
emphasis: "var(--cal-text-emphasis, #111827)",
default: "var(--cal-text, #374151)",
subtle: "var(--cal-text-subtle, #6B7280)",
muted: "var(--cal-text-muted, #9CA3AF)",
inverted: "var(--cal-text-inverted, white)",
info: "var(--cal-text-info, #253985)",
success: "var(--cal-text-success, #285231)",
attention: "var(--cal-text-attention, #73321B)",
error: "var(--cal-text-error, #752522)",
brand: "var(--cal-brand-text)",
},
screens: {
pwa: { raw: "(display-mode: standalone)" },
"3xl": "1920px",
"4xl": "2560px",
},
keyframes: {
"fade-in-up": {
from: { opacity: 0, transform: "translateY(10px)" },
to: { opacity: 1, transform: "none" },
},
spinning: {
"100%": { transform: "rotate(360deg)" },
},
drawerSlideLeftAndFade: {
from: { opacity: "0", transform: "translateX(100%)" },
to: { opacity: "1", transform: "translateX(0)" },
},
drawerSlideRightAndFade: {
from: { opacity: "1", transform: "translateX(0)" },
to: { opacity: "0", transform: "translateX(100%)" },
},
},
animation: {
"fade-in-up": "fade-in-up 600ms var(--animation-delay, 0ms) cubic-bezier(.21,1.02,.73,1) forwards",
"fade-in-bottom": "fade-in-bottom cubic-bezier(.21,1.02,.73,1) forwards",
spinning: "spinning 0.75s linear infinite",
drawerSlideLeftAndFade: "drawerSlideLeftAndFade 150ms cubic-bezier(0.16, 1, 0.3, 1)",
drawerSlideRightAndFade: "drawerSlideRightAndFade 150ms ease-in",
},
borderWidth: {
"booker-width": "var(--cal-border-booker-width, 1px)",
},
fontFamily: {
cal: ["var(--font-cal)", ...fontFamily.serif],
sans: ["var(--font-inter)", ...fontFamily.sans],
mono: ["Roboto Mono", "monospace"],
},
maxHeight: (theme) => ({
0: "0",
97: "25rem",
...theme("spacing"),
full: "100%",
screen: "100vh",
}),
minHeight: (theme) => ({
0: "0",
...theme("spacing"),
full: "100%",
screen: "100vh",
}),
minWidth: (theme) => ({
0: "0",
...theme("spacing"),
full: "100%",
screen: "100vw",
}),
maxWidth: (theme, { breakpoints }) => ({
0: "0",
...theme("spacing"),
...breakpoints(theme("screens")),
full: "100%",
screen: "100vw",
}),
backgroundImage: {
"gradient-primary": "radial-gradient(162.05% 170% at 109.58% 35%, #667593 0%, #E3E3E3 100%)",
},
boxShadow: {
dropdown: "0px 5px 20px 0px rgba(0, 0, 0, 0.10), 0px 10px 40px 0px rgba(0, 0, 0, 0.03)",
"switch-thumb": "0px 0.8px 0.8px 0px rgba(0, 0, 0, 0.10), 0px 0.8px 3.2px 0px rgba(0, 0, 0, 0.08)",
"solid-gray-rested":
"0px 2px 3px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.08), 1px 4px 8px 0px rgba(0, 0, 0, 0.12), 0px 2px 0.4px 0px rgba(255, 255, 255, 0.16) inset, 0px -1.5px 2px 0px rgba(0, 0, 0, 0.40) inset",
"solid-gray-hover":
"0px 2px 3px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.08), 1px 4px 8px 0px rgba(0, 0, 0, 0.12), 0px 2px 0.4px 0px rgba(255, 255, 255, 0.16) inset, 0px -2px 2px 0px rgba(0, 0, 0, 0.40) inset",
"solid-gray-active":
"0px 2px 3px 0px rgba(0, 0, 0, 0.40) inset, 0px 0px 2px 1px rgba(0, 0, 0, 0.40) inset",
"outline-gray-rested": "0px 2px 3px 0px rgba(0, 0, 0, 0.03), 0px 2px 2px -1px rgba(0, 0, 0, 0.03)",
"outline-gray-hover": "0px 2px 3px 0px rgba(0, 0, 0, 0.03), 0px 2px 2px -1px rgba(0, 0, 0, 0.03)",
"outline-gray-active": "0px 2px 1px 0px rgba(0, 0, 0, 0.05) inset",
"outline-gray-focused":
"0px 0px 0px 1px rgba(255, 255, 255, 0.20), 0px 0px 0px 2px rgba(0, 0, 0, 0.10)",
"outline-red-rested": "0px 2px 3px 0px rgba(0, 0, 0, 0.03), 0px 2px 2px -1px rgba(0, 0, 0, 0.03)",
"outline-red-hover": "0px 1px 1px 0px rgba(0, 0, 0, 0.06), 0px 2px 3px 0px rgba(0, 0, 0, 0.08)",
"outline-red-active":
"0px 1px 1px 0px rgba(127, 29, 29, 0.06), 0px 0px 3px 0px rgba(127, 29, 29, 0.08), 0px 2px 2px 1px rgba(127, 29, 29, 0.06) inset",
"elevation-low":
"0px 1px 1px 0px rgba(0, 0, 0, 0.07), 0px 1px 2px 0px rgba(0, 0, 0, 0.08), 0px 2px 2px 0px rgba(0, 0, 0, 0.10), 0px 0px 8px 0px rgba(0, 0, 0, 0.05)",
// Brand
"button-solid-brand-default":
" 0px 2px 3px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.08), 1px 4px 8px 0px rgba(0, 0, 0, 0.12), 0px 2px 0.4px 0px rgba(255, 255, 255, 0.12) inset, 0px -3px 2px 0px rgba(0, 0, 0, 0.04) inset;",
"button-solid-brand-hover":
"0px 1px 1px 0px rgba(0, 0, 0, 0.10), 0px 2px 3px 0px rgba(0, 0, 0, 0.08), 1px 4px 8px 0px rgba(0, 0, 0, 0.12), 0px -3px 2px 0px rgba(0, 0, 0, 0.10) inset, 0px 2px 0.4px 0px rgba(255, 255, 255, 0.24) inset",
"button-solid-brand-active":
"0px 3px 1px 0px rgba(0, 0, 0, 0.10) inset, 0px 0px 2px 0px rgba(0, 0, 0, 0.10) inset",
"button-solid-brand-focused":
"0px 0px 0px 1px rgba(255, 255, 255, 0.40), 0px 0px 0px 2px rgba(0, 0, 0, 0.20), 0px 1px 1px 0px rgba(0, 0, 0, 0.10), 0px 2px 3px 0px rgba(0, 0, 0, 0.08), 1px 4px 8px 0px rgba(0, 0, 0, 0.12), 0px -3px 2px 0px rgba(0, 0, 0, 0.10) inset, 0px 2px 0.4px 0px rgba(255, 255, 255, 0.24) inset",
// Outline - red
"button-outline-red-focused":
"0px 0px 0px 1px rgba(255, 255, 255, 0.32), 0px 0px 0px 2px rgba(220, 38, 38, 0.15)",
},
},
},
plugins: [
require("@todesktop/tailwind-variants"),
require("@tailwindcss/forms"),
require("@tailwindcss/typography"),
require("tailwind-scrollbar")({ nocompatible: true }),
require("tailwindcss-radix")(),
require("@savvywombat/tailwindcss-grid-areas"),
plugin(({ addVariant }) => {
addVariant("mac", ".mac &");
addVariant("windows", ".windows &");
addVariant("ios", ".ios &");
}),
plugin(({ addBase, theme }) => {
addBase({
hr: {
borderColor: theme("subtle"),
},
});
}),
plugin(function ({ addVariant }) {
addVariant("enabled", "&:not(:disabled)");
}),
],
variants: {
scrollbar: ["dark"],
},
};
-85
View File
@@ -1,85 +0,0 @@
:root {
/* background */
--cal-bg-emphasis: #e5e7eb;
--cal-bg: white;
--cal-bg-subtle: #f3f4f6;
--cal-bg-muted: #f9fafb;
--cal-bg-inverted: #111827;
/* background -> components*/
--cal-bg-info: #dee9fc;
--cal-bg-success: #e2fbe8;
--cal-bg-attention: #fceed8;
--cal-bg-error: #f9e3e2;
--cal-bg-dark-error: #752522;
/* Borders */
--cal-border-emphasis: #9ca3af;
--cal-border: #d1d5db;
--cal-border-subtle: #e5e7eb;
--cal-border-muted: #f3f4f6;
--cal-border-error: #aa2e26;
/* Content/Text */
--cal-text-emphasis: #111827;
--cal-text: #374151;
--cal-text-subtle: #6b7280;
--cal-text-muted: #9ca3af;
--cal-text-inverted: white;
/* Content/Text -> components */
--cal-text-info: #253985;
--cal-text-success: #285231;
--cal-text-attention: #73321b;
--cal-text-error: hsla(0, 63%, 31%, 1);
/* Brand shenanigans
-> These will be computed for the users theme at runtime.
*/
--cal-brand: #111827;
--cal-brand-emphasis: #101010;
}
/* Darkmode Colors -- TODO: WIP*/
.dark {
/* background */
--cal-bg-emphasis: #2b2b2b;
--cal-bg: #111111;
--cal-bg-subtle: #1c1c1c;
--cal-bg-muted: #101010;
--cal-bg-inverted: #f3f4f6;
/* background -> components*/
--cal-bg-info: #dee9fc;
--cal-bg-success: #e2fbe8;
--cal-bg-attention: #fceed8;
--cal-bg-error: #f9e3e2;
--cal-bg-dark-error: #752522;
/* Borders */
--cal-border-emphasis: #575757;
--cal-border: #444444;
--cal-border-subtle: #2b2b2b;
--cal-border-muted: #1c1c1c;
--cal-border-error: #aa2e26;
/* Content/Text */
--cal-text-emphasis: #f3f4f6;
--cal-text: #d6d6d6;
--cal-text-subtle: #767676;
--cal-text-muted: #575757;
--cal-text-inverted: white;
/* Content/Text -> components */
--cal-text-info: #253985;
--cal-text-success: #285231;
--cal-text-attention: #73321b;
--cal-text-error: #752522;
/* Brand shenanigans
-> These will be computed for the users theme at runtime.
*/
--cal-brand: #111827;
--cal-brand-emphasis: #101010;
}
+8
View File
@@ -0,0 +1,8 @@
@source "../../../apps/web/pages/**/*.{js,ts,jsx,tsx}";
@source "../../../apps/web/app/**/*.{js,ts,jsx,tsx}";
@source "../../../apps/web/modules/**/*.{js,ts,jsx,tsx}";
@source "../../../apps/web/components/**/*.{js,ts,jsx,tsx}";
@source "../../../packages/app-store/**/*{components,pages}/**/*.{js,ts,jsx,tsx}";
@source "../../../packages/features/**/*.{js,ts,jsx,tsx}";
@source "../../../packages/ui/**/*.{js,ts,jsx,tsx}";
@source "../../../packages/platform/atoms/**/*.{js,ts,jsx,tsx}";
+472
View File
@@ -0,0 +1,472 @@
/** This file is used in webapp as well as inside shadow DOM of embed elements. **/
@import "tw-animate-css";
@plugin "@tailwindcss/typography";
@plugin "@tailwindcss/forms";
@plugin "tailwindcss-radix";
@plugin 'tailwind-scrollbar' {
nocompatible: true;
}
@variant pwa (@media (display-mode: standalone));
@variant todesktop (html.todesktop &);
@variant mac (html.todesktop-platform-darwin &);
@variant windows (html.todesktop-platform-win32 &);
@variant linux (html.todesktop-platform-linux &);
@theme inline {
--font-sans: var(--font-sans);
--font-cal: var(--font-cal);
/* Resets the preference from coss-ui which was to "use single --radius variable for all radius values" */
--radius: var(--radius);
--radius-sm: var(--radius-sm);
--radius-md: var(--radius-md);
--radius-lg: var(--radius-lg);
--radius-xl: var(--radius-xl);
--radius-2xl: var(--radius-2xl);
--radius-3xl: var(--radius-3xl);
/* Cal.com Border Radius */
--radius-cal-none: 0px;
--radius-cal-sm: 0.125rem;
--radius-cal: 0.25rem;
--radius-cal-md: 0.375rem;
--radius-cal-lg: 0.5rem;
--radius-cal-xl: 0.75rem;
--radius-cal-2xl: 1rem;
--radius-cal-3xl: 1.5rem;
--radius-cal-full: 9999px;
--color-emphasis: var(--cal-bg-emphasis);
--color-default: var(--cal-bg);
--color-subtle: var(--cal-bg-subtle);
--color-cal-muted: var(--cal-bg-muted);
--color-inverted: var(--cal-bg-inverted);
--color-primary-default: var(--cal-bg-primary);
--color-primary-emphasis: var(--cal-bg-primary-emphasis);
--color-primary-muted: var(--cal-bg-primary-muted);
--color-brand: var(--cal-brand);
--color-brand-default: var(--cal-brand);
--color-brand-emphasis: var(--cal-brand-emphasis);
--color-brand-muted: var(--cal-brand-muted);
--color-brand-subtle: var(--cal-brand-subtle, #9CA3AF);
--color-brand-accent: var(--cal-brand-accent, white);
--color-semantic-info-subtle: var(--cal-bg-semantic-info-subtle);
--color-semantic-info-emphasis: var(--cal-bg-semantic-info-emphasis);
--color-semantic-success-subtle: var(--cal-bg-semantic-success-subtle);
--color-semantic-success-emphasis: var(--cal-bg-semantic-success-emphasis);
--color-semantic-attention-subtle: var(--cal-bg-semantic-attention-subtle);
--color-semantic-attention-emphasis: var(--cal-bg-semantic-attention-emphasis);
--color-semantic-error-subtle: var(--cal-bg-semantic-error-subtle);
--color-semantic-error-emphasis: var(--cal-bg-semantic-error-emphasis);
--color-visualization-1-subtle: var(--cal-bg-visualization-1-subtle);
--color-visualization-1-emphasis: var(--cal-bg-visualization-1-emphasis);
--color-visualization-2-subtle: var(--cal-bg-visualization-2-subtle);
--color-visualization-2-emphasis: var(--cal-bg-visualization-2-emphasis);
--color-visualization-3-subtle: var(--cal-bg-visualization-3-subtle);
--color-visualization-3-emphasis: var(--cal-bg-visualization-3-emphasis);
--color-visualization-4-subtle: var(--cal-bg-visualization-4-subtle);
--color-visualization-4-emphasis: var(--cal-bg-visualization-4-emphasis);
--color-visualization-5-subtle: var(--cal-bg-visualization-5-subtle);
--color-visualization-5-emphasis: var(--cal-bg-visualization-5-emphasis);
--color-visualization-6-subtle: var(--cal-bg-visualization-6-subtle);
--color-visualization-6-emphasis: var(--cal-bg-visualization-6-emphasis);
--color-visualization-7-subtle: var(--cal-bg-visualization-7-subtle);
--color-visualization-7-emphasis: var(--cal-bg-visualization-7-emphasis);
--color-cal-info: var(--cal-bg-info);
--color-cal-success: var(--cal-bg-success);
--color-attention: var(--cal-bg-attention);
--color-error: var(--cal-bg-error);
--color-dark-error: var(--cal-bg-dark-error);
--color-launch-dark: var(--cal-bg-launch-dark);
--color-black: #111111;
--color-darkgray-50: var(--color-gray-50);
--color-darkgray-100: var(--color-gray-100);
--color-darkgray-200: var(--color-gray-200);
--color-darkgray-300: var(--color-gray-300);
--color-darkgray-400: var(--color-gray-400);
--color-darkgray-500: var(--color-gray-500);
--color-darkgray-600: var(--color-gray-600);
--color-darkgray-700: var(--color-gray-700);
--color-darkgray-800: var(--color-gray-800);
--color-darkgray-900: var(--color-gray-900);
--color-darkgray-950: var(--color-gray-950);
/* Cal.com Border Colors */
--border-color-emphasis: var(--cal-border-emphasis);
--border-color-default: var(--cal-border);
--border-color-subtle: var(--cal-border-subtle);
--border-color-muted: var(--cal-border-muted);
--border-color-error: var(--cal-border-error);
--border-color-semantic-error: var(--cal-border-semantic-error);
--border-color-semantic-attention-subtle: var(--cal-border-semantic-attention-subtle);
--border-color-semantic-error-subtle: var(--cal-border-semantic-error-subtle);
--border-color-booker: var(--cal-border-booker);
/* Cal.com Border Widths */
--border-width-booker-width: var(--cal-border-booker-width, 1px);
/* Cal.com Text Colors */
--text-color-emphasis: var(--cal-text-emphasis);
--text-color-default: var(--cal-text);
--text-color-subtle: var(--cal-text-subtle);
--text-color-muted: var(--cal-text-muted);
--text-color-inverted: var(--cal-text-inverted);
--text-color-semantic-info: var(--cal-text-semantic-info);
--text-color-semantic-success: var(--cal-text-semantic-success);
--text-color-semantic-attention: var(--cal-text-semantic-attention);
--text-color-semantic-error: var(--cal-text-semantic-error);
--text-color-semantic-info-emphasis: var(--cal-text-semantic-info-emphasis);
--text-color-semantic-success-emphasis: var(--cal-text-semantic-success-emphasis);
--text-color-semantic-attention-emphasis: var(--cal-text-semantic-attention-emphasis);
--text-color-semantic-error-emphasis: var(--cal-text-semantic-error-emphasis);
--text-color-visualization-1: var(--cal-text-visualization-1);
--text-color-visualization-2: var(--cal-text-visualization-2);
--text-color-visualization-3: var(--cal-text-visualization-3);
--text-color-visualization-4: var(--cal-text-visualization-4);
--text-color-visualization-5: var(--cal-text-visualization-5);
--text-color-visualization-6: var(--cal-text-visualization-6);
--text-color-visualization-7: var(--cal-text-visualization-7);
--text-color-info: var(--cal-text-info);
--text-color-success: var(--cal-text-success);
--text-color-attention: var(--cal-text-attention);
--text-color-error: var(--cal-text-error);
--text-color-brand: var(--cal-brand-text);
/* Default Ring Color */
--default-ring-color: rgb(59 130 246 / 0.5);
/* Cal.com Box Shadows */
--shadow-dropdown: var(--shadow-dropdown);
--shadow-switch-thumb: var(--shadow-switch-thumb);
--shadow-solid-gray-rested: var(--shadow-solid-gray-rested);
--shadow-solid-gray-hover: var(--shadow-solid-gray-hover);
--shadow-solid-gray-active: var(--shadow-solid-gray-active);
--shadow-outline-gray-rested: var(--shadow-outline-gray-rested);
--shadow-outline-gray-hover: var(--shadow-outline-gray-hover);
--shadow-outline-gray-active: var(--shadow-outline-gray-active);
--shadow-outline-gray-focused: var(--shadow-outline-gray-focused);
--shadow-outline-red-rested: var(--shadow-outline-red-rested);
--shadow-outline-red-hover: var(--shadow-outline-red-hover);
--shadow-outline-red-active: var(--shadow-outline-red-active);
--shadow-elevation-low: var(--shadow-elevation-low);
--shadow-button-solid-brand-default: var(--shadow-button-solid-brand-default);
--shadow-button-solid-brand-hover: var(--shadow-button-solid-brand-hover);
--shadow-button-solid-brand-active: var(--shadow-button-solid-brand-active);
--shadow-button-solid-brand-focused: var(--shadow-button-solid-brand-focused);
--shadow-button-outline-red-focused: var(--shadow-button-outline-red-focused);
/* Cal.com Fill Colors */
--fill-emphasis: var(--fill-emphasis);
--fill-default: var(--fill-default);
--fill-subtle: var(--fill-subtle);
--fill-muted: var(--fill-muted);
--fill-inverted: var(--fill-inverted);
--fill-info: var(--fill-info);
--fill-success: var(--fill-success);
--fill-attention: var(--fill-attention);
--fill-error: var(--fill-error);
--fill-brand: var(--fill-brand);
/* Cal.com Animations */
--animate-fade-in-up: fade-in-up 600ms var(--animation-delay, 0ms) cubic-bezier(.21, 1.02, .73, 1) forwards;
--animate-fade-in-bottom: fade-in-bottom cubic-bezier(.21, 1.02, .73, 1) forwards;
--animate-spinning: spinning 0.75s linear infinite;
--animate-drawer-slide-left-and-fade: drawerSlideLeftAndFade 150ms cubic-bezier(0.16, 1, 0.3, 1);
--animate-drawer-slide-right-and-fade: drawerSlideRightAndFade 150ms ease-in;
@keyframes fade-in-up {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: none;
}
}
@keyframes spinning {
100% {
transform: rotate(360deg);
}
}
@keyframes drawerSlideLeftAndFade {
from {
opacity: 0;
transform: translateX(100%);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes drawerSlideRightAndFade {
from {
opacity: 1;
transform: translateX(0);
}
to {
opacity: 0;
transform: translateX(100%);
}
}
}
:root,
:host {
/* 4px */
--radius: 0.25rem;
/* 2px */
--radius-sm: 0.125rem;
/* 6px */
--radius-md: 0.375rem;
/* 8px */
--radius-lg: 0.5rem;
/* 12px */
--radius-xl: 0.75rem;
/* 16px */
--radius-2xl: 1rem;
/* 24px */
--radius-3xl: 1.5rem;
--radius-none: 0px;
/* Background Standard */
--cal-bg-emphasis: hsla(220, 13%, 91%, 1);
--cal-bg: hsla(0, 0%, 100%, 1);
--cal-bg-subtle: hsla(220, 14%, 94%, 1);
--cal-bg-muted: hsla(210, 20%, 97%, 1);
--cal-bg-inverted: hsla(210, 30%, 4%, 1);
/* Background Primary */
--cal-bg-primary: hsla(214, 30%, 16%, 1);
--cal-bg-primary-emphasis: hsla(220, 6%, 25%, 1);
--cal-bg-primary-muted: hsla(220, 14%, 94%, 1);
/* Background Brand */
--cal-bg-brand: hsla(214, 30%, 16%, 1);
--cal-bg-brand-emphasis: hsla(220, 6%, 25%, 1);
--cal-bg-brand-muted: hsla(220, 14%, 94%, 1);
/* Background Semantic */
--cal-bg-semantic-info-subtle: hsla(212, 88%, 97%, 1);
--cal-bg-semantic-info-emphasis: hsla(236, 80%, 25%, 1);
--cal-bg-semantic-success-subtle: hsla(167, 54%, 93%, 1);
--cal-bg-semantic-success-emphasis: hsla(158, 74%, 38%, 1);
--cal-bg-semantic-attention-subtle: hsla(34, 100%, 92%, 1);
--cal-bg-semantic-attention-emphasis: hsla(15, 79%, 34%, 1);
--cal-bg-semantic-error-subtle: hsla(0, 93%, 94%, 1);
--cal-bg-semantic-error-emphasis: hsla(0, 63%, 24%, 1);
/* Background Visualization */
--cal-bg-visualization-1-subtle: hsla(326, 78%, 95%, 1);
--cal-bg-visualization-1-emphasis: hsla(330, 81%, 60%, 1);
--cal-bg-visualization-2-subtle: hsla(256, 86%, 91%, 1);
--cal-bg-visualization-2-emphasis: hsla(256, 85%, 57%, 1);
--cal-bg-visualization-3-subtle: hsla(217, 87%, 91%, 1);
--cal-bg-visualization-3-emphasis: hsla(235, 100%, 63%, 1);
--cal-bg-visualization-4-subtle: hsla(167, 54%, 93%, 1);
--cal-bg-visualization-4-emphasis: hsla(158, 74%, 38%, 1);
--cal-bg-visualization-5-subtle: hsla(55, 97%, 88%, 1);
--cal-bg-visualization-5-emphasis: hsla(45, 93%, 47%, 1);
--cal-bg-visualization-6-subtle: hsla(34, 100%, 92%, 1);
--cal-bg-visualization-6-emphasis: hsla(25, 95%, 53%, 1);
--cal-bg-visualization-7-subtle: hsla(0, 96%, 89%, 1);
--cal-bg-visualization-7-emphasis: hsla(0, 84%, 60%, 1);
/* Legacy Background Components */
--cal-bg-info: hsla(221, 91%, 93%, 1);
--cal-bg-success: hsla(142, 76%, 94%, 1);
--cal-bg-attention: hsla(33, 100%, 92%, 1);
--cal-bg-error: hsla(3, 66%, 93%, 1);
--cal-bg-dark-error: hsla(2, 55%, 30%, 1);
--cal-bg-launch-dark: hsla(242, 53%, 10%, 1);
/* Borders */
--cal-border-emphasis: hsla(218, 11%, 65%, 1);
--cal-border: hsla(216, 12%, 84%, 1);
--cal-border-subtle: hsla(220, 13%, 91%, 1);
--cal-border-muted: hsla(220, 14%, 94%, 1);
--cal-border-error: hsla(0, 96%, 89%, 1);
--cal-border-semantic-error: hsla(0, 96%, 89%, 1);
--cal-border-semantic-attention-subtle: hsla(32, 98%, 83%, 1);
--cal-border-semantic-error-subtle: hsla(0, 96%, 89%, 1);
--cal-border-booker: var(--cal-border-subtle);
/* Content/Text Standard */
--cal-text-emphasis: hsla(210, 30%, 4%, 1);
--cal-text: hsla(220, 6%, 25%, 1);
--cal-text-subtle: hsla(220, 9%, 46%, 1);
--cal-text-muted: hsla(218, 11%, 65%, 1);
--cal-text-inverted: hsla(0, 0%, 100%, 1);
/* Content/Text Semantic */
--cal-text-semantic-info: hsla(236, 80%, 25%, 1);
--cal-text-semantic-success: hsla(150, 84%, 22%, 1);
--cal-text-semantic-attention: hsla(15, 79%, 34%, 1);
--cal-text-semantic-error: hsla(0, 63%, 24%, 1);
/* Content/Text Visualization */
--cal-text-visualization-1: hsla(332, 79%, 25%, 1);
--cal-text-visualization-2: hsla(270, 91%, 25%, 1);
--cal-text-visualization-3: hsla(217, 91%, 25%, 1);
--cal-text-visualization-4: hsla(142, 71%, 25%, 1);
--cal-text-visualization-5: hsla(45, 93%, 25%, 1);
--cal-text-visualization-6: hsla(24, 95%, 25%, 1);
--cal-text-visualization-7: hsla(0, 84%, 25%, 1);
/* Legacy Content/Text Components */
--cal-text-info: hsla(225, 57%, 33%, 1);
--cal-text-success: hsla(144, 34%, 24%, 1);
--cal-text-attention: hsla(16, 62%, 28%, 1);
--cal-text-error: hsla(0, 63%, 31%, 1);
/* Brand */
--cal-brand: hsla(221, 39%, 11%, 1);
--cal-brand-emphasis: hsla(0, 0%, 6%, 1);
--cal-brand-text: hsla(0, 0%, 100%, 1);
/* Box Shadows */
--shadow-dropdown: 0px 5px 20px 0px rgba(0, 0, 0, 0.10), 0px 10px 40px 0px rgba(0, 0, 0, 0.03);
--shadow-switch-thumb: 0px 0.8px 0.8px 0px rgba(0, 0, 0, 0.10), 0px 0.8px 3.2px 0px rgba(0, 0, 0, 0.08);
--shadow-solid-gray-rested: 0px 2px 3px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.08), 1px 4px 8px 0px rgba(0, 0, 0, 0.12), 0px 2px 0.4px 0px rgba(255, 255, 255, 0.16) inset, 0px -1.5px 2px 0px rgba(0, 0, 0, 0.40) inset;
--shadow-solid-gray-hover: 0px 2px 3px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.08), 1px 4px 8px 0px rgba(0, 0, 0, 0.12), 0px 2px 0.4px 0px rgba(255, 255, 255, 0.16) inset, 0px -2px 2px 0px rgba(0, 0, 0, 0.40) inset;
--shadow-solid-gray-active: 0px 2px 3px 0px rgba(0, 0, 0, 0.40) inset, 0px 0px 2px 1px rgba(0, 0, 0, 0.40) inset;
--shadow-outline-gray-rested: 0px 2px 3px 0px rgba(0, 0, 0, 0.03), 0px 2px 2px -1px rgba(0, 0, 0, 0.03);
--shadow-outline-gray-hover: 0px 2px 3px 0px rgba(0, 0, 0, 0.03), 0px 2px 2px -1px rgba(0, 0, 0, 0.03);
--shadow-outline-gray-active: 0px 2px 1px 0px rgba(0, 0, 0, 0.05) inset;
--shadow-outline-gray-focused: 0px 0px 0px 1px rgba(255, 255, 255, 0.20), 0px 0px 0px 2px rgba(0, 0, 0, 0.10);
--shadow-outline-red-rested: 0px 2px 3px 0px rgba(0, 0, 0, 0.03), 0px 2px 2px -1px rgba(0, 0, 0, 0.03);
--shadow-outline-red-hover: 0px 1px 1px 0px rgba(0, 0, 0, 0.06), 0px 2px 3px 0px rgba(0, 0, 0, 0.08);
--shadow-outline-red-active: 0px 1px 1px 0px rgba(127, 29, 29, 0.06), 0px 0px 3px 0px rgba(127, 29, 29, 0.08), 0px 2px 2px 1px rgba(127, 29, 29, 0.06) inset;
--shadow-elevation-low: 0px 1px 1px 0px rgba(0, 0, 0, 0.07), 0px 1px 2px 0px rgba(0, 0, 0, 0.08), 0px 2px 2px 0px rgba(0, 0, 0, 0.10), 0px 0px 8px 0px rgba(0, 0, 0, 0.05);
--shadow-button-solid-brand-default: 0px 2px 3px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.08), 1px 4px 8px 0px rgba(0, 0, 0, 0.12), 0px 2px 0.4px 0px rgba(255, 255, 255, 0.12) inset, 0px -3px 2px 0px rgba(0, 0, 0, 0.04) inset;
--shadow-button-solid-brand-hover: 0px 1px 1px 0px rgba(0, 0, 0, 0.10), 0px 2px 3px 0px rgba(0, 0, 0, 0.08), 1px 4px 8px 0px rgba(0, 0, 0, 0.12), 0px -3px 2px 0px rgba(0, 0, 0, 0.10) inset, 0px 2px 0.4px 0px rgba(255, 255, 255, 0.24) inset;
--shadow-button-solid-brand-active: 0px 3px 1px 0px rgba(0, 0, 0, 0.10) inset, 0px 0px 2px 0px rgba(0, 0, 0, 0.10) inset;
--shadow-button-solid-brand-focused: 0px 0px 0px 1px rgba(255, 255, 255, 0.40), 0px 0px 0px 2px rgba(0, 0, 0, 0.20), 0px 1px 1px 0px rgba(0, 0, 0, 0.10), 0px 2px 3px 0px rgba(0, 0, 0, 0.08), 1px 4px 8px 0px rgba(0, 0, 0, 0.12), 0px -3px 2px 0px rgba(0, 0, 0, 0.10) inset, 0px 2px 0.4px 0px rgba(255, 255, 255, 0.24) inset;
--shadow-button-outline-red-focused: 0px 0px 0px 1px rgba(255, 255, 255, 0.32), 0px 0px 0px 2px rgba(220, 38, 38, 0.15);
/* Fill Colors */
--fill-emphasis: var(--cal-text-emphasis, #111827);
--fill-default: var(--cal-text, #374151);
--fill-subtle: var(--cal-text-subtle, #6B7280);
--fill-muted: var(--cal-text-muted, #9CA3AF);
--fill-inverted: var(--cal-text-inverted, white);
--fill-info: var(--cal-text-info, #253985);
--fill-success: var(--cal-text-success, #285231);
--fill-attention: var(--cal-text-attention, #73321B);
--fill-error: var(--cal-text-error, #752522);
--fill-brand: var(--cal-brand-text);
}
.dark {
/* Background Standard */
--cal-bg-emphasis: hsla(0, 0%, 25%, 1);
--cal-bg: hsla(0, 0%, 6%, 1);
--cal-bg-subtle: hsla(0, 0%, 15%, 1);
--cal-bg-muted: hsla(0, 0%, 9%, 1);
--cal-bg-inverted: hsla(0, 0%, 98%, 1);
/* Background Primary */
--cal-bg-primary: hsla(0, 0%, 96%, 1);
--cal-bg-primary-emphasis: hsla(0, 0%, 64%, 1);
--cal-bg-primary-muted: hsla(0, 0%, 15%, 1);
/* Background Brand */
--cal-bg-brand: hsla(0, 0%, 98%, 1);
--cal-bg-brand-emphasis: hsla(0, 0%, 96%, 1);
--cal-bg-brand-muted: hsla(0, 0%, 96%, 1);
/* Background Semantic */
--cal-bg-semantic-info-subtle: hsla(236, 80%, 8%, 1);
--cal-bg-semantic-info-emphasis: hsla(229, 90%, 74%, 1);
--cal-bg-semantic-success-subtle: hsla(148, 88%, 16%, 1);
--cal-bg-semantic-success-emphasis: hsla(158, 74%, 38%, 1);
--cal-bg-semantic-attention-subtle: hsla(21, 86%, 8%, 1);
--cal-bg-semantic-attention-emphasis: hsla(27, 96%, 61%, 1);
--cal-bg-semantic-error-subtle: hsla(0, 70%, 8%, 1);
--cal-bg-semantic-error-emphasis: hsla(0, 91%, 71%, 1);
/* Background Visualization */
--cal-bg-visualization-1-subtle: hsla(336, 74%, 35%, 1);
--cal-bg-visualization-1-emphasis: hsla(330, 81%, 60%, 1);
--cal-bg-visualization-2-subtle: hsla(252, 83%, 23%, 1);
--cal-bg-visualization-2-emphasis: hsla(256, 85%, 57%, 1);
--cal-bg-visualization-3-subtle: hsla(236, 74%, 35%, 1);
--cal-bg-visualization-3-emphasis: hsla(235, 100%, 63%, 1);
--cal-bg-visualization-4-subtle: hsla(150, 84%, 22%, 1);
--cal-bg-visualization-4-emphasis: hsla(158, 74%, 38%, 1);
--cal-bg-visualization-5-subtle: hsla(28, 73%, 26%, 1);
--cal-bg-visualization-5-emphasis: hsla(45, 93%, 47%, 1);
--cal-bg-visualization-6-subtle: hsla(15, 75%, 23%, 1);
--cal-bg-visualization-6-emphasis: hsla(25, 95%, 53%, 1);
--cal-bg-visualization-7-subtle: hsla(0, 70%, 35%, 1);
--cal-bg-visualization-7-emphasis: hsla(0, 84%, 60%, 1);
/* Legacy Background Components */
--cal-bg-info: hsla(228, 56%, 33%, 1);
--cal-bg-success: hsla(133, 34%, 24%, 1);
--cal-bg-attention: hsla(16, 62%, 28%, 1);
--cal-bg-error: hsla(2, 55%, 30%, 1);
--cal-bg-dark-error: hsla(2, 55%, 30%, 1);
--cal-bg-launch-dark: hsla(242, 53%, 10%, 1);
/* Border Standard */
--cal-border: hsla(0, 0%, 30%, 1);
--cal-border-muted: hsla(0, 0%, 9%, 1);
--cal-border-subtle: hsla(0, 0%, 15%, 1);
--cal-border-emphasis: hsla(0, 0%, 45%, 1);
--cal-border-semantic-error: hsla(0, 63%, 24%, 1);
--cal-border-semantic-attention-subtle: hsla(15, 75%, 23%, 1);
--cal-border-semantic-error-subtle: hsla(0, 63%, 24%, 1);
--cal-border-error: hsla(0, 63%, 24%, 1);
--cal-border-booker: var(--cal-border-subtle);
/* Content/Text Standard */
--cal-text-emphasis: hsla(0, 0%, 98%, 1);
--cal-text: hsla(0, 0%, 83%, 1);
--cal-text-subtle: hsla(0, 0%, 64%, 1);
--cal-text-muted: hsla(0, 0%, 64%, 1);
--cal-text-inverted: hsla(0, 0%, 0%, 1);
/* Content/Text Semantic */
--cal-text-semantic-info: hsla(229, 90%, 74%, 1);
--cal-text-semantic-success: hsla(161, 49%, 54%, 1);
--cal-text-semantic-attention: hsla(27, 96%, 61%, 1);
--cal-text-semantic-error: hsla(0, 91%, 71%, 1);
--cal-text-semantic-info-emphasis: hsla(217, 91%, 25%, 1);
--cal-text-semantic-success-emphasis: hsla(142, 71%, 25%, 1);
--cal-text-semantic-attention-emphasis: hsla(24, 95%, 25%, 1);
--cal-text-semantic-error-emphasis: hsla(0, 84%, 25%, 1);
/* Legacy Content/Text Components */
--cal-text-info: hsla(218, 83%, 93%, 1);
--cal-text-success: hsla(134, 76%, 94%, 1);
--cal-text-attention: hsla(37, 86%, 92%, 1);
--cal-text-error: hsla(3, 66%, 93%, 1);
/* Brand */
--cal-brand: hsla(0, 0%, 100%, 1);
--cal-brand-emphasis: hsla(218, 11%, 65%, 1);
--cal-brand-text: hsla(0, 0%, 0%, 1);
/* Fill Colors */
--fill-emphasis: var(--cal-text-emphasis);
--fill-default: var(--cal-text);
--fill-subtle: var(--cal-text-subtle);
--fill-muted: var(--cal-text-muted);
--fill-inverted: var(--cal-text-inverted);
--fill-info: var(--cal-text-info);
--fill-success: var(--cal-text-success);
--fill-attention: var(--cal-text-attention);
--fill-error: var(--cal-text-error);
--fill-brand: var(--cal-brand-text);
}
+19
View File
@@ -0,0 +1,19 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"css": "./styles.css",
"baseColor": "zinc",
"cssVariables": true
},
"iconLibrary": "lucide",
"aliases": {
"components": "@coss/ui/components",
"utils": "@coss/ui/lib/utils",
"hooks": "@coss/ui/hooks",
"lib": "@coss/ui/lib",
"ui": "@coss/ui/components"
}
}
+67
View File
@@ -0,0 +1,67 @@
import * as React from "react"
import { mergeProps } from "@base-ui-components/react/merge-props"
import { useRender } from "@base-ui-components/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@coss/ui/lib/utils"
const buttonVariants = cva(
"relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-lg border bg-clip-padding text-sm font-medium whitespace-nowrap transition-shadow outline-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
{
variants: {
variant: {
default:
"border-primary bg-primary text-primary-foreground shadow-xs shadow-primary/24 not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] hover:bg-primary/90 [&:is(:active,[data-pressed])]:inset-shadow-[0_1px_--theme(--color-black/8%)] [&:is(:disabled,:active,[data-pressed])]:shadow-none",
outline:
"border-border bg-background shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [&:is(:disabled,:active,[data-pressed])]:shadow-none [&:is(:hover,[data-pressed])]:bg-accent/50 dark:[&:is(:hover,[data-pressed])]:bg-input/64",
secondary:
"border-secondary bg-secondary text-secondary-foreground hover:bg-secondary/90 data-pressed:bg-secondary/90",
destructive:
"border-destructive bg-destructive text-white shadow-xs shadow-destructive/24 not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] hover:bg-destructive/90 [&:is(:active,[data-pressed])]:inset-shadow-[0_1px_--theme(--color-black/8%)] [&:is(:disabled,:active,[data-pressed])]:shadow-none",
"destructive-outline":
"border-border bg-transparent text-destructive-foreground shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [&:is(:disabled,:active,[data-pressed])]:shadow-none [&:is(:hover,[data-pressed])]:border-destructive/32 [&:is(:hover,[data-pressed])]:bg-destructive/4",
ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
link: "border-transparent underline-offset-4 hover:underline",
},
size: {
default:
"min-h-8 px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)]",
xs: "min-h-6 gap-1 rounded-md px-[calc(--spacing(2)-1px)] py-[calc(--spacing(1)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] [&_svg:not([class*='size-'])]:size-3",
sm: "min-h-7 gap-1.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)]",
lg: "min-h-9 px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2)-1px)]",
xl: "min-h-10 px-[calc(--spacing(4)-1px)] py-[calc(--spacing(2)-1px)] text-base [&_svg:not([class*='size-'])]:size-4.5",
icon: "size-8",
"icon-sm": "size-7",
"icon-lg": "size-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
interface ButtonProps extends useRender.ComponentProps<"button"> {
variant?: VariantProps<typeof buttonVariants>["variant"]
size?: VariantProps<typeof buttonVariants>["size"]
}
function Button({ className, variant, size, render, ...props }: ButtonProps) {
const typeValue: React.ButtonHTMLAttributes<HTMLButtonElement>["type"] =
render ? undefined : "button"
const defaultProps = {
"data-slot": "button",
className: cn(buttonVariants({ variant, size, className })),
type: typeValue,
}
return useRender({
defaultTagName: "button",
render,
props: mergeProps<"button">(defaultProps, props),
})
}
export { Button, buttonVariants }
+41
View File
@@ -0,0 +1,41 @@
"use client"
import { Input as InputPrimitive } from "@base-ui-components/react/input"
import { cn } from "@coss/ui/lib/utils"
function Input({
className,
size = "default",
...props
}: Omit<InputPrimitive.Props, "size"> & {
size?: "sm" | "default" | "lg" | number
}) {
return (
<span
data-slot="input-control"
className={cn(
"relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base/5 shadow-xs ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:border-ring has-focus-visible:ring-[3px] has-disabled:opacity-64 has-aria-invalid:border-destructive/36 has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)] dark:has-aria-invalid:ring-destructive/24 [&:has(:disabled,:focus-visible,[aria-invalid])]:shadow-none",
className
)}
>
<InputPrimitive
data-slot="input"
className={cn(
"w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none placeholder:text-muted-foreground/64",
size === "sm" &&
"px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)]",
size === "lg" && "py-[calc(--spacing(2)-1px)]",
props.type === "search" &&
"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none",
props.type === "file" &&
"text-muted-foreground file:me-3 file:bg-transparent file:text-sm file:font-medium file:text-foreground"
)}
size={typeof size === "number" ? size : undefined}
{...props}
/>
</span>
)
}
export { Input }
+6
View File
@@ -0,0 +1,6 @@
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
+16
View File
@@ -0,0 +1,16 @@
{
"name": "@coss/ui",
"private": true,
"version": "0.0.0",
"exports": {
"./styles.css": "./styles.css",
"./components/*": "./components/*.tsx",
"./lib/*": "./lib/*.ts"
},
"dependencies": {
"@base-ui-components/react": "^1.0.0-beta.4",
"class-variance-authority": "^0.4.0",
"clsx": "^2.0.0",
"tailwind-merge": "^2.0.0"
}
}
+156
View File
@@ -0,0 +1,156 @@
@source "./components/**/*.tsx";
@source "./lib/**/*.ts";
@custom-variant dark (&:is(.dark *));
@custom-variant fixed (&:is(.layout-fixed *));
@theme inline {
--breakpoint-3xl: 1600px;
--breakpoint-4xl: 2000px;
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-sans);
--font-heading: var(--font-heading);
--font-mono:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
"Courier New", monospace;
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar: var(--sidebar);
--color-chart-5: var(--chart-5);
--color-chart-4: var(--chart-4);
--color-chart-3: var(--chart-3);
--color-chart-2: var(--chart-2);
--color-chart-1: var(--chart-1);
--color-ring: var(--ring);
--color-input: var(--input);
--color-border: var(--border);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-info: var(--info);
--color-info-foreground: var(--info-foreground);
--color-success: var(--success);
--color-success-foreground: var(--success-foreground);
--color-warning: var(--warning);
--color-warning-foreground: var(--warning-foreground);
--color-accent-foreground: var(--accent-foreground);
--color-accent: var(--accent);
--color-muted-foreground: var(--muted-foreground);
--color-muted: var(--muted);
--color-secondary-foreground: var(--secondary-foreground);
--color-secondary: var(--secondary);
--color-primary-foreground: var(--primary-foreground);
--color-primary: var(--primary);
--color-popover-foreground: var(--popover-foreground);
--color-popover: var(--popover);
--color-card-foreground: var(--card-foreground);
--color-card: var(--card);
--color-code: var(--code);
--color-code-foreground: var(--code-foreground);
--color-code-highlight: var(--code-highlight);
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
}
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.21 0.006 285.885);
--card: oklch(1 0 0);
--card-foreground: oklch(0.21 0.006 285.885);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.21 0.006 285.885);
--primary: oklch(0.274 0.006 286.033);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0 0 0 / 4%);
--secondary-foreground: oklch(0.21 0.006 285.885);
--muted: oklch(0 0 0 / 4%);
--muted-foreground: oklch(0.442 0.017 285.786);
--accent: oklch(0 0 0 / 4%);
--accent-foreground: oklch(0.21 0.006 285.885);
--destructive: oklch(0.637 0.237 25.331);
--destructive-foreground: oklch(0.505 0.213 27.518);
--info: oklch(0.623 0.214 259.815);
--info-foreground: oklch(0.488 0.243 264.376);
--success: oklch(0.696 0.17 162.48);
--success-foreground: oklch(0.508 0.118 165.612);
--warning: oklch(0.769 0.188 70.08);
--warning-foreground: oklch(0.555 0.163 48.998);
--border: oklch(0 0 0 / 10%);
--input: oklch(0 0 0 / 10%);
--ring: oklch(0.705 0.015 286.067);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.21 0.006 285.885);
--sidebar-primary: oklch(0.274 0.006 286.033);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0 0 0 / 4%);
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
--sidebar-border: oklch(0 0 0 / 10%);
--sidebar-ring: oklch(0.705 0.015 286.067);
--code: oklch(1 0 0);
--code-foreground: var(--foreground);
--code-highlight: oklch(0 0 0 / 4%);
}
.dark {
--background: oklch(0.141 0.005 285.823);
--foreground: oklch(0.967 0.001 286.375);
--card: color-mix(in srgb, oklch(0.21 0.006 285.885) 80%, oklch(0.141 0.005 285.823));
--card-foreground: oklch(0.967 0.001 286.375);
--popover: oklch(0.21 0.006 285.885);
--popover-foreground: oklch(0.967 0.001 286.375);
--primary: oklch(0.967 0.001 286.375);
--primary-foreground: oklch(0.21 0.006 285.885);
--secondary: oklch(1 0 0 / 8%);
--secondary-foreground: oklch(0.967 0.001 286.375);
--muted: oklch(1 0 0 / 8%);
--muted-foreground: oklch(0.705 0.015 286.067);
--accent: oklch(1 0 0 / 8%);
--accent-foreground: oklch(0.967 0.001 286.375);
--destructive: oklch(0.637 0.237 25.331);
--destructive-foreground: oklch(0.704 0.191 22.216);
--info: oklch(0.623 0.214 259.815);
--info-foreground: oklch(0.707 0.165 254.624);
--success: oklch(0.696 0.17 162.48);
--success-foreground: oklch(0.765 0.177 163.223);
--warning: oklch(0.769 0.188 70.08);
--warning-foreground: oklch(0.828 0.189 84.429);
--border: oklch(1 0 0 / 12%);
--input: oklch(1 0 0 / 12%);
--ring: oklch(0.552 0.016 285.938);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: color-mix(in srgb, oklch(0.21 0.006 285.885) 32%, oklch(0.141 0.005 285.823));
--sidebar-foreground: oklch(0.967 0.001 286.375);
--sidebar-primary: oklch(0.967 0.001 286.375);
--sidebar-primary-foreground: oklch(0.21 0.006 285.885);
--sidebar-accent: oklch(1 0 0 / 8%);
--sidebar-accent-foreground: oklch(0.967 0.001 286.375);
--sidebar-border: oklch(1 0 0 / 12%);
--sidebar-ring: oklch(0.705 0.015 286.067);
--code: color-mix(in srgb, oklch(0.21 0.006 285.885) 80%, oklch(0.141 0.005 285.823));
--code-foreground: var(--foreground);
--code-highlight: oklch(1 0 0 / 8%);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
}
-143
View File
@@ -1,143 +0,0 @@
module.exports = {
mode: "jit",
theme: {
screens: {
sm: { max: "600px" },
},
extend: {
spacing: {
screen: "100vw",
full: "100%",
px: "1px",
0: "0",
2: "2px",
3: "3px",
4: "4px",
5: "5px",
6: "6px",
7: "7px",
8: "8px",
9: "9px",
10: "10px",
11: "11px",
12: "12px",
14: "14px",
16: "16px",
20: "20px",
24: "24px",
28: "28px",
32: "32px",
36: "36px",
40: "40px",
44: "44px",
48: "48px",
52: "52px",
56: "56px",
60: "60px",
64: "64px",
72: "72px",
80: "80px",
96: "96px",
600: "600px",
"1/2": "50%",
"1/3": "33.333333%",
"2/3": "66.666667%",
"1/4": "25%",
"2/4": "50%",
"3/4": "75%",
"1/5": "20%",
"2/5": "40%",
"3/5": "60%",
"4/5": "80%",
"1/6": "16.666667%",
"2/6": "33.333333%",
"3/6": "50%",
"4/6": "66.666667%",
"5/6": "83.333333%",
"1/12": "8.333333%",
"2/12": "16.666667%",
"3/12": "25%",
"4/12": "33.333333%",
"5/12": "41.666667%",
"6/12": "50%",
"7/12": "58.333333%",
"8/12": "66.666667%",
"9/12": "75%",
"10/12": "83.333333%",
"11/12": "91.666667%",
},
borderRadius: {
none: "0px",
sm: "2px",
DEFAULT: "4px",
md: "6px",
lg: "8px",
xl: "12px",
"2xl": "16px",
"3xl": "24px",
full: "9999px",
},
fontFamily: {
sans: ["ui-sans-serif", "system-ui", "-apple-system", '"Segoe UI"', "sans-serif"],
serif: ["ui-serif", "Georgia", "Cambria", '"Times New Roman"', "Times", "serif"],
mono: ["ui-monospace", "Menlo", "Consolas", "monospace"],
},
fontSize: {
0: "0",
xs: "12px",
sm: "14px",
base: "16px",
lg: "18px",
xl: "20px",
"2xl": "24px",
"3xl": "30px",
"4xl": "36px",
"5xl": "48px",
"6xl": "60px",
"7xl": "72px",
"8xl": "96px",
"9xl": "128px",
},
inset: (theme) => ({
...theme("spacing"),
}),
letterSpacing: (theme) => ({
...theme("spacing"),
}),
lineHeight: (theme) => ({
...theme("spacing"),
}),
maxHeight: (theme) => ({
...theme("spacing"),
}),
maxWidth: (theme) => ({
...theme("spacing"),
xs: "160px",
sm: "192px",
md: "224px",
lg: "256px",
xl: "288px",
"2xl": "336px",
"3xl": "384px",
"4xl": "448px",
"5xl": "512px",
"6xl": "576px",
"7xl": "640px",
}),
minHeight: (theme) => ({
...theme("spacing"),
}),
minWidth: (theme) => ({
...theme("spacing"),
}),
},
},
corePlugins: {
animation: false,
backgroundOpacity: false,
borderOpacity: false,
divideOpacity: false,
placeholderOpacity: false,
textOpacity: false,
},
};
+364 -346
View File
@@ -1,239 +1,243 @@
<html>
<head>
<title>Embed Playground</title>
<style>
html.grid-row-gap body {
grid-row-gap: 10rem;
flex-flow: column;
display: flex;
}
</style>
<script type="text/javascript" src="./playground/lib/playground-init.ts"></script>
<script>
let popupRescheduleUid = null;
let popupCancelUid = null;
let calLink = null;
const initialNamespace = (url.searchParams.get("only") || "").split("ns:")[1] || "";
(function defineVariables() {
const searchParams = new URL(document.URL).searchParams;
popupRescheduleUid = searchParams.get("popupRescheduleUid") || "qm3kwt3aTnVD7vmP9tiT2f";
popupCancelUid = searchParams.get("popupCancelUid") || "qm3kwt3aTnVD7vmP9tiT2f";
calLink = searchParams.get("calLink");
})()
if (!location.search.includes("nonResponsive")) {
document.write('<meta name="viewport" content="width=device-width"/>');
}
if (location.search.includes("grid-row-gap")) {
document.documentElement.classList.add("grid-row-gap");
}
function addInlineEmbedInNewNamespaceWithoutReload(selector) {
Cal("init", "withoutReloadNamespace", {
debug: true,
calOrigin: window.calOrigin,
});
<head>
<title>Embed Playground</title>
<style>
html.grid-row-gap body {
grid-row-gap: 10rem;
flex-flow: column;
display: flex;
}
</style>
<script type="text/javascript" src="./playground/lib/playground-init.ts"></script>
<script>
let popupRescheduleUid = null;
let popupCancelUid = null;
let calLink = null;
const initialNamespace = (url.searchParams.get("only") || "").split("ns:")[1] || "";
(function defineVariables() {
const searchParams = new URL(document.URL).searchParams;
popupRescheduleUid = searchParams.get("popupRescheduleUid") || "qm3kwt3aTnVD7vmP9tiT2f";
popupCancelUid = searchParams.get("popupCancelUid") || "qm3kwt3aTnVD7vmP9tiT2f";
calLink = searchParams.get("calLink");
})()
Cal.ns.withoutReloadNamespace("inline", {
elementOrSelector: selector,
calLink: "pro?case=addInlineEmbedInANewNamespaceWithoutReload",
config: {
"flag.coep":"true"
}
});
};
</script>
<script>
// Put the snippet in a function so that it can be re-executed for scenario testing
// TODO: How to reuse embed-snippet export here?
function embedSnippet() {
(function (C, A, L) {
if (!location.search.includes("nonResponsive")) {
document.write('<meta name="viewport" content="width=device-width"/>');
}
if (location.search.includes("grid-row-gap")) {
document.documentElement.classList.add("grid-row-gap");
}
function addInlineEmbedInNewNamespaceWithoutReload(selector) {
Cal("init", "withoutReloadNamespace", {
debug: true,
calOrigin: window.calOrigin,
});
Cal.ns.withoutReloadNamespace("inline", {
elementOrSelector: selector,
calLink: "pro?case=addInlineEmbedInANewNamespaceWithoutReload",
config: {
"flag.coep": "true"
}
});
};
</script>
<script>
// Put the snippet in a function so that it can be re-executed for scenario testing
// TODO: How to reuse embed-snippet export here?
function embedSnippet() {
(function (C, A, L) {
let p = function (a, ar) {
a.q.push(ar);
};
let d = C.document;
C.Cal =
C.Cal ||
function () {
let cal = C.Cal;
let ar = arguments;
if (!cal.loaded) {
cal.ns = {};
cal.q = cal.q || [];
d.head.appendChild(d.createElement("script")).src = A;
cal.loaded = true;
}
if (ar[0] === L) {
const api = function () {
p(api, arguments);
};
const namespace = ar[1];
api.q = api.q || [];
if (typeof namespace === "string"){
// Make sure that even after re-execution of the snippet, the namespace is not overridden
cal.ns[namespace] = cal.ns[namespace] || api;
p(cal.ns[namespace], ar);
p(cal, ['initNamespace', namespace])
} else p(cal, ar);
return;
}
p(cal, ar);
};
})(window, window.calOrigin + "/embed/embed.js", "init");
}
C.Cal =
C.Cal ||
function () {
let cal = C.Cal;
let ar = arguments;
if (!cal.loaded) {
cal.ns = {};
cal.q = cal.q || [];
d.head.appendChild(d.createElement("script")).src = A;
cal.loaded = true;
}
if (ar[0] === L) {
const api = function () {
p(api, arguments);
};
const namespace = ar[1];
api.q = api.q || [];
if (typeof namespace === "string") {
// Make sure that even after re-execution of the snippet, the namespace is not overridden
cal.ns[namespace] = cal.ns[namespace] || api;
p(cal.ns[namespace], ar);
p(cal, ['initNamespace', namespace])
} else p(cal, ar);
return;
}
p(cal, ar);
};
})(window, window.calOrigin + "/embed/embed.js", "init");
}
embedSnippet();
</script>
<script>
function doubleInstallSnippetWithInlineEmbedWithNonDefaultNamespace(selector) {
Cal("init", "doubleInstall", {
debug: true,
calOrigin: window.calOrigin,
});
Cal.ns.doubleInstall("inline", {
elementOrSelector: selector,
calLink: "pro?case=doubleInstallSnippetWithInlineEmbedWithNonDefaultNamespace",
config: {
"flag.coep": "true"
}
});
embedSnippet();
</script>
<script>
function doubleInstallSnippetWithInlineEmbedWithNonDefaultNamespace(selector) {
Cal("init", "doubleInstall", {
debug: true,
calOrigin: window.calOrigin,
});
Cal.ns.doubleInstall("inline", {
elementOrSelector: selector,
calLink: "pro?case=doubleInstallSnippetWithInlineEmbedWithNonDefaultNamespace",
config: {
"flag.coep":"true"
}
});
embedSnippet();
Cal("init", "doubleInstall", {
debug: true,
calOrigin: window.calOrigin,
});
Cal.ns.doubleInstall("inline", {
elementOrSelector: selector,
calLink: "pro",
config: {
"flag.coep":"true"
}
});
Cal("init", "doubleInstall", {
debug: true,
calOrigin: window.calOrigin,
});
Cal.ns.doubleInstall("inline", {
elementOrSelector: selector,
calLink: "pro",
config: {
"flag.coep": "true"
}
});
}
function doubleInstallSnippetWithInlineEmbed(selector) {
Cal("init", {
debug: true,
calOrigin: window.calOrigin,
});
Cal("inline", {
elementOrSelector: selector,
calLink: "pro?case=doubleInstallSnippetWithInlineEmbed",
config: {
"flag.coep":"true"
}
});
embedSnippet();
Cal("init", {
debug: true,
calOrigin: window.calOrigin,
});
Cal("inline", {
elementOrSelector: selector,
calLink: "pro",
config: {
"flag.coep":"true"
}
});
function doubleInstallSnippetWithInlineEmbed(selector) {
Cal("init", {
debug: true,
calOrigin: window.calOrigin,
});
Cal("inline", {
elementOrSelector: selector,
calLink: "pro?case=doubleInstallSnippetWithInlineEmbed",
config: {
"flag.coep": "true"
}
});
embedSnippet();
Cal("init", {
debug: true,
calOrigin: window.calOrigin,
});
Cal("inline", {
elementOrSelector: selector,
calLink: "pro",
config: {
"flag.coep": "true"
}
});
}
function addTwoInlineEmbedWithTwoDifferentNamespacesWithDifferentInitConfig() {
Cal("init", "namespace-init-test-1", {
debug: true,
calOrigin: window.calOrigin,
});
Cal("init", "namespace-init-test-2", {
debug: true,
calOrigin: "http://127.0.0.1:3000",
});
Cal.ns['namespace-init-test-2']("inline", {
elementOrSelector: '#two-different-namespace-with-different-init-config-content-2',
calLink: "pro",
config: {
"flag.coep":"true"
}
});
Cal.ns['namespace-init-test-1']("inline", {
elementOrSelector: '#two-different-namespace-with-different-init-config-content-1',
calLink: "pro",
config: {
"flag.coep":"true"
}
});
function addTwoInlineEmbedWithTwoDifferentNamespacesWithDifferentInitConfig() {
Cal("init", "namespace-init-test-1", {
debug: true,
calOrigin: window.calOrigin,
});
Cal("init", "namespace-init-test-2", {
debug: true,
calOrigin: "http://127.0.0.1:3000",
});
Cal.ns['namespace-init-test-2']("inline", {
elementOrSelector: '#two-different-namespace-with-different-init-config-content-2',
calLink: "pro",
config: {
"flag.coep": "true"
}
</script>
<style>
body {
background: linear-gradient(
90deg,
});
Cal.ns['namespace-init-test-1']("inline", {
elementOrSelector: '#two-different-namespace-with-different-init-config-content-1',
calLink: "pro",
config: {
"flag.coep": "true"
}
});
}
</script>
<style>
body {
background: linear-gradient(90deg,
rgba(120, 116, 186, 1) 0%,
rgba(221, 221, 255, 1) 41%,
rgba(148, 232, 249, 1) 100%
);
}
.inline-embed-container {
/* border: 1px solid black; */
margin-bottom: 5px;
border-bottom: 1px solid;
}
rgba(148, 232, 249, 1) 100%);
}
.loader {
color: green;
}
* {
--cal-brand-color: gray;
}
</style>
</head>
<body>
<div style="margin-bottom: 20px;">
<h2>Different variations of the page</h2>
<div style="display: flex; flex-flow: row; gap: 10px;">
<span style="display: block"><a href="?color-scheme=dark">With Dark Color Scheme for the Page</a></span>
<span style="display: block"><a href="?nonResponsive">Non responsive version of this page here</a></span>
<span style="display: block"><a href="?grid-row-gap">Grid row gap version of this page here</a></span>
.inline-embed-container {
/* border: 1px solid black; */
margin-bottom: 5px;
border-bottom: 1px solid;
}
.loader {
color: green;
}
</style>
</head>
<body>
<div style="margin-bottom: 20px;">
<h2>Different variations of the page</h2>
<div style="display: flex; flex-flow: row; gap: 10px;">
<span style="display: block"><a href="?color-scheme=dark">With Dark Color Scheme for the Page</a></span>
<span style="display: block"><a href="?nonResponsive">Non responsive version of this page here</a></span>
<span style="display: block"><a href="?grid-row-gap">Grid row gap version of this page here</a></span>
</div>
</div>
<div id="misc-embeds">
<h2>Misc Embeds</h2>
<div>
<button id="add-inline-embed-in-a-new-namespace-without-reload-button"
onclick="addInlineEmbedInNewNamespaceWithoutReload('#add-inline-embed-in-a-new-namespace-without-reload-button-content')">Add
Inline Embed in a new namespace without reload</button>
<div id="add-inline-embed-in-a-new-namespace-without-reload-button-content"></div>
</div>
<div id="misc-embeds">
<h2>Misc Embeds</h2>
<div>
<button id="add-inline-embed-in-a-new-namespace-without-reload-button" onclick="addInlineEmbedInNewNamespaceWithoutReload('#add-inline-embed-in-a-new-namespace-without-reload-button-content')">Add Inline Embed in a new namespace without reload</button>
<div id="add-inline-embed-in-a-new-namespace-without-reload-button-content"></div>
<div>
<button id="double-install-snippet-with-inline-embed-default-namespace-button"
onclick="doubleInstallSnippetWithInlineEmbed('#double-install-snippet-with-inline-embed-default-namespace-content')">Double
Install Embed Snippet with inline embed - Default Namespace</button>
<div id="double-install-snippet-with-inline-embed-default-namespace-content"></div>
</div>
<div>
<button id="double-install-snippet-with-inline-embed-non-default-namespace-button"
onclick="doubleInstallSnippetWithInlineEmbedWithNonDefaultNamespace('#double-install-snippet-with-inline-embed-non-default-namespace-content')">Double
Install Embed Snippet with inline embed - Non Default Namespace</button>
<div id="double-install-snippet-with-inline-embed-non-default-namespace-content"></div>
</div>
<div>
<button id="two-different-namespace-with-different-init-config"
onclick="addTwoInlineEmbedWithTwoDifferentNamespacesWithDifferentInitConfig()">Two different namespace with two
different config</button>
<div id="two-different-namespace-with-different-init-config-area">
<div id="two-different-namespace-with-different-init-config-content-1"></div>
<div id="two-different-namespace-with-different-init-config-content-2"></div>
</div>
<div>
<button id="double-install-snippet-with-inline-embed-default-namespace-button" onclick="doubleInstallSnippetWithInlineEmbed('#double-install-snippet-with-inline-embed-default-namespace-content')">Double Install Embed Snippet with inline embed - Default Namespace</button>
<div id="double-install-snippet-with-inline-embed-default-namespace-content"></div>
</div>
<div>
<button id="double-install-snippet-with-inline-embed-non-default-namespace-button" onclick="doubleInstallSnippetWithInlineEmbedWithNonDefaultNamespace('#double-install-snippet-with-inline-embed-non-default-namespace-content')">Double Install Embed Snippet with inline embed - Non Default Namespace</button>
<div id="double-install-snippet-with-inline-embed-non-default-namespace-content"></div>
</div>
<div>
<button id="two-different-namespace-with-different-init-config" onclick="addTwoInlineEmbedWithTwoDifferentNamespacesWithDifferentInitConfig()">Two different namespace with two different config</button>
<div id="two-different-namespace-with-different-init-config-area">
<div id="two-different-namespace-with-different-init-config-content-1"></div>
<div id="two-different-namespace-with-different-init-config-content-2"></div>
</div>
</div>
<span style="display: block">
<a href="?name=john&email=email&guests=abc&guests=def&notes=NOTES&location=%7B%22optionValue%22%3A%22%2B919999999999%22%2C%22value%22%3A%22phone%22%7D&only=ns%3ApageParamsForwarding">
Page Params Forwarding(Prefills various fields by auto-forwarding query params)
</a>
</span>
<span style="display: block"
><a href="?only=prerender-test">Go to Prerender test page only</a><small></small
></span>
<span style="display: block"
><a href="?only=preload-test">Go to Preload test page only</a><small></small
></span>
<button onclick="document.documentElement.style.colorScheme='dark'">Toggle Dark Scheme(For Embedding Page)</button>
<button onclick="document.documentElement.style.colorScheme='light'">Toggle Light Scheme(For Embedding Page)</button>
<div>
<script>
if (only === "all" || only === "prerender-test") {
document.write(`
</div>
<span style="display: block">
<a
href="?name=john&email=email&guests=abc&guests=def&notes=NOTES&location=%7B%22optionValue%22%3A%22%2B919999999999%22%2C%22value%22%3A%22phone%22%7D&only=ns%3ApageParamsForwarding">
Page Params Forwarding(Prefills various fields by auto-forwarding query params)
</a>
</span>
<span style="display: block"><a href="?only=prerender-test">Go to Prerender test page only</a><small></small></span>
<span style="display: block"><a href="?only=preload-test">Go to Preload test page only</a><small></small></span>
<button onclick="document.documentElement.style.colorScheme='dark'">Toggle Dark Scheme(For Embedding Page)</button>
<button onclick="document.documentElement.style.colorScheme='light'">Toggle Light Scheme(For Embedding
Page)</button>
<div>
<script>
if (only === "all" || only === "prerender-test") {
document.write(`
<button data-cal-namespace="e2ePrerenderLightTheme" data-cal-config='{"theme":"dark", "email":"[email protected]", "name": "Preloaded Prefilled", "flag.coep": "true"}' data-cal-link="free/30min">Book with Free User[Dark Theme]</button>
<i
>Corresponding Cal Link is being prerendered. Assuming that it would take you some time to click this
@@ -241,104 +245,105 @@
local]. Try switching to slow 3G or create a custom Network configuration which is impossibly
slow. This should be used if you know beforehand which type of embed is going to be opened.</i
>`);
}
if (only === "all" || only === "preload-test") {
document.write(`
}
if (only === "all" || only === "preload-test") {
document.write(`
<button data-cal-namespace="preloadTest" data-cal-config='{"theme":"dark", "email":"[email protected]", "name": "Preloaded Prefilled", "flag.coep": "true"}' data-cal-link="free/30min">Book with Free User[Dark Theme]</button>
<i
>Corresponding Cal Link is being preloaded. That means that all the resources would be preloaded. This could be useful in preloading possible resources if you don't know before hand which type of embed you want to show</i
>`);
}
</script>
</div>
<span style="display: block"
><a href="?only=all">Render All embeds together</a><small> - It would be slow to load</small></span
>
<div>
<a href="?only=ns:floatingButton">Floating Popup</a>
}
</script>
</div>
<span style="display: block"><a href="?only=all">Render All embeds together</a><small> - It would be slow to
load</small></span>
<a href="?only=ns:floatingButton">Floating Popup</a>
<h2>Popup Examples - Theme Tests</h2>
<button data-cal-namespace="e2ePopupLightTheme" data-cal-link="free"
data-cal-config='{"theme":"light", "flag.coep": "true"}'>Book an event with Free[Light Theme]</button>
<button data-cal-namespace="popupAutoTheme" data-cal-link="free" data-cal-config='{"flag.coep": "true"}'>
Book with Free User[Auto Theme]
</button>
<button data-cal-namespace="popupDarkTheme" data-cal-config='{"theme":"dark", "flag.coep": "true"}'
data-cal-link="free">
Book with Free User[Dark Theme]
</button>
<button data-cal-namespace="popupTeamLinkLightTheme" data-cal-config='{"theme":"light", "flag.coep": "true"}'
data-cal-link="team/seeded-team/collective-seeded-team-event">
Book with Test Team[Light Theme]
</button>
<button data-cal-namespace="popupTeamLinkDarkTheme" data-cal-config='{"theme":"dark", "flag.coep": "true"}'
data-cal-link="team/seeded-team/collective-seeded-team-event">
Book with Test Team[Dark Theme]
</button>
<button data-cal-namespace="popupTeamLinksList" data-cal-link="team/seeded-team/"
data-cal-config='{"flag.coep": "true"}'>
See Team Links [Auto Theme]
</button>
<button data-cal-namespace="popupPaidEvent" data-cal-link="pro/paid" data-cal-config='{"flag.coep": "true"}'>
Book Paid Event [Auto Theme]
</button>
<h2>Popup Examples - Reschedule Tests</h2>
<script>
document.write(
`<button data-cal-namespace="popupRescheduleWithReschedulePath" data-cal-config='{"flag.coep":"true"}' data-cal-link="reschedule/${popupRescheduleUid}">Reschedule Event(with /reschedule) - Needs popupRescheduleUid param</button>`
);
</script>
<script>
document.write(
`<button data-cal-namespace="popupRescheduleWithRescheduleUidParam" data-cal-config='{"flag.coep":"true", "rescheduleUid": "${popupRescheduleUid}"}' data-cal-link="${calLink}">Reschedule Event(with rescheduleUid param) - Needs popupRescheduleUid and calLink param</button>`
);
</script>
<h2>Popup Examples - Cancel Tests</h2>
<script>
document.write(
`<button data-cal-namespace="popupCancelBooking" data-cal-config='{"flag.coep":"true"}' data-cal-link="booking/${popupCancelUid}?cancel=true">Cancel Booking - Needs popupCancelUid param</button>`
);
</script>
<h2>Popup Examples - Different Configurations</h2>
<button data-cal-namespace="popupHideEventTypeDetails" data-cal-link="free/30min"
data-cal-config='{"flag.coep": "true"}'>
Book Free Event [Auto Theme][uiConfig.hideEventTypeDetails=true]
</button>
<button data-cal-namespace="popupPaidEvent" data-cal-config='{"layout":"week_view", "flag.coep": "true"}'
data-cal-link="pro/paid">
Book Paid Event - weekly view
</button>
<button data-cal-namespace="popupPaidEvent" data-cal-config='{"layout":"column_view", "flag.coep": "true"}'
data-cal-link="pro/paid">
Book Paid Event - column view
</button>
<h2>Popup Examples - Routing Form Tests</h2>
<button data-cal-namespace="routingFormAuto" data-cal-link="forms/948ae412-d995-4865-875a-48302588de03"
data-cal-config='{"flag.coep": "true"}'>
Book through Routing Form [Auto Theme] - Test for 'routed' event
</button>
<button data-cal-namespace="routingFormDark" data-cal-config='{"theme":"dark", "flag.coep": "true"}'
data-cal-link="forms/948ae412-d995-4865-875a-48302588de03">
Book through Routing Form [Dark Theme]
</button>
<button data-cal-namespace="routingFormHeadlessRouter"
data-cal-link="router?form=948ae412-d995-4865-875a-48302588de03&Test field=event-routing"
data-cal-config='{"flag.coep": "true"}'>
Book through Headless Router
</button>
<h2>Popup Examples - Child Element Target Tests</h2>
<a style="display: block;" data-cal-namespace="childElementTarget" href="javascript:void(0)"
data-cal-link="free/30min" data-cal-config='{"flag.coep": "true"}'>
I am Anchor
<b>[I am Bold inside anchor]</b>
<span>
I am span inside anchor
</span>
</a>
<h2>Popup Examples - Theme Tests</h2>
<button data-cal-namespace="e2ePopupLightTheme" data-cal-link="free" data-cal-config='{"theme":"light", "flag.coep": "true"}'>Book an event with Free[Light Theme]</button>
<button data-cal-namespace="popupAutoTheme" data-cal-link="free" data-cal-config='{"flag.coep": "true"}'>
Book with Free User[Auto Theme]
</button>
<button data-cal-namespace="popupDarkTheme" data-cal-config='{"theme":"dark", "flag.coep": "true"}' data-cal-link="free">
Book with Free User[Dark Theme]
</button>
<button
data-cal-namespace="popupTeamLinkLightTheme"
data-cal-config='{"theme":"light", "flag.coep": "true"}'
data-cal-link="team/seeded-team/collective-seeded-team-event">
Book with Test Team[Light Theme]
</button>
<button
data-cal-namespace="popupTeamLinkDarkTheme"
data-cal-config='{"theme":"dark", "flag.coep": "true"}'
data-cal-link="team/seeded-team/collective-seeded-team-event">
Book with Test Team[Dark Theme]
</button>
<button data-cal-namespace="popupTeamLinksList" data-cal-link="team/seeded-team/" data-cal-config='{"flag.coep": "true"}'>
See Team Links [Auto Theme]
</button>
<button data-cal-namespace="popupPaidEvent" data-cal-link="pro/paid" data-cal-config='{"flag.coep": "true"}'>
Book Paid Event [Auto Theme]
</button>
<h2>Popup Examples - Reschedule Tests</h2>
<script>
document.write(
`<button data-cal-namespace="popupRescheduleWithReschedulePath" data-cal-config='{"flag.coep":"true"}' data-cal-link="reschedule/${popupRescheduleUid}">Reschedule Event(with /reschedule) - Needs popupRescheduleUid param</button>`
);
</script>
<script>
document.write(
`<button data-cal-namespace="popupRescheduleWithRescheduleUidParam" data-cal-config='{"flag.coep":"true", "rescheduleUid": "${popupRescheduleUid}"}' data-cal-link="${calLink}">Reschedule Event(with rescheduleUid param) - Needs popupRescheduleUid and calLink param</button>`
);
</script>
<h2>Popup Examples - Cancel Tests</h2>
<script>
document.write(
`<button data-cal-namespace="popupCancelBooking" data-cal-config='{"flag.coep":"true"}' data-cal-link="booking/${popupCancelUid}?cancel=true">Cancel Booking - Needs popupCancelUid param</button>`
);
</script>
<h2>Popup Examples - Different Configurations</h2>
<button data-cal-namespace="popupHideEventTypeDetails" data-cal-link="free/30min" data-cal-config='{"flag.coep": "true"}'>
Book Free Event [Auto Theme][uiConfig.hideEventTypeDetails=true]
</button>
<button data-cal-namespace="popupPaidEvent" data-cal-config='{"layout":"week_view", "flag.coep": "true"}' data-cal-link="pro/paid">
Book Paid Event - weekly view
</button>
<button data-cal-namespace="popupPaidEvent" data-cal-config='{"layout":"column_view", "flag.coep": "true"}' data-cal-link="pro/paid">
Book Paid Event - column view
</button>
<h2>Popup Examples - Routing Form Tests</h2>
<button data-cal-namespace="routingFormAuto" data-cal-link="forms/948ae412-d995-4865-875a-48302588de03" data-cal-config='{"flag.coep": "true"}'>
Book through Routing Form [Auto Theme] - Test for 'routed' event
</button>
<button
data-cal-namespace="routingFormDark"
data-cal-config='{"theme":"dark", "flag.coep": "true"}'
data-cal-link="forms/948ae412-d995-4865-875a-48302588de03">
Book through Routing Form [Dark Theme]
</button>
<button data-cal-namespace="routingFormHeadlessRouter" data-cal-link="router?form=948ae412-d995-4865-875a-48302588de03&Test field=event-routing" data-cal-config='{"flag.coep": "true"}'>
Book through Headless Router
</button>
<h2>Popup Examples - Child Element Target Tests</h2>
<a style="display: block;" data-cal-namespace="childElementTarget" href="javascript:void(0)" data-cal-link="free/30min" data-cal-config='{"flag.coep": "true"}'>
I am Anchor
<b>[I am Bold inside anchor]</b>
<span>
I am span inside anchor
</span>
</a>
</div>
<h2>Inline Embed Examples</h2>
<div id="namespaces-test">
<div class="inline-embed-container" id="cal-booking-place-default">
<h3>
<a href="?only=ns:default">[Dark Theme][Guests([email protected] and [email protected])](Default Namespace)</a>
<a href="?only=ns:default">[Dark Theme][Guests([email protected] and [email protected])](Default
Namespace)</a>
</h3>
<button onclick="Cal('ui',{theme:'light'})">Toggle to Light</button>
<button onclick="Cal('ui',{layout:'week_view'})">Toggle to Week View</button>
@@ -357,34 +362,36 @@
If you render booking embed in me, I won't restrict you. The entire page is yours. Content is by
default aligned center
</div>
<button onclick="heavilyCustomizeUi({ namespace: 'second' })">
Heavily customize UI
</button>
<button
onclick="(function () {Cal.ns.second('ui', {cssVarsPerTheme:{light:{'cal-border-booker':'green', 'cal-border-booker-width':'20px'},dark:{'cal-border-booker':'red', 'cal-border-booker-width':'5px'}}})})()">
Change booker border for dark and light themes
</button>
<button onclick="fakeErrorScenario({ namespace: 'second' })">
Create error scenario
</button>
<button
onclick="(function () {Cal.ns.second('ui', {cssVarsPerTheme:{light:{'cal-brand':'green'},dark:{'cal-brand':'red'}}})})()">
Change Brand color for dark and light theme
</button>
onclick="(function () {Cal.ns.second('ui', {cssVarsPerTheme:{light:{'cal-brand':'green'},dark:{'cal-brand':'red'}}})})()">
Change Brand color for dark and light theme
</button>
<button
onclick="(function () {Cal.ns.second('ui', {styles:{eventTypeListItem:{backgroundColor:'blue'}}})})()">
Change <code>eventTypeListItem</code> bg color[Deprecated]
</button>
<button onclick="(function () {Cal.ns.second('ui', {styles:{body:{background:'red'}}})})()">
Change <code>body</code> bg color[Deprecated]
</button>
<button onclick="(function () {Cal.ns.second('ui', {styles:{align:'left'}})})()">
Align left[Deprecated]
</button>
<button onclick="(function () {Cal.ns.second('ui', {styles:{align:'center'}})})()">
Align Center[Deprecated]
</button>
<button
onclick="(function () {Cal.ns.second('ui', {styles:{enabledDateButton: {
backgroundColor: window.generateRandomHexColor(),
},
disabledDateButton: {
backgroundColor: window.generateRandomHexColor(),
},}})})()">
<button onclick="(function () {Cal.ns.second('ui', {styles:{enabledDateButton: {
backgroundColor: window.generateRandomHexColor(),
},
disabledDateButton: {
backgroundColor: window.generateRandomHexColor(),
},}})})()">
Change 'enabledDateButton` and `disabledDateButton` background Color[Deprecated]
</button>
</div>
@@ -429,20 +436,27 @@
<div class="place"></div>
</div>
<div class="inline-embed-container" style="width: 500px; overflow-y: scroll;" id="cal-booking-place-windowScrollToTimeslot">
<h3><a href="?only=ns:windowScrollToTimeslot">Scroll to Timeslot Test - Selecting a date would scroll the window to the timeslot</a></h3>
<div class="inline-embed-container" style="width: 500px; overflow-y: scroll;"
id="cal-booking-place-windowScrollToTimeslot">
<h3><a href="?only=ns:windowScrollToTimeslot">Scroll to Timeslot Test - Selecting a date would scroll the window
to
the timeslot</a></h3>
<div class="place"></div>
</div>
<div class="inline-embed-container" style="height: 500px; width: 500px; overflow-y: scroll;" id="cal-booking-place-containerScrollToTimeslot">
<h3><a href="?only=ns:containerScrollToTimeslot">Container Scroll Test - Selecting a date would scroll the element to the timeslot</a></h3>
<div class="inline-embed-container" style="height: 500px; width: 500px; overflow-y: scroll;"
id="cal-booking-place-containerScrollToTimeslot">
<h3><a href="?only=ns:containerScrollToTimeslot">Container Scroll Test - Selecting a date would scroll the element
to the timeslot</a></h3>
<div class="place"></div>
</div>
<div class="inline-embed-container" id="cal-booking-place-conflicting-theme">
<h3><a href="?only=conflicting-theme">You would be able to test out conflicting themes for the same namespace here.</a></h3>
<h3><a href="?only=conflicting-theme">You would be able to test out conflicting themes for the same namespace
here.</a></h3>
<div class="light"></div>
<div class="dark"></div>
<i>Note that one of the embeds would stay in loading state as they are using the same namespace and it is not supported to have more than 1 embeds using same namespace</i>
</div>
<i>Note that one of the embeds would stay in loading state as they are using the same namespace and it is not
supported to have more than 1 embeds using same namespace</i>
</div>
<div class="inline-embed-container" id="cal-booking-place-monthView">
<h3><a href="?only=ns:monthView">Test Month View</a></h3>
<div class="place" style="width: 100%"></div>
@@ -469,28 +483,32 @@
<div class="place" style="width: 100%"></div>
</div>
</div>
<div id="cal-booking-place-skeletonDemo">
<h3><a href="?only=ns:skeletonDemo">Skeleton Loader INLINE Demo</a></h3>
<div class="inline-embed-container">
<div id="cal-booking-place-skeletonDemo">
<div class="place"></div>
</div>
<div id="cal-booking-place-skeletonDemo">
<h3><a href="?only=ns:skeletonDemo">Skeleton Loader INLINE Demo</a></h3>
<div class="inline-embed-container">
<div id="cal-booking-place-skeletonDemo">
<div class="place"></div>
</div>
</div>
<div id="cal-booking-place-skeletonDemoElementClick">
<a href="?only=ns:skeletonDemoElementClick">Skeleton Loader MODAL Demo</a>
<h3><button data-cal-namespace="skeletonDemoElementClick" data-cal-link="team/seeded-team/collective-seeded-team-event" data-cal-config='{"cal.embed.pageType":"team.event.booking.slots"}'>Skeleton Loader MODAL Demo</button></h3>
<div class="inline-embed-container">
<div id="cal-booking-place-skeletonDemoElementClick">
<div class="place"></div>
</div>
</div>
<div id="cal-booking-place-skeletonDemoElementClick">
<a href="?only=ns:skeletonDemoElementClick">Skeleton Loader MODAL Demo</a>
<h3><button data-cal-namespace="skeletonDemoElementClick"
data-cal-link="team/seeded-team/collective-seeded-team-event"
data-cal-config='{"cal.embed.pageType":"team.event.booking.slots"}'>Skeleton Loader MODAL Demo</button></h3>
<div class="inline-embed-container">
<div id="cal-booking-place-skeletonDemoElementClick">
<div class="place"></div>
</div>
</div>
<script type="module" src="./playground/lib/playground.ts"></script>
<script>
if (initialNamespace.startsWith("skeletonDemo")) {
document.getElementById("misc-embeds").style.display = "none";
}
</script>
</body>
</html>
</div>
<script type="module" src="./playground/lib/playground.ts"></script>
<script>
if (initialNamespace.startsWith("skeletonDemo")) {
document.getElementById("misc-embeds").style.display = "none";
}
</script>
</body>
</html>
+4 -9
View File
@@ -18,7 +18,7 @@
"build": "rm -rf dist && NEXT_PUBLIC_EMBED_FINGER_PRINT=$(git rev-parse --short HEAD) NEXT_PUBLIC_EMBED_VERSION=$(node -p 'require(\"./package.json\").version') yarn __build",
"build-preview": "PREVIEW_BUILD=1 yarn __build ",
"vite": "vite",
"tailwind": "yarn tailwindcss -i ./src/styles.css -o ./src/tailwind.generated.css",
"tailwind": "tailwindcss --input ./src/styles.css --output ./src/tailwind.generated.css",
"buildWatchAndServer": "run-p '__dev' 'vite --port 3100 --strict-port --host --open'",
"buildWatchAndServer-https": "run-p '__dev' 'vite --port 3100 --strict-port --host --open --https'",
"dev": "yarn tailwind && run-p 'tailwind --watch' 'buildWatchAndServer'",
@@ -40,20 +40,15 @@
"files": [
"dist"
],
"postcss": {
"map": false,
"plugins": {
"tailwindcss": {},
"autoprefixer": {}
}
},
"devDependencies": {
"@playwright/test": "^1.45.3",
"@tailwindcss/cli": "^4.0.0",
"@tailwindcss/postcss": "^4.0.0",
"@vitejs/plugin-basic-ssl": "^1.1.0",
"autoprefixer": "^10.4.12",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.18",
"tailwindcss": "^3.3.3",
"tailwindcss": "^4",
"typescript": "^5.9.0-beta",
"vite": "^4.1.2",
"vite-plugin-environment": "^1.1.3"
@@ -46,6 +46,63 @@ if (themeInParam && !theme) {
const calLink = searchParams.get("cal-link");
function fakeEvent({
namespace,
eventType,
data
}) {
window.postMessage({
fullType: `CAL:${namespace}:${eventType}`,
namespace,
originator: "CAL",
type: eventType,
data,
})
}
window.heavilyCustomizeUi = function ({ namespace }) {
Cal.ns[namespace]("ui", {
theme: "light",
cssVarsPerTheme: {
light: {
"cal-brand": "#6F61C0",
"cal-text": "#6F61C0",
"cal-text-emphasis": "#4D408D",
"cal-border-emphasis": "#4D408D",
"cal-text-error": "pink",
"cal-border": "#A090E0",
"cal-border-default": "#A090E0",
"cal-border-subtle": "#A090E0",
"cal-border-booker": "red",
"cal-text-muted": "#C0B8FF",
"cal-bg-emphasis": "#E1DFFF",
"cal-border-booker-width": "3px",
"cal-radius": "1px",
"cal-radius-md": "2px",
"cal-radius-lg": "3px",
"cal-radius-xl": "4px",
"cal-radius-2xl": "5px",
"cal-radius-3xl": "6px",
"cal-radius-full": "7px",
"cal-spacing-px": "5px",
// More CSS variables are defined here
// https://github.com/calcom/cal.com/blob/main/packages/config/tailwind-preset.js
},
dark: {
// Set the similar variables as in light theme but for dark mode.
},
},
});
};
window.fakeErrorScenario = function ({ namespace }) {
fakeEvent({
namespace,
eventType: "linkFailed",
data: { code: 500 }
});
};
if (only === "all" || only === "ns:default") {
Cal("init", {
debug: true,
@@ -0,0 +1,6 @@
export default {
plugins: {
"@tailwindcss/postcss": {},
}
}
@@ -90,7 +90,7 @@
}
* {
--cal-brand-color: gray;
--cal-brand: gray;
}
</style>
</head>
@@ -78,6 +78,7 @@ function createTestEmbedElement(data: {
element.innerHTML = inlineHTML({
layout: dataset?.layout,
pageType: dataset?.pageType as EmbedPageType | null,
externalThemeClass: dataset?.theme === "dark" ? EMBED_DARK_THEME_CLASS : EMBED_LIGHT_THEME_CLASS,
});
document.body.appendChild(element);
@@ -132,7 +133,6 @@ function mockGetComputedStyle() {
describe("EmbedElement", () => {
let element: EmbedElement;
let mockGetSkeletonData: Mock;
beforeEach(() => {
// Register the custom element
@@ -8,7 +8,7 @@ import {
addDarkColorSchemeChangeListener,
getMaxHeightForModal,
} from "./ui-utils";
import type { ExternalThemeClass } from "./ui/themeClass";
type ShadowRootWithStyle = ShadowRoot & {
host: HTMLElement & { style: CSSStyleDeclaration };
};
@@ -19,7 +19,7 @@ export class EmbedElement extends HTMLElement {
public isModal!: boolean;
public skeletonContainerHeightTimer: number | null = null;
// Theme Class is derived from `this.theme` as well as system color scheme preference
public themeClass!: string;
public themeClass!: ExternalThemeClass;
public layout!: AllPossibleLayouts;
public getSkeletonData!: (_args: { layout: AllPossibleLayouts; pageType: EmbedPageType | null }) => {
skeletonContent: string;
@@ -11,7 +11,7 @@ const getHtml = ({
}) => {
// IT IS A REQUIREMENT THAT ALL POSSIBLE CLASSES ARE HERE OTHERWISE TAILWIND WONT GENERATE THE CSS FOR CONDITIONAL CLASSES
// To not let all these classes apply and visible, keep it hidden initially
return `<button class="z-[999999999999] hidden fixed md:bottom-6 bottom-4 md:right-10 right-4 md:left-10 left-4 ${buttonClasses.join(
return `<button class="z-999999999999 hidden fixed md:bottom-6 bottom-4 md:right-10 right-4 md:left-10 left-4 ${buttonClasses.join(
" "
)} flex h-16 origin-center bg-red-50 transform cursor-pointer items-center
rounded-full py-4 px-6 text-base outline-none drop-shadow-md transition focus:outline-none fo
@@ -2,7 +2,6 @@ import { EmbedElement } from "../EmbedElement";
import { getErrorString } from "../lib/utils";
import loaderCss from "../loader.css?inline";
import inlineHtml, { getSkeletonData } from "./inlineHtml";
export class Inline extends EmbedElement {
static get observedAttributes() {
return ["loading"];
@@ -38,6 +37,7 @@ export class Inline extends EmbedElement {
this.shadowRoot.innerHTML = `<style>${window.Cal.__css}</style><style>${loaderCss}</style>${inlineHtml({
layout: this.layout,
pageType: this.getPageType() ?? null,
externalThemeClass: this.themeClass
})}`;
}
}
@@ -1,20 +1,23 @@
import type { AllPossibleLayouts, EmbedPageType } from "../types";
import { generateSkeleton } from "../ui/skeleton";
import { type ExternalThemeClass, getInternalThemeClass } from "../ui/themeClass";
const html = ({
layout = "month_view",
pageType,
externalThemeClass,
}: {
layout?: AllPossibleLayouts;
pageType: EmbedPageType | null;
externalThemeClass: ExternalThemeClass;
}) => {
const { skeletonContent, skeletonContainerStyle, skeletonStyle } = getSkeletonData({
layout,
pageType,
});
const themeClass = getInternalThemeClass(externalThemeClass);
return `
<div id="skeleton-container" style="${skeletonContainerStyle}">
<div id="skeleton-container" style="${skeletonContainerStyle}" ${themeClass ? `class="${themeClass}"` : ""}>
<div id="skeleton" style="${skeletonStyle}" class="absolute z-highest">
${skeletonContent}
</div>
@@ -175,9 +175,9 @@ export class ModalBox extends EmbedElement {
const message = this.dataset.message;
const errorMessage = this.dataset.errorCode
? getErrorString({
errorCode: this.dataset.errorCode,
errorMessage: message,
})
errorCode: this.dataset.errorCode,
errorMessage: message,
})
: null;
const messageToShow = errorMessage || message;
if (messageToShow) {
@@ -250,6 +250,7 @@ export class ModalBox extends EmbedElement {
const modalHtml = `<style>${window.Cal.__css}</style><style>${loaderCss}</style>${modalBoxHtml({
layout: this.getLayout(),
pageType: this.getPageType() ?? null,
externalThemeClass: this.themeClass
})}`;
this.attachShadow({ mode: "open" });
ModalBox.htmlOverflow = document.body.style.overflow;
@@ -1,5 +1,6 @@
import type { AllPossibleLayouts, EmbedPageType } from "../types";
import { generateSkeleton } from "../ui/skeleton";
import { type ExternalThemeClass, getInternalThemeClass } from "../ui/themeClass";
function getStyle() {
return `
@@ -56,7 +57,7 @@ function getStyle() {
}
/*Modal background is black only, so hardcode white */
.loader {
--cal-brand-color:white;
--cal-brand:white;
}
</style>
`;
@@ -65,15 +66,19 @@ function getStyle() {
const html = ({
layout = "month_view",
pageType,
externalThemeClass,
}: {
layout?: AllPossibleLayouts;
pageType: EmbedPageType | null;
externalThemeClass: ExternalThemeClass;
}) => {
const { skeletonContent, skeletonContainerStyle, skeletonStyle } = getSkeletonData({
layout,
pageType,
});
const themeClass = getInternalThemeClass(externalThemeClass);
// Keep message-container outside modal-box as that restricts the content to be shown through its overflow:auto unnecessarily
return `
${getStyle()}
@@ -81,12 +86,12 @@ ${getStyle()}
<div class="header">
<button type="button" class="close" aria-label="Close">&times;</button>
</div>
<div id="message-container" style="left: 50%; top: 50%; transform: translate(-50%, -50%);" class="message-container flex items-center p-24 justify-center dark:bg-muted rounded-md border-subtle border bg-default text-default absolute z-highest">
<div id="message-container" style="left: 50%; top: 50%; transform: translate(-50%, -50%);" class="message-container flex items-center p-24 justify-center dark:bg-cal-muted rounded-md border-subtle border bg-default text-default absolute z-highest">
<div id="message"></div>
</div>
<div class="modal-box">
<div class="body" id="skeleton-container" style="${skeletonContainerStyle}">
<div id="wrapper" class="z-[999999999999] absolute flex w-full items-center">
<div class="body${themeClass ? " " + themeClass : ""}" id="skeleton-container" style="${skeletonContainerStyle}">
<div id="wrapper" class="z-999999999999 absolute flex w-full items-center">
<div class="loader modal-loader border-brand-default dark:border-darkmodebrand">
<span class="loader-inner bg-brand dark:bg-darkmodebrand"></span>
</div>
@@ -1,260 +0,0 @@
import { EMBED_DARK_THEME_CLASS } from "./constants";
export const addAppCssVars = () => {
const calElements = ["cal-floating-button", "cal-modal-box", "cal-inline"];
try {
const cssVarsStyle = `
${calElements.join(",")} {
/* Spacing Scale */
--cal-spacing-0: 0px;
--cal-spacing-px: 1px;
--cal-spacing-0_5: 0.125rem; /* 2px */
--cal-spacing-1: 0.25rem; /* 4px */
--cal-spacing-1_5: 0.375rem; /* 6px */
--cal-spacing-2: 0.5rem; /* 8px */
--cal-spacing-2_5: 0.625rem; /* 10px */
--cal-spacing-3: 0.75rem; /* 12px */
--cal-spacing-3_5: 0.875rem; /* 14px */
--cal-spacing-4: 1rem; /* 16px */
--cal-spacing-5: 1.25rem; /* 20px */
--cal-spacing-6: 1.5rem; /* 24px */
--cal-spacing-7: 1.75rem; /* 28px */
--cal-spacing-8: 2rem; /* 32px */
--cal-spacing-9: 2.25rem; /* 36px */
--cal-spacing-10: 2.5rem; /* 40px */
--cal-spacing-11: 2.75rem; /* 44px */
--cal-spacing-12: 3rem; /* 48px */
--cal-spacing-14: 3.5rem; /* 56px */
--cal-spacing-16: 4rem; /* 64px */
--cal-spacing-20: 5rem; /* 80px */
--cal-spacing-24: 6rem; /* 96px */
--cal-spacing-28: 7rem; /* 112px */
--cal-spacing-32: 8rem; /* 128px */
--cal-spacing-36: 9rem; /* 144px */
--cal-spacing-40: 10rem; /* 160px */
--cal-spacing-44: 11rem; /* 176px */
--cal-spacing-48: 12rem; /* 192px */
--cal-spacing-52: 13rem; /* 208px */
--cal-spacing-56: 14rem; /* 224px */
--cal-spacing-60: 15rem; /* 240px */
--cal-spacing-64: 16rem; /* 256px */
--cal-spacing-72: 18rem; /* 288px */
--cal-spacing-80: 20rem; /* 320px */
--cal-spacing-96: 24rem; /* 384px */
/* Border Radius */
--cal-radius-none: 0px;
--cal-radius-sm: 0.125rem; /* 2px */
--cal-radius: 0.25rem; /* 4px */
--cal-radius-md: 0.375rem; /* 6px */
--cal-radius-lg: 0.5rem; /* 8px */
--cal-radius-xl: 0.75rem; /* 12px */
--cal-radius-2xl: 1rem; /* 16px */
--cal-radius-3xl: 1.5rem; /* 24px */
--cal-radius-full: 9999px;
/* Background Standard */
--cal-bg-emphasis: hsla(220, 13%, 91%, 1); /* gray.200 - active items and emphasising */
--cal-bg: hsla(0, 0%, 100%, 1); /* white - default background */
--cal-bg-subtle: hsla(220, 14%, 94%, 1); /* gray.100 - hovering on items, subtle raising */
--cal-bg-muted: hsla(210, 20%, 97%, 1); /* gray.50 - large items, sidebar, sections */
--cal-bg-inverted: hsla(210, 30%, 4%, 1); /* gray.900 - tooltips */
/* Background Primary */
--cal-bg-primary: hsla(214, 30%, 16%, 1); /* stone-100 */
--cal-bg-primary-emphasis: hsla(220, 6%, 25%, 1); /* stone-800 */
--cal-bg-primary-muted: hsla(220, 14%, 94%, 1); /* stone-400 */
/* Background Brand */
--cal-bg-brand: hsla(214, 30%, 16%, 1); /* gray-50 */
--cal-bg-brand-emphasis: hsla(220, 6%, 25%, 1); /* stone-100 */
--cal-bg-brand-muted: hsla(220, 14%, 94%, 1); /* stone-100 */
/* Background Semantic */
--cal-bg-semantic-info-subtle: hsla(212, 88%, 97%, 1); /* blue-100 */
--cal-bg-semantic-info-emphasis: hsla(236, 80%, 25%, 1); /* blue-500 */
--cal-bg-semantic-success-subtle: hsla(167, 54%, 93%, 1); /* green-100 */
--cal-bg-semantic-success-emphasis: hsla(158, 74%, 38%, 1); /* green-500 */
--cal-bg-semantic-attention-subtle: hsla(34, 100%, 92%, 1); /* orange-100 */
--cal-bg-semantic-attention-emphasis: hsla(15, 79%, 34%, 1); /* orange-500 */
--cal-bg-semantic-error-subtle: hsla(0, 93%, 94%, 1); /* red-100 */
--cal-bg-semantic-error-emphasis: hsla(0, 63%, 24%, 1); /* red-500 */
/* Background Visualization */
--cal-bg-visualization-1-subtle: hsla(326, 78%, 95%, 1); /* pink-100 */
--cal-bg-visualization-1-emphasis: hsla(330, 81%, 60%, 1); /* pink-500 */
--cal-bg-visualization-2-subtle: hsla(256, 86%, 91%, 1); /* purple-100 */
--cal-bg-visualization-2-emphasis: hsla(256, 85%, 57%, 1); /* purple-500 */
--cal-bg-visualization-3-subtle: hsla(217, 87%, 91%, 1); /* blue-100 */
--cal-bg-visualization-3-emphasis: hsla(235, 100%, 63%, 1); /* blue-500 */
--cal-bg-visualization-4-subtle: hsla(167, 54%, 93%, 1); /* green-100 */
--cal-bg-visualization-4-emphasis: hsla(158, 74%, 38%, 1); /* green-500 */
--cal-bg-visualization-5-subtle: hsla(55, 97%, 88%, 1); /* yellow-100 */
--cal-bg-visualization-5-emphasis: hsla(45, 93%, 47%, 1); /* yellow-500 */
--cal-bg-visualization-6-subtle: hsla(34, 100%, 92%, 1); /* orange-100 */
--cal-bg-visualization-6-emphasis: hsla(25, 95%, 53%, 1); /* orange-500 */
--cal-bg-visualization-7-subtle: hsla(0, 96%, 89%, 1); /* red-100 */
--cal-bg-visualization-7-emphasis: hsla(0, 84%, 60%, 1); /* red-500 */
/* Legacy Background Components - Consider deprecating */
--cal-bg-info: hsla(221, 91%, 93%, 1); /* #dee9fc - info backgrounds */
--cal-bg-success: hsla(142, 76%, 94%, 1); /* #e2fbe8 - success backgrounds */
--cal-bg-attention: hsla(33, 100%, 92%, 1); /* #fceed8 - attention backgrounds */
--cal-bg-error: hsla(3, 66%, 93%, 1); /* #f9e3e2 - error backgrounds */
--cal-bg-dark-error: hsla(2, 55%, 30%, 1); /* Keeping existing dark error */
/* Borders */
--cal-border-emphasis: hsla(218, 11%, 65%, 1); /* gray.400 - input:hover */
--cal-border: hsla(216, 12%, 84%, 1); /* gray.300 - inputs */
--cal-border-subtle: hsla(220, 13%, 91%, 1); /* gray.200 - container borders */
--cal-border-muted: hsla(220, 14%, 94%, 1); /* gray.100 */
--cal-border-error: hsla(0, 96%, 89%, 1); /* Keeping existing error border */
--cal-border-semantic-error: hsla(0, 96%, 89%, 1);
--cal-border-booker: var(--cal-border-subtle);
/* Content/Text Standard */
--cal-text-emphasis: hsla(210, 30%, 4%, 1); /* gray-900 */
--cal-text: hsla(220, 6%, 25%, 1); /* gray-700 */
--cal-text-subtle: hsla(220, 9%, 46%, 1); /* gray-500 */
--cal-text-muted: hsla(218, 11%, 65%, 1); /* gray-400 */
--cal-text-inverted: hsla(0, 0%, 100%, 1); /* white */
/* Content/Text Semantic */
--cal-text-semantic-info: hsla(236, 80%, 25%, 1); /* blue-800 */
--cal-text-semantic-success: hsla(150, 84%, 22%, 1); /* green-800 */
--cal-text-semantic-attention: hsla(15, 79%, 34%, 1); /* orange-800 */
--cal-text-semantic-error: hsla(0, 63%, 24%, 1); /* red-800 */
/* Content/Text Visualization */
--cal-text-visualization-1: hsla(332, 79%, 25%, 1); /* pink-800 */
--cal-text-visualization-2: hsla(270, 91%, 25%, 1); /* purple-800 */
--cal-text-visualization-3: hsla(217, 91%, 25%, 1); /* blue-800 */
--cal-text-visualization-4: hsla(142, 71%, 25%, 1); /* green-800 */
--cal-text-visualization-5: hsla(45, 93%, 25%, 1); /* yellow-800 */
--cal-text-visualization-6: hsla(24, 95%, 25%, 1); /* orange-800 */
--cal-text-visualization-7: hsla(0, 84%, 25%, 1); /* red-800 */
/* Border/Semantic Subtle */
--cal-border-semantic-attention-subtle: hsla(32, 98%, 83%, 1);
--cal-border-semantic-error-subtle: hsla(0, 96%, 89%, 1);
/* Legacy Content/Text Components - Consider deprecating */
--cal-text-info: hsla(225, 57%, 33%, 1); /* #253985 - interactive text/icons */
--cal-text-success: hsla(144, 34%, 24%, 1); /* #285231 */
--cal-text-attention: hsla(16, 62%, 28%, 1); /* Keeping existing attention text */
--cal-text-error: hsla(0, 63%, 31%, 1); /* Keeping existing error text */
/* Brand */
--cal-brand: hsla(221, 39%, 11%, 1); /* Keeping existing brand color */
--cal-brand-emphasis: hsla(0, 0%, 6%, 1); /* Keeping existing brand emphasis */
--cal-brand-text: hsla(0, 0%, 100%, 1); /* white */
}
${calElements.map((element) => `${element}.${EMBED_DARK_THEME_CLASS}`).join(",")} {
/* Background Standard */
--cal-bg-emphasis: hsla(0, 0%, 25%, 1); /* stone-700 */
--cal-bg: hsla(0, 0%, 6%, 1); /* stone-950 */
--cal-bg-subtle: hsla(0, 0%, 15%, 1); /* stone-800 */
--cal-bg-muted: hsla(0, 0%, 9%, 1); /* stone-900 */
--cal-bg-inverted: hsla(0, 0%, 98%, 1); /* stone-50 */
/* Background Primary */
--cal-bg-primary: hsla(0, 0%, 96%, 1); /* stone-100 */
--cal-bg-primary-emphasis: hsla(0, 0%, 64%, 1); /* stone-800 */
--cal-bg-primary-muted: hsla(0, 0%, 15%, 1); /* stone-400 */
/* Background Brand */
--cal-bg-brand: hsla(0, 0%, 98%, 1); /* gray-50 */
--cal-bg-brand-emphasis: hsla(0, 0%, 96%, 1); /* stone-100 */
--cal-bg-brand-muted: hsla(0, 0%, 96%, 1); /* stone-100 */
/* Background Semantic */
--cal-bg-semantic-info-subtle: hsla(236, 80%, 8%, 1); /* blue-800 */
--cal-bg-semantic-info-emphasis: hsla(229, 90%, 74%, 1); /* blue-500 */
--cal-bg-semantic-success-subtle: hsla(148, 88%, 16%, 1); /* green-800 */
--cal-bg-semantic-success-emphasis: hsla(158, 74%, 38%, 1); /* green-500 */
--cal-bg-semantic-attention-subtle: hsla(21, 86%, 8%, 1); /* orange-800 */
--cal-bg-semantic-attention-emphasis: hsla(27, 96%, 61%, 1); /* orange-500 */
--cal-bg-semantic-error-subtle: hsla(0, 70%, 8%, 1); /* red-800 */
--cal-bg-semantic-error-emphasis: hsla(0, 91%, 71%, 1); /* red-500 */
/* Background Visualization */
--cal-bg-visualization-1-subtle: hsla(336, 74%, 35%, 1); /* pink-200 */
--cal-bg-visualization-1-emphasis: hsla(330, 81%, 60%, 1); /* pink-500 */
--cal-bg-visualization-2-subtle: hsla(252, 83%, 23%, 1); /* purple-200 */
--cal-bg-visualization-2-emphasis: hsla(256, 85%, 57%, 1); /* purple-500 */
--cal-bg-visualization-3-subtle: hsla(236, 74%, 35%, 1); /* blue-200 */
--cal-bg-visualization-3-emphasis: hsla(235, 100%, 63%, 1); /* blue-500 */
--cal-bg-visualization-4-subtle: hsla(150, 84%, 22%, 1); /* green-200 */
--cal-bg-visualization-4-emphasis: hsla(158, 74%, 38%, 1); /* green-500 */
--cal-bg-visualization-5-subtle: hsla(28, 73%, 26%, 1); /* yellow-200 */
--cal-bg-visualization-5-emphasis: hsla(45, 93%, 47%, 1); /* yellow-500 */
--cal-bg-visualization-6-subtle: hsla(15, 75%, 23%, 1); /* orange-200 */
--cal-bg-visualization-6-emphasis: hsla(25, 95%, 53%, 1); /* orange-500 */
--cal-bg-visualization-7-subtle: hsla(0, 70%, 35%, 1); /* red-200 */
--cal-bg-visualization-7-emphasis: hsla(0, 84%, 60%, 1); /* red-500 */
/* Legacy Background Components - Consider deprecating */
--cal-bg-info: hsla(228, 56%, 33%, 1); /* Keeping existing info background */
--cal-bg-success: hsla(133, 34%, 24%, 1); /* Keeping existing success background */
--cal-bg-attention: hsla(16, 62%, 28%, 1); /* Keeping existing attention background */
--cal-bg-error: hsla(2, 55%, 30%, 1); /* Keeping existing error background */
--cal-bg-dark-error: hsla(2, 55%, 30%, 1); /* Keeping existing dark error */
/* Border Standard */
--cal-border: hsla(0, 0%, 30%, 1); /* stone-600 */
--cal-border-muted: hsla(0, 0%, 9%, 1); /* stone-500 */
--cal-border-subtle: hsla(0, 0%, 15%, 1); /* stone-700 */
--cal-border-emphasis: hsla(0, 0%, 45%, 1); /* stone-800 */
--cal-border-booker: var(--cal-border-subtle);
/* Border Semantic */
--cal-border-semantic-error: hsla(0, 63%, 24%, 1); /* red-800 */
/* Border/Semantic Subtle */
--cal-border-semantic-attention-subtle: hsla(15, 75%, 23%, 1);
--cal-border-semantic-error-subtle: hsla(0, 63%, 24%, 1);
/* Legacy Border - Consider deprecating */
--cal-border-error: hsla(0, 63%, 24%, 1); /* Keeping existing error border */
/* Content/Text Standard */
--cal-text-emphasis: hsla(0, 0%, 98%, 1); /* stone-50 */
--cal-text: hsla(0, 0%, 83%, 1); /* stone-300 */
--cal-text-subtle: hsla(0, 0%, 64%, 1); /* stone-400 */
--cal-text-muted: hsla(0, 0%, 64%, 1); /* stone-400 */
--cal-text-inverted: hsla(0, 0%, 0%, 1); /* black */
/* Content/Text Semantic */
--cal-text-semantic-info: hsla(229, 90%, 74%, 1); /* blue-100 */
--cal-text-semantic-success: hsla(161, 49%, 54%, 1); /* green-100 */
--cal-text-semantic-attention: hsla(27, 96%, 61%, 1); /* orange-100 */
--cal-text-semantic-error: hsla(0, 91%, 71%, 1); /* red-100 */
/* Content/Text Semantic Emphasis */
--cal-text-semantic-info-emphasis: hsla(217, 91%, 25%, 1); /* blue-800 */
--cal-text-semantic-success-emphasis: hsla(142, 71%, 25%, 1); /* green-800 */
--cal-text-semantic-attention-emphasis: hsla(24, 95%, 25%, 1); /* orange-800 */
--cal-text-semantic-error-emphasis: hsla(0, 84%, 25%, 1); /* red-800 */
/* Legacy Content/Text Components - Consider deprecating */
--cal-text-info: hsla(218, 83%, 93%, 1); /* Keeping existing info text */
--cal-text-success: hsla(134, 76%, 94%, 1); /* Keeping existing success text */
--cal-text-attention: hsla(37, 86%, 92%, 1); /* Keeping existing attention text */
--cal-text-error: hsla(3, 66%, 93%, 1); /* Keeping existing error text */
/* Brand */
--cal-brand: hsla(0, 0%, 100%, 1); /* white */
--cal-brand-emphasis: hsla(218, 11%, 65%, 1); /* Keeping existing brand emphasis */
--cal-brand-text: hsla(0, 0%, 0%, 1); /* black */
}
`;
// Create a style rule for above css
const style = document.createElement("style");
style.id = "cal-css-vars";
style.textContent = cssVarsStyle;
document.head.appendChild(style);
} catch (error) {
console.error("Error adding app css vars - Report this issue to support", error);
}
};
+26 -2
View File
@@ -1,7 +1,7 @@
"use client";
import { useEffect, useRef, useState, useCallback } from "react";
import { mapOldToNewCssVars } from "./ui/cssVarsMap";
import type { Message } from "./embed";
import { embedStore, EMBED_IFRAME_STATE } from "./embed-iframe/lib/embedStore";
import {
@@ -348,6 +348,7 @@ async function waitForRenderStateToBeCompleted() {
});
}
// It is a map of methods that can be called by parent using doInIframe({method: "methodName", arg: "argument"})
export const methods = {
ui: function style(uiConfig: UiConfig) {
@@ -374,13 +375,36 @@ export const methods = {
}
// Merge new values over the old values
// For cssVarsPerTheme, we need to merge at the theme level to preserve variables from both old and new configs
const oldCssVarsPerTheme = embedStore.uiConfig?.cssVarsPerTheme;
const newCssVarsPerTheme = uiConfig.cssVarsPerTheme;
let mergedCssVarsPerTheme: UiConfig["cssVarsPerTheme"] | undefined;
if (oldCssVarsPerTheme || newCssVarsPerTheme) {
mergedCssVarsPerTheme = {} as Record<"light" | "dark", Record<string, string>>;
const themeKeys = [
...(oldCssVarsPerTheme ? Object.keys(oldCssVarsPerTheme) : []),
...(newCssVarsPerTheme ? Object.keys(newCssVarsPerTheme) : []),
];
const themes = Array.from(new Set(themeKeys)) as Array<"light" | "dark">;
for (const theme of themes) {
mergedCssVarsPerTheme[theme] = {
...oldCssVarsPerTheme?.[theme],
...newCssVarsPerTheme?.[theme],
};
}
}
uiConfig = {
...embedStore.uiConfig,
...uiConfig,
...(mergedCssVarsPerTheme ? { cssVarsPerTheme: mergedCssVarsPerTheme } : {}),
};
if (uiConfig.cssVarsPerTheme) {
window.CalEmbed.applyCssVars(uiConfig.cssVarsPerTheme);
const mappedCssVarsPerTheme = mapOldToNewCssVars(uiConfig.cssVarsPerTheme);
window.CalEmbed.applyCssVars(mappedCssVarsPerTheme);
}
if (uiConfig.colorScheme) {
+13 -16
View File
@@ -2,7 +2,6 @@
import { FloatingButton } from "./FloatingButton/FloatingButton";
import { Inline } from "./Inline/inline";
import { ModalBox } from "./ModalBox/ModalBox";
import { addAppCssVars } from "./addAppCssVars";
import {
EMBED_MODAL_IFRAME_FORCE_RELOAD_THRESHOLD_MS,
EMBED_MODAL_IFRAME_SLOT_STALE_TIME,
@@ -39,8 +38,6 @@ export type Message = {
// HACK: Redefine and don't import WEBAPP_URL as it causes import statement to be present in built file.
// This is happening because we are not able to generate an App and a lib using single Vite Config.
const WEBAPP_URL = process.env.EMBED_PUBLIC_WEBAPP_URL || `https://${process.env.EMBED_PUBLIC_VERCEL_URL}`;
// Add App CSS Vars as soon as possible so that tailwind classes can work instantly.
addAppCssVars();
customElements.define("cal-modal-box", ModalBox);
customElements.define("cal-floating-button", FloatingButton);
@@ -180,8 +177,8 @@ type SingleInstructionMap = {
off: ["off", allPossibleCallbacksAndActions];
} & {
[K in Exclude<keyof CalApi, "on" | "off">]: CalApi[K] extends (...args: never[]) => void
? [K, ...Parameters<CalApi[K]>]
: never;
? [K, ...Parameters<CalApi[K]>]
: never;
};
type SingleInstruction = SingleInstructionMap[keyof SingleInstructionMap];
@@ -602,7 +599,7 @@ export class Cal {
: 0;
const crossedReloadThreshold = previousEmbedRenderStartTime
? timeSinceLastRender >
(prerenderOptions?.iframeForceReloadThresholdMs ?? EMBED_MODAL_IFRAME_FORCE_RELOAD_THRESHOLD_MS)
(prerenderOptions?.iframeForceReloadThresholdMs ?? EMBED_MODAL_IFRAME_FORCE_RELOAD_THRESHOLD_MS)
: false;
const areSlotsStale = previousEmbedRenderStartTime
@@ -948,10 +945,10 @@ class CalApi {
template.innerHTML = `<cal-inline
${generateDataAttributes({
pageType,
theme,
layout,
})}
pageType,
theme,
layout,
})}
style="max-height:inherit;height:inherit;min-height:inherit;display:flex;position:relative;flex-wrap:wrap;width:100%">
</cal-inline>
<style>.cal-inline-container::-webkit-scrollbar{display:none}.cal-inline-container{scrollbar-width:none}</style>`;
@@ -1191,8 +1188,8 @@ class CalApi {
...enrichedConfig,
...(actionToTake === "connect-no-slots-fetch"
? {
"cal.embed.noSlotsFetchOnConnect": "true",
}
"cal.embed.noSlotsFetchOnConnect": "true",
}
: {}),
},
params: paramsToAdd,
@@ -1234,10 +1231,10 @@ class CalApi {
template.innerHTML = `<cal-modal-box
${generateDataAttributes({
pageType,
theme,
layout,
})}
pageType,
theme,
layout,
})}
uid="${uid}">
</cal-modal-box>`;
this.cal.modalBox = template.content.children[0];
+14 -3
View File
@@ -1,6 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import 'tailwindcss';
@import "@coss/ui/styles.css";
@import "../../../config/theme/tokens.css";
@font-face {
font-family: "Cal Sans";
src: url("https://cal.com/cal.ttf");
@@ -22,4 +23,14 @@ body,
:host {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue,
Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
/** Tailwind defines this as @property and these are completely ignored if defined inside shadow DOM. - https://stackoverflow.com/questions/78717295/property-not-recognized-in-shadow-dom */
/** We avoid loading tailwind outside the shadow DOM as it could potentially affect the user's webpage. So define --tw prefixed properties here as and when used for now */
--tw-border-style: solid;
}
@utility stack-y-* {
&> :not([hidden])~ :not([hidden]) {
margin-top: --spacing(--value(integer));
margin-top: --value([length]);
}
}
@@ -0,0 +1,61 @@
import { UiConfig } from "../types";
/**
* Maps old CSS variable names to new Tailwind v4 variable names.
* This maintains backward compatibility by allowing users to use old variable names
* while the webapp uses the new Tailwind v4 format.
*
* This is only applicable as long as fundamentally the purpose of the variable is the same.
* In some cases, we have special classes designed to target specific elements e.g. border-booker class which is configured to use variable --cal-border-booker.
* In those special cases, we need to ensure that we don't remove those special css variables. Renaming them is fine and in which case we would need to map them here.
*
*/
const OLD_TO_NEW_CSS_VAR_MAP: Record<string, string> = {
// Border radius variables: --cal-radius-* -> --radius-*
"cal-radius": "radius",
"cal-radius-sm": "radius-sm",
"cal-radius-md": "radius-md",
"cal-radius-lg": "radius-lg",
"cal-radius-xl": "radius-xl",
"cal-radius-2xl": "radius-2xl",
"cal-radius-3xl": "radius-3xl",
"cal-radius-full": "radius-full",
"cal-radius-none": "radius-none",
// We don't intentionally want to support all spacing variables, from just one variable our design system derives all the rest.
"cal-spacing-px": "spacing",
// No need to map the following
// Colors - Still using the old variable names --cal-bg-* and --cal-brand-*
// Border colors - Still using the old variable names --cal-border-*
// text colors - Still using the old variable names --cal-text-*
// fill colors - Still using the old variable names --cal-fill-*
};
/**
* Transforms cssVarsPerTheme by mapping old CSS variable names to new Tailwind v4 names.
* This ensures backward compatibility while the webapp uses the new variable format.
*/
export function mapOldToNewCssVars(
cssVarsPerTheme: UiConfig["cssVarsPerTheme"]
): UiConfig["cssVarsPerTheme"] {
if (!cssVarsPerTheme) {
return cssVarsPerTheme;
}
const mapped: Record<string, Record<string, string>> = {};
for (const [theme, cssVars] of Object.entries(cssVarsPerTheme)) {
mapped[theme] = {};
for (const [varName, value] of Object.entries(cssVars)) {
// If the variable name exists in the mapping, use the new name; otherwise keep the original
const newVarName = OLD_TO_NEW_CSS_VAR_MAP[varName];
if (!newVarName) {
mapped[theme][varName] = value
continue;
}
console.log("Mapped variable:", varName, "to", newVarName);
mapped[theme][newVarName] = value;
}
}
return mapped as UiConfig["cssVarsPerTheme"];
}
@@ -28,7 +28,7 @@ const generateEventMetaSkeleton = () => {
<h1 data-testid="event-title" class="text-text text-xl font-semibold my-2 mb-4">
<div class="animate-pulse bg-emphasis h-6 w-20 rounded-sm"></div>
</h1>
<div class="space-y-3 font-medium">
<div class="stack-y-3 font-medium">
${eventMetaOptions}
</div>
</div>
@@ -73,7 +73,7 @@ const generateDatePickerSkeleton = () => {
for (let i = 1; i <= daysInMonth; i++) {
dates += `
<div class="relative w-full pt-[100%]">
<button class="bg-muted text-muted absolute bottom-0 left-0 right-0 top-0 mx-auto flex w-full items-center justify-center rounded-sm border-transparent text-center font-medium opacity-90 transition" disabled="">
<button class="bg-cal-muted text-muted absolute bottom-0 left-0 right-0 top-0 mx-auto flex w-full items-center justify-center rounded-sm border-transparent text-center font-medium opacity-90 transition" disabled="">
<span class="font-size-0 bg-emphasis inline-block animate-pulse rounded-md empty:before:inline-block empty:before:content-[''] h-9 w-9"></span>
</button>
</div>`;
@@ -101,13 +101,13 @@ const generateDatePickerSkeleton = () => {
</span>
<div class="text-emphasis">
<div class="flex">
<button class="group whitespace-nowrap items-center font-medium relative rounded-[10px] disabled:cursor-not-allowed gap-1 flex justify-center text-subtle border border-transparent enabled:hover:bg-subtle enabled:hover:text-emphasis enabled:hover:border-subtle hover:border disabled:opacity-30 focus-visible:bg-subtle focus-visible:outline-none focus-visible:ring-0 focus-visible:border-subtle focus-visible:shadow-button-outline-gray-focused enabled:active:shadow-outline-gray-active duration-200 text-sm leading-none min-h-[36px] min-w-[36px] !p-2 hover:border-default group p-1 opacity-70 transition hover:opacity-100 rtl:rotate-180" data-testid="decrementMonth" aria-label="View previous month" type="button" disabled>
<button class="group whitespace-nowrap items-center font-medium relative rounded-[10px] disabled:cursor-not-allowed gap-1 flex justify-center text-subtle border border-transparent enabled:hover:bg-subtle enabled:hover:text-emphasis enabled:hover:border-subtle hover:border disabled:opacity-30 focus-visible:bg-subtle focus-visible:outline-none focus-visible:ring-0 focus-visible:border-subtle focus-visible:shadow-button-outline-gray-focused enabled:active:shadow-outline-gray-active duration-200 text-sm leading-none min-h-[36px] min-w-[36px] p-2! hover:border-default group p-1 opacity-70 transition hover:opacity-100 rtl:rotate-180" data-testid="decrementMonth" aria-label="View previous month" type="button" disabled>
<svg height="16" width="16" class="fill-transparent visible button-icon group-active:translate-y-[0.5px] h-4 w-4" data-name="start-icon" aria-hidden="true">
<use href="#chevron-left"></use>
</svg>
<div class="contents visible group-active:translate-y-[0.5px]"></div>
</button>
<button class="group whitespace-nowrap items-center font-medium relative rounded-[10px] disabled:cursor-not-allowed gap-1 flex justify-center text-subtle border border-transparent enabled:hover:bg-subtle enabled:hover:text-emphasis enabled:hover:border-subtle hover:border disabled:opacity-30 focus-visible:bg-subtle focus-visible:outline-none focus-visible:ring-0 focus-visible:border-subtle focus-visible:shadow-button-outline-gray-focused enabled:active:shadow-outline-gray-active duration-200 text-sm leading-none min-h-[36px] min-w-[36px] !p-2 hover:border-default group p-1 opacity-70 transition hover:opacity-100 rtl:rotate-180 undefined" data-testid="incrementMonth" aria-label="View next month" type="button">
<button class="group whitespace-nowrap items-center font-medium relative rounded-[10px] disabled:cursor-not-allowed gap-1 flex justify-center text-subtle border border-transparent enabled:hover:bg-subtle enabled:hover:text-emphasis enabled:hover:border-subtle hover:border disabled:opacity-30 focus-visible:bg-subtle focus-visible:outline-none focus-visible:ring-0 focus-visible:border-subtle focus-visible:shadow-button-outline-gray-focused enabled:active:shadow-outline-gray-active duration-200 text-sm leading-none min-h-[36px] min-w-[36px] p-2! hover:border-default group p-1 opacity-70 transition hover:opacity-100 rtl:rotate-180 undefined" data-testid="incrementMonth" aria-label="View next month" type="button">
<svg height="16" width="16" class="fill-transparent visible button-icon group-active:translate-y-[0.5px] h-4 w-4" data-name="start-icon" aria-hidden="true">
<use href="#chevron-right"></use>
</svg>
@@ -130,18 +130,18 @@ const generateBookingSlotsPageSkeleton = ({ layout }: { layout: AllPossibleLayou
return `
<div
data-testid="booker-container"
class="[--booker-timeslots-width:240px] lg:[--booker-timeslots-width:280px] [--booker-main-width:480px] [--booker-meta-width:340px] lg:[--booker-meta-width:424px] bg-default dark:bg-muted grid max-w-full items-start dark:[color-scheme:dark] sm:transition-[width] sm:duration-300 sm:motion-reduce:transition-none md:flex-row border-subtle rounded-md"
class="[--booker-timeslots-width:240px] lg:[--booker-timeslots-width:280px] [--booker-main-width:480px] [--booker-meta-width:340px] lg:[--booker-meta-width:424px] bg-default dark:bg-cal-muted grid max-w-full items-start dark:scheme-dark sm:transition-[width] sm:duration-300 sm:motion-reduce:transition-none md:flex-row border-subtle rounded-md"
style="grid-template-areas: &quot;meta&quot; &quot;header&quot; &quot;main&quot; &quot;timeslots&quot;; width: 100%; grid-template-columns: 100%; grid-template-rows: minmax(min-content, max-content) 1fr; min-height: 0px; height: auto;">
<div
class="relative z-10 flex [grid-area:meta]">
<div class="[grid-area:meta] max-w-screen flex w-full flex-col md:w-[var(--booker-meta-width)]">
<div class="[grid-area:meta] max-w-screen flex w-full flex-col md:w-(--booker-meta-width)">
${generateEventMetaSkeleton()}
<div class="mt-auto px-5 py-3">
${generateDatePickerSkeleton()}
</div>
</div>
</div>
<div class="[grid-area:main] md:border-subtle ml-[-1px] h-full flex-shrink px-5 py-3 md:border-l lg:w-[var(--booker-main-width)]" style="opacity: 1; transform: none;">
<div class="[grid-area:main] md:border-subtle -ml-px h-full shrink px-5 py-3 md:border-l lg:w-(--booker-main-width)" style="opacity: 1; transform: none;">
</div>
</div>
`;
@@ -150,14 +150,14 @@ const generateBookingSlotsPageSkeleton = ({ layout }: { layout: AllPossibleLayou
return `
<div
data-testid="booker-container"
class="[--booker-timeslots-width:240px] lg:[--booker-timeslots-width:280px] [--booker-meta-width:240px] [--booker-main-width:480px] lg:[--booker-meta-width:280px] bg-default dark:bg-muted grid max-w-full items-start dark:[color-scheme:dark] sm:motion-reduce:transition-none md:flex-row rounded-md sm:transition-[width] sm:duration-300 border-subtle border undefined"
class="[--booker-timeslots-width:240px] lg:[--booker-timeslots-width:280px] [--booker-meta-width:240px] [--booker-main-width:480px] lg:[--booker-meta-width:280px] bg-default grid max-w-full items-start dark:scheme-dark sm:motion-reduce:transition-none md:flex-row rounded-md sm:transition-[width] sm:duration-300 border-subtle border undefined"
style="grid-template-areas: &quot;meta main main&quot; &quot;meta main main&quot;; width: calc(var(--booker-meta-width) + var(--booker-main-width)); grid-template-columns: var(--booker-meta-width) var(--booker-main-width); grid-template-rows: 1fr 0fr; min-height: 450px; height: auto;">
<div
class="relative z-10 flex [grid-area:meta]"
style="position: sticky; top: 0px;">
${generateEventMetaSkeleton()}
</div>
<div class="[grid-area:main] md:border-subtle ml-[-1px] h-full flex-shrink px-5 py-3 md:border-l lg:w-[var(--booker-main-width)]" style="opacity: 1; transform: none;">
<div class="[grid-area:main] md:border-subtle -ml-px h-full shrink px-5 py-3 md:border-l lg:w-(--booker-main-width)" style="opacity: 1; transform: none;">
${generateDatePickerSkeleton()}
</div>
</div>
@@ -0,0 +1,8 @@
import { EMBED_DARK_THEME_CLASS, EMBED_LIGHT_THEME_CLASS } from "../constants";
export type ExternalThemeClass = typeof EMBED_DARK_THEME_CLASS | typeof EMBED_LIGHT_THEME_CLASS
export type InternalThemeClass = "dark" | "light"
export function getInternalThemeClass(externalThemeClass: ExternalThemeClass): InternalThemeClass {
return externalThemeClass === EMBED_DARK_THEME_CLASS ? "dark" : "light";
}
@@ -1,17 +0,0 @@
const base = require("@calcom/config/tailwind-preset");
module.exports = {
...base,
content: ["**/*Html.ts", "**/ui/**/*.ts*"],
theme: {
...base.theme,
extend: {
...base.theme.extend,
colors: {
...base.theme.extend.colors,
// Set default as black
brand: "var(--cal-brand-color, black)",
},
},
},
};
+3 -3
View File
@@ -127,7 +127,7 @@ function MatchingTeamMembers({
if (!hasValidValue) {
return (
<div className="border-subtle bg-muted mt-4 space-y-3 rounded-md border p-4">
<div className="border-subtle bg-cal-muted mt-4 stack-y-3 rounded-md border p-4">
<div className="text-subtle flex items-center text-sm font-medium">
<span>{t("no_filter_set")}</span>
</div>
@@ -138,7 +138,7 @@ function MatchingTeamMembers({
if (isPending) {
return (
<div
className="border-subtle bg-muted mt-4 space-y-3 rounded-md border p-4"
className="border-subtle bg-cal-muted mt-4 stack-y-3 rounded-md border p-4"
data-testid="segment_loading_state">
<div className="text-emphasis flex items-center text-sm font-medium">
<div className="bg-subtle h-4 w-32 animate-pulse rounded" />
@@ -161,7 +161,7 @@ function MatchingTeamMembers({
const { result: matchingTeamMembers } = matchingTeamMembersWithResult;
return (
<div className="border-subtle bg-muted mt-4 space-y-3 rounded-md border p-4">
<div className="border-subtle bg-cal-muted mt-4 stack-y-3 rounded-md border p-4">
<div className="text-emphasis flex items-center text-sm font-medium">
<span>{t("x_matching_members", { x: matchingTeamMembers?.length ?? 0 })}</span>
</div>
+2 -2
View File
@@ -348,8 +348,8 @@ export default AdminAppsList;
const SkeletonLoader = () => {
return (
<SkeletonContainer className="w-[30rem] pr-10">
<div className="mb-8 mt-6 space-y-6">
<SkeletonContainer className="w-120 pr-10">
<div className="mb-8 mt-6 stack-y-6">
<SkeletonText className="h-8 w-full" />
<SkeletonText className="h-8 w-full" />
<SkeletonText className="h-8 w-full" />
@@ -92,7 +92,7 @@ function CategoryTab({ selectedCategory, categories, searchText, onCategoryChang
<div className="bg-default flex h-12 w-5 items-center justify-end">
<Icon name="chevron-left" className="text-subtle h-4 w-4" />
</div>
<div className="to-default flex h-12 w-5 bg-gradient-to-l from-transparent" />
<div className="to-default flex h-12 w-5 bg-linear-to-l from-transparent" />
</button>
)}
<ul
@@ -104,7 +104,7 @@ function CategoryTab({ selectedCategory, categories, searchText, onCategoryChang
onCategoryChange(null);
}}
className={classNames(
selectedCategory === null ? "bg-emphasis text-default" : "bg-muted text-emphasis",
selectedCategory === null ? "bg-emphasis text-default" : "bg-cal-muted text-emphasis",
"hover:bg-emphasis min-w-max rounded-md px-4 py-2.5 text-sm font-medium transition hover:cursor-pointer"
)}>
{t("all")}
@@ -120,7 +120,7 @@ function CategoryTab({ selectedCategory, categories, searchText, onCategoryChang
}
}}
className={classNames(
selectedCategory === cat ? "bg-emphasis text-default" : "bg-muted text-emphasis",
selectedCategory === cat ? "bg-emphasis text-default" : "bg-cal-muted text-emphasis",
"hover:bg-emphasis rounded-md px-4 py-2.5 text-sm font-medium transition hover:cursor-pointer"
)}>
{cat === "crm" ? cat.toUpperCase() : cat[0].toUpperCase() + cat.slice(1)}
@@ -129,7 +129,7 @@ function CategoryTab({ selectedCategory, categories, searchText, onCategoryChang
</ul>
{rightVisible && (
<button onClick={handleRight} className="absolute bottom-0 right-0 flex ">
<div className="to-default flex h-12 w-5 bg-gradient-to-r from-transparent" />
<div className="to-default flex h-12 w-5 bg-linear-to-r from-transparent" />
<div className="bg-default flex h-12 w-5 items-center justify-end">
<Icon name="chevron-right" className="text-subtle h-4 w-4" />
</div>
@@ -120,7 +120,7 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar
<span className="pl-1 text-subtle">{props.reviews} reviews</span>
</div> */}
<p
className="text-default mt-2 flex-grow text-sm"
className="text-default mt-2 grow text-sm"
dangerouslySetInnerHTML={{ __html: markdownToSafeHTML(app.description) }}
style={{
overflow: "hidden",
@@ -133,7 +133,7 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar
<div className="mt-5 flex max-w-full flex-row justify-between gap-2">
<Button
color="secondary"
className="flex w-32 flex-grow justify-center"
className="flex w-32 grow justify-center"
href={`/apps/${app.slug}`}
data-testid={`app-store-app-card-${app.slug}`}>
{t("details")}
@@ -37,7 +37,7 @@ export function AppStoreCategories({
data-testid={`app-store-category-${category.name}`}
className="relative flex rounded-md"
style={{ background: "radial-gradient(farthest-side at top right, #a2abbe 0%, #E3E3E3 100%)" }}>
<div className="dark:bg-muted light:bg-[url('/noise.svg')] dark:from-subtle dark:to-muted w-full self-center bg-cover bg-center bg-no-repeat px-6 py-4 dark:bg-gradient-to-tr">
<div className="dark:bg-cal-muted light:bg-[url('/noise.svg')] dark:from-subtle dark:to-muted w-full self-center bg-cover bg-center bg-no-repeat px-6 py-4 dark:bg-linear-to-tr">
<Image
src={`/app-categories/${category.name}.svg`}
width={100}
@@ -17,10 +17,10 @@ export function SkeletonLoader({ className }: { className?: string }) {
function SkeletonItem() {
return (
<li className="group flex w-full items-center justify-between p-3">
<div className="flex-grow truncate text-sm">
<div className="grow truncate text-sm">
<div className="flex justify-start space-x-2 rtl:space-x-reverse">
<SkeletonText className="h-10 w-10" />
<div className="space-y-1">
<div className="stack-y-1">
<div>
<SkeletonText className="h-4 w-16" />
</div>
@@ -30,7 +30,7 @@ function SkeletonItem() {
</div>
</div>
</div>
<div className="mt-4 hidden flex-shrink-0 sm:ml-5 sm:mt-0 lg:flex">
<div className="mt-4 hidden shrink-0 sm:ml-5 sm:mt-0 lg:flex">
<div className="flex justify-between space-x-2 rtl:space-x-reverse">
<SkeletonText className="h-11 w-32" />
</div>
@@ -45,7 +45,7 @@ export const SelectSkeletonLoader = ({ className }: { className?: string }) => {
"border-subtle group flex w-full items-center justify-between rounded-sm border px-[10px] py-3",
className
)}>
<div className="flex-grow truncate text-sm">
<div className="grow truncate text-sm">
<div className="flex justify-between">
<SkeletonText className="h-4 w-32" />
<SkeletonText className="h-4 w-4" />
+7 -7
View File
@@ -351,7 +351,7 @@ const BookerComponent = ({
data-testid="booker-container"
className={classNames(
...getBookerSizeClassNames(layout, bookerState, hideEventTypeDetails),
`bg-default dark:bg-muted grid max-w-full items-start dark:[color-scheme:dark] sm:transition-[width] sm:duration-300 sm:motion-reduce:transition-none md:flex-row`,
`bg-default dark:bg-cal-muted grid max-w-full items-start dark:scheme-dark sm:transition-[width] sm:duration-300 sm:motion-reduce:transition-none md:flex-row`,
// We remove border only when the content covers entire viewport. Because in embed, it can almost never be the case that it covers entire viewport, we show the border there
(layout === BookerLayouts.MONTH_VIEW || isEmbed) && "border-subtle rounded-md",
!isEmbed && "sm:transition-[width] sm:duration-300",
@@ -366,7 +366,7 @@ const BookerComponent = ({
className={classNames(
layout === BookerLayouts.MONTH_VIEW && "fixed top-4 z-10 ltr:right-4 rtl:left-4",
(layout === BookerLayouts.COLUMN_VIEW || layout === BookerLayouts.WEEK_VIEW) &&
"bg-default dark:bg-muted sticky top-0 z-10"
"bg-default dark:bg-cal-muted sticky top-0 z-10"
)}>
{isPlatform && layout === BookerLayouts.MONTH_VIEW ? (
<></>
@@ -406,7 +406,7 @@ const BookerComponent = ({
<StickyOnDesktop key="meta" className={classNames("relative z-10 flex [grid-area:meta]")}>
<BookerSection
area="meta"
className="max-w-screen flex w-full flex-col md:w-[var(--booker-meta-width)]">
className="max-w-screen flex w-full flex-col md:w-(--booker-meta-width)">
{!hideEventTypeDetails && orgBannerUrl && (
<img
loading="eager"
@@ -453,7 +453,7 @@ const BookerComponent = ({
<BookerSection
key="book-event-form"
area="main"
className="sticky top-0 ml-[-1px] h-full p-6 md:w-[var(--booker-main-width)] md:border-l"
className="sticky top-0 -ml-px h-full p-6 md:w-(--booker-main-width) md:border-l"
{...fadeInLeft}
visible={bookerState === "booking" && !shouldShowFormInDialog}>
{EventBooker}
@@ -465,7 +465,7 @@ const BookerComponent = ({
visible={bookerState !== "booking" && layout === BookerLayouts.MONTH_VIEW}
{...fadeInLeft}
initial="visible"
className="md:border-subtle ml-[-1px] h-full flex-shrink px-5 py-3 md:border-l lg:w-[var(--booker-main-width)]">
className="md:border-subtle -ml-px h-full shrink px-5 py-3 md:border-l lg:w-(--booker-main-width)">
<DatePicker
classNames={customClassNames?.datePickerCustomClassNames}
event={event}
@@ -480,7 +480,7 @@ const BookerComponent = ({
key="large-calendar"
area="main"
visible={layout === BookerLayouts.WEEK_VIEW}
className="border-subtle sticky top-0 ml-[-1px] h-full md:border-l"
className="border-subtle sticky top-0 -ml-px h-full md:border-l"
{...fadeInLeft}>
<LargeCalendar
extraDays={extraDays}
@@ -499,7 +499,7 @@ const BookerComponent = ({
className={classNames(
"border-subtle rtl:border-default flex h-full w-full flex-col overflow-x-auto px-5 py-3 pb-0 rtl:border-r ltr:md:border-l",
layout === BookerLayouts.MONTH_VIEW &&
"h-full overflow-hidden md:w-[var(--booker-timeslots-width)]",
"h-full overflow-hidden md:w-(--booker-timeslots-width)",
layout !== BookerLayouts.MONTH_VIEW && "sticky top-0"
)}
ref={timeslotsRef}
@@ -214,7 +214,7 @@ export const AvailableTimeSlots = ({
<div
ref={containerRef}
className={classNames(
limitHeight && "scroll-bar flex-grow overflow-auto md:h-[400px]",
limitHeight && "scroll-bar grow overflow-auto md:h-[400px]",
!limitHeight && "flex h-full w-full flex-row gap-4",
`${customClassNames?.availableTimeSlotsContainer}`
)}>
@@ -223,7 +223,7 @@ export const AvailableTimeSlots = ({
{!isLoading &&
slotsPerDay.length > 0 &&
slotsPerDay.map((slots) => (
<div key={slots.date} className="scroll-bar h-full w-full overflow-y-auto overflow-x-hidden">
<div key={slots.date} className="scroll-bar h-full w-full overflow-y-auto overflow-x-hidden!">
<AvailableTimes
className={customClassNames?.availableTimeSlotsContainer}
customClassNames={customClassNames?.availableTimes}
@@ -36,12 +36,12 @@ export function DecoyBookingSuccessCard({
<div className="flex items-end justify-center px-4 pb-20 pt-4 text-center sm:flex sm:p-0">
<div className="main inset-0 my-4 flex flex-col transition-opacity sm:my-0" aria-hidden="true">
<div
className="bg-default dark:bg-muted border-booker border-booker-width inline-block transform overflow-hidden rounded-lg px-8 pb-4 pt-5 text-left align-bottom transition-all sm:my-8 sm:w-full sm:max-w-xl sm:py-8 sm:align-middle"
className="bg-default dark:bg-cal-muted border-booker border-booker-width inline-block transform overflow-hidden rounded-lg px-8 pb-4 pt-5 text-left align-bottom transition-all sm:my-8 sm:w-full sm:max-w-xl sm:py-8 sm:align-middle"
role="dialog"
aria-modal="true"
aria-labelledby="modal-headline">
<div>
<div className="bg-success mx-auto flex h-12 w-12 items-center justify-center rounded-full">
<div className="bg-cal-success mx-auto flex h-12 w-12 items-center justify-center rounded-full">
<Icon name="check" className="h-5 w-5 text-green-600 dark:text-green-400" />
</div>
</div>
@@ -178,7 +178,7 @@ export const EventMeta = ({
{(event.description || translatedDescription) && (
<EventMetaBlock
data-testid="event-meta-description"
contentClassName="mb-8 break-words max-w-full max-h-[180px] scroll-bar pr-4">
contentClassName="mb-8 wrap-break-word max-w-full max-h-[180px] scroll-bar pr-4">
<div
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
@@ -187,7 +187,7 @@ export const EventMeta = ({
/>
</EventMetaBlock>
)}
<div className="space-y-4 font-medium rtl:-mr-2">
<div className="stack-y-4 font-medium rtl:-mr-2">
{rescheduleUid && bookingData && (
<EventMetaBlock icon="calendar">
{t("former_time")}
@@ -223,7 +223,7 @@ export const EventMeta = ({
<>{timezone}</>
) : (
<span
className={`current-timezone before:bg-subtle min-w-32 -mt-[2px] flex h-6 max-w-full items-center justify-start before:absolute before:inset-0 before:bottom-[-3px] before:left-[-30px] before:top-[-3px] before:w-[calc(100%_+_35px)] before:rounded-md before:py-3 before:opacity-0 before:transition-opacity ${
className={`current-timezone before:bg-subtle min-w-32 -mt-[2px] flex h-6 max-w-full items-center justify-start before:absolute before:inset-0 before:bottom-[-3px] before:left-[-30px] before:top-[-3px] before:w-[calc(100%+35px)] before:rounded-md before:py-3 before:opacity-0 before:transition-opacity ${
event.lockTimeZoneToggleOnBookingPage ? "cursor-not-allowed" : ""
}`}
data-testid="event-meta-current-timezone">
@@ -233,8 +233,8 @@ export const EventMeta = ({
timezoneSelectCustomClassname={classNames?.eventMetaTimezoneSelect}
classNames={{
control: () =>
"!min-h-0 p-0 w-full border-0 bg-transparent focus-within:ring-0 shadow-none!",
menu: () => "!w-64 max-w-[90vw] mb-1 ",
"min-h-0! p-0 w-full border-0 bg-transparent focus-within:ring-0 shadow-none!",
menu: () => "w-64! max-w-[90vw] mb-1 ",
singleValue: () => "text-text py-1",
indicatorsContainer: () => "ml-auto",
container: () => "max-w-full",
@@ -113,7 +113,7 @@ export function Header({
return (
<div className="border-default relative z-10 flex border-b px-5 py-4 ltr:border-l rtl:border-r">
<div className="flex items-center gap-5 rtl:flex-grow">
<div className="flex items-center gap-5 rtl:grow">
<FormattedSelectedDateRange />
<ButtonGroup>
<Button
@@ -35,7 +35,7 @@ export const OutOfOfficeInSlots = (props: IOutOfOfficeInSlotsProps) => {
<div className="bg-emphasis flex h-14 w-14 flex-col items-center justify-center rounded-full">
<span className="m-auto text-center text-lg">{emoji}</span>
</div>
<div className="space-y-2 text-center">
<div className="stack-y-2 text-center">
<p className="mt-2 text-base font-bold">
{t("ooo_user_is_ooo", { displayName: fromUser.displayName })}
</p>
@@ -28,7 +28,7 @@ interface IOverlayCalendarSettingsModalProps {
const SkeletonLoader = () => {
return (
<SkeletonContainer>
<div className="border-subtle mt-3 space-y-4 rounded-xl border px-4 py-4 ">
<div className="border-subtle mt-3 stack-y-4 rounded-xl border px-4 py-4 ">
<SkeletonText className="h-4 w-full" />
<SkeletonText className="h-4 w-full" />
<SkeletonText className="h-4 w-full" />
@@ -99,7 +99,7 @@ export function OverlayCalendarSettingsModal({
/>
)
}
<div className="flex-grow truncate pl-2">
<div className="grow truncate pl-2">
<ListItemTitle component="h3" className="space-x-2 rtl:space-x-reverse">
<Link href={`/apps/${item.integration.slug}`}>
{item.integration.name || item.integration.title}
@@ -109,7 +109,7 @@ export function OverlayCalendarSettingsModal({
</div>
</div>
<div className="border-subtle w-full border-t pt-4">
<ul className="space-y-4">
<ul className="stack-y-4">
{item.calendars.map((cal, index) => {
const id = cal.integrationTitle ?? `calendar-switch-${index}`;
return (
@@ -2,7 +2,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
const UnAvailableMessage = ({ children, title }: { children: React.ReactNode; title: string }) => (
<div className="mx-auto w-full max-w-2xl">
<div className="border-subtle bg-default dark:bg-muted overflow-hidden rounded-lg border p-10">
<div className="border-subtle bg-default dark:bg-cal-muted overflow-hidden rounded-lg border p-10">
<h2 className="font-cal mb-4 text-3xl">{title}</h2>
{children}
</div>
@@ -169,7 +169,7 @@ const SlotItem = ({
data-time={slot.time}
onClick={onButtonClick}
className={classNames(
`hover:border-brand-default min-h-9 mb-2 flex h-auto w-full flex-grow flex-col justify-center py-2`,
`hover:border-brand-default min-h-9 mb-2 flex h-auto w-full grow flex-col justify-center py-2`,
selectedSlots?.includes(slot.time) && "border-brand-default",
`${customClassNames}`
)}
@@ -242,7 +242,7 @@ const SlotItem = ({
{isOverlapping && (
<HoverCard.Portal>
<HoverCard.Content side="top" align="end" sideOffset={2}>
<div className="text-emphasis bg-inverted w-[var(--booker-timeslots-width)] rounded-md p-3">
<div className="text-emphasis bg-inverted w-(--booker-timeslots-width) rounded-md p-3">
<div className="flex items-center gap-2">
<p>Busy</p>
</div>
@@ -36,7 +36,7 @@ export const AvailableTimesHeader = ({
return (
<header
className={classNames(
`dark:bg-muted dark:before:bg-muted mb-3 flex w-full flex-row items-center font-medium`,
`dark:bg-cal-muted dark:before:bg-cal-muted mb-3 flex w-full flex-row items-center font-medium`,
"bg-default before:bg-default",
customClassNames?.availableTimeSlotsHeaderContainer
)}>
@@ -36,12 +36,12 @@ export function BookingSuccessCard({
<div className="flex items-end justify-center px-4 pb-20 pt-4 text-center sm:flex sm:p-0">
<div className="main inset-0 my-4 flex flex-col transition-opacity sm:my-0" aria-hidden="true">
<div
className="bg-default dark:bg-muted border-booker border-booker-width inline-block transform overflow-hidden rounded-lg px-8 pb-4 pt-5 text-left align-bottom transition-all sm:my-8 sm:w-full sm:max-w-xl sm:py-8 sm:align-middle"
className="bg-default dark:bg-cal-muted border-booker border-booker-width inline-block transform overflow-hidden rounded-lg px-8 pb-4 pt-5 text-left align-bottom transition-all sm:my-8 sm:w-full sm:max-w-xl sm:py-8 sm:align-middle"
role="dialog"
aria-modal="true"
aria-labelledby="modal-headline">
<div>
<div className="bg-success mx-auto flex h-12 w-12 items-center justify-center rounded-full">
<div className="bg-cal-success mx-auto flex h-12 w-12 items-center justify-center rounded-full">
<Icon name="check" className="h-5 w-5 text-green-600 dark:text-green-400" />
</div>
</div>
@@ -83,7 +83,7 @@ export const VerifyCodeDialog = ({
useEffect(() => setValue(""), [isOpenDialog]);
const digitClassName = "h-12 w-12 !text-xl text-center";
const digitClassName = "h-12 w-12 text-xl! text-center";
return (
<Dialog
@@ -35,7 +35,7 @@ function RenderLocationTooltip({ locations }: { locations: LocationObject[] }) {
const { t } = useLocale();
return (
<div className="my-2 me-2 flex w-full flex-col space-y-3 break-words">
<div className="my-2 me-2 flex w-full flex-col stack-y-3 wrap-break-word">
<p>{t("select_on_next_step")}</p>
{locations.map(
(
@@ -115,7 +115,7 @@ export function AvailableEventLocations({ locations }: { locations: LocationObje
</Tooltip>
</div>
) : filteredLocations.length === 1 ? (
<div className="text-default mr-6 flex w-full flex-col space-y-4 break-words text-sm rtl:mr-2">
<div className="text-default mr-6 flex w-full flex-col stack-y-4 wrap-break-word text-sm rtl:mr-2">
{filteredLocations}
</div>
) : null;
@@ -96,20 +96,20 @@ export const EventMetaBlock = ({
alt=""
// @TODO: Use SVG's instead of images, so we can get rid of the filter.
className={classNames(
"mr-2 mt-[2px] h-4 w-4 flex-shrink-0",
isDark === undefined && "[filter:invert(0.5)_brightness(0.5)]",
(isDark === undefined || isDark) && "dark:[filter:invert(0.65)_brightness(0.9)]"
"mr-2 mt-[2px] h-4 w-4 shrink-0",
isDark === undefined && "filter-[invert(0.5)_brightness(0.5)]",
(isDark === undefined || isDark) && "dark:filter-[invert(0.65)_brightness(0.9)]"
)}
/>
) : (
<>
{customIcon ||
(!!icon && (
<Icon name={icon} className="relative z-20 mr-2 mt-[2px] h-4 w-4 flex-shrink-0 rtl:ml-2" />
<Icon name={icon} className="relative z-20 mr-2 mt-[2px] h-4 w-4 shrink-0 rtl:ml-2" />
))}
</>
)}
<div className={classNames("relative z-10 max-w-full break-words", contentClassName)}>{children}</div>
<div className={classNames("relative z-10 max-w-full wrap-break-word", contentClassName)}>{children}</div>
</div>
);
};
@@ -183,7 +183,7 @@ export const EventDetails = ({ event, blocks = defaultEventDetailsBlocks }: Even
key={block}
customIcon={
<PriceIcon
className="relative z-20 mr-2 mt-[2px] h-4 w-4 flex-shrink-0 rtl:ml-2"
className="relative z-20 mr-2 mt-[2px] h-4 w-4 shrink-0 rtl:ml-2"
currency={event.currency}
/>
}>
@@ -101,7 +101,7 @@ export const EventDuration = ({
<div className="bg-default flex h-9 w-5 items-center justify-end rounded-md">
<Icon name="chevron-left" className="text-subtle h-4 w-4" />
</div>
<div className="to-default flex h-9 w-5 bg-gradient-to-l from-transparent" />
<div className="to-default flex h-9 w-5 bg-linear-to-l from-transparent" />
</button>
)}
<ul
@@ -127,7 +127,7 @@ export const EventDuration = ({
</ul>
{rightVisible && (
<button onClick={handleRight} className="absolute bottom-0 right-0 flex">
<div className="to-default flex h-9 w-5 bg-gradient-to-r from-transparent" />
<div className="to-default flex h-9 w-5 bg-linear-to-r from-transparent" />
<div className="bg-default flex h-9 w-5 items-center justify-end rounded-md">
<Icon name="chevron-right" className="text-subtle h-4 w-4" />
</div>
@@ -34,7 +34,7 @@ export const EventLocations = ({ event }: { event: BookerEvent }) => {
{locations.length > 1 && (
<div
key={locations[0].type}
className="before:bg-subtle relative before:pointer-events-none before:absolute before:inset-0 before:bottom-[-5px] before:left-[-30px] before:top-[-5px] before:w-[calc(100%_+_35px)] before:rounded-md before:py-3 before:opacity-0 before:transition-opacity hover:before:opacity-100">
className="before:bg-subtle relative before:pointer-events-none before:absolute before:inset-0 before:bottom-[-5px] before:left-[-30px] before:top-[-5px] before:w-[calc(100%+35px)] before:rounded-md before:py-3 before:opacity-0 before:transition-opacity hover:before:opacity-100">
<Tooltip
content={
<>
@@ -60,7 +60,7 @@ export const EventLocations = ({ event }: { event: BookerEvent }) => {
</ul>
</>
}>
<span className="relative z-[2] py-2">{t("num_locations", { num: locations.length })}</span>
<span className="relative z-2 py-2">{t("num_locations", { num: locations.length })}</span>
</Tooltip>
</div>
)}
+1 -1
View File
@@ -322,7 +322,7 @@ const Days = ({
<div key={`e-${idx}`} />
) : props.isLoading ? (
<button
className="bg-muted text-muted absolute bottom-0 left-0 right-0 top-0 mx-auto flex w-full items-center justify-center rounded-sm border-transparent text-center font-medium opacity-90 transition"
className="bg-cal-muted text-muted absolute bottom-0 left-0 right-0 top-0 mx-auto flex w-full items-center justify-center rounded-sm border-transparent text-center font-medium opacity-90 transition"
key={`e-${idx}`}
disabled>
<SkeletonText className="h-8 w-9" />
@@ -64,7 +64,7 @@ function CalendarInner(props: CalendarComponentProps) {
{props.isPending && <Spinner />}
<div
ref={container}
className="bg-default dark:bg-muted relative isolate flex h-full flex-auto flex-col">
className="bg-default dark:bg-cal-muted relative isolate flex h-full flex-auto flex-col">
<div
style={{ width: "165%" }}
className="flex h-full max-w-full flex-none flex-col sm:max-w-none md:max-w-full">
@@ -78,7 +78,7 @@ function CalendarInner(props: CalendarComponentProps) {
<CurrentTime timezone={timezone} scrollToCurrentTime={scrollToCurrentTime} />
<div
className={classNames(
"bg-default dark:bg-muted ring-muted sticky left-0 z-10 w-16 flex-none ring-1",
"bg-default dark:bg-cal-muted ring-muted sticky left-0 z-10 w-16 flex-none ring-1",
showBorder &&
(borderColor === "subtle"
? "border-subtle border-l border-r"
@@ -52,7 +52,7 @@ export function DateValues({ showBorder, borderColor, days, containerNavRef }: P
<div
ref={containerNavRef}
className={classNames(
"bg-default dark:bg-default sticky top-[var(--calendar-dates-sticky-offset,0px)] z-[80] flex-none border-b",
"bg-default dark:bg-cal-muted sticky top-(--calendar-dates-sticky-offset,0px) z-80 flex-none border-b",
borderColor === "subtle" ? "border-b-subtle" : "border-b-default",
showBorder && (borderColor === "subtle" ? "border-r-subtle border-r" : "border-r-default border-r")
)}>
@@ -151,7 +151,7 @@ function Cell({ isDisabled, topOffsetMinutes, timeSlot }: CellProps) {
className={classNames(
"group flex w-[calc(100%-1px)] items-center justify-center",
isDisabled && "pointer-events-none",
!isDisabled && "bg-default dark:bg-muted",
!isDisabled && "bg-default dark:bg-cal-muted",
topOffsetMinutes && "absolute"
)}
data-disabled={isDisabled}
@@ -168,7 +168,7 @@ function Cell({ isDisabled, topOffsetMinutes, timeSlot }: CellProps) {
{!isDisabled && hoverEventDuration !== 0 && (
<div
className={classNames(
"opacity-4 bg-brand-default hover:bg-brand-default text-brand dark:border-emphasis absolute hidden rounded-[4px] p-[6px] text-xs font-semibold leading-5 group-hover:flex group-hover:cursor-pointer",
"bg-brand-default hover:bg-brand-default text-brand dark:border-emphasis absolute hidden rounded-[4px] p-[6px] text-xs font-semibold leading-5 group-hover:flex group-hover:cursor-pointer",
hoverEventDuration && hoverEventDuration > 15 && "items-start pt-3",
hoverEventDuration && hoverEventDuration < 15 && "items-center"
)}
@@ -179,7 +179,7 @@ function Cell({ isDisabled, topOffsetMinutes, timeSlot }: CellProps) {
// multiple events are stacked next to each other. We might need to add this back later.
width: "calc(100% - 2px)",
}}>
<div className="overflow-ellipsis leading-[0]">{timeSlot.format(timeFormat)}</div>
<div className="text-ellipsis leading-0">{timeSlot.format(timeFormat)}</div>
</div>
)}
</div>
@@ -195,7 +195,7 @@ function CustomCell({
return (
<div
className={classNames(
"bg-default dark:bg-muted group absolute z-[65] flex w-[calc(100%-1px)] items-center justify-center"
"bg-default dark:bg-cal-muted group absolute z-65 flex w-[calc(100%-1px)] items-center justify-center"
)}
data-slot={timeSlot.toISOString()}
style={{
@@ -204,7 +204,7 @@ function CustomCell({
}}>
<div
className={classNames(
"dark:border-emphasis bg-default dark:bg-muted cursor-pointer rounded-[4px] p-[6px] text-xs font-semibold dark:text-white"
"dark:border-emphasis bg-default dark:bg-cal-muted cursor-pointer rounded-[4px] p-[6px] text-xs font-semibold dark:text-white"
)}
style={{
height: `calc(${startEndTimeDuration}*var(--one-minute-height) - 2px)`,
@@ -31,7 +31,7 @@ const eventClasses = cva(
false: "hover:cursor-pointer",
},
selected: {
true: "bg-inverted text-inverted border-[1px] border-transparent",
true: "bg-inverted text-inverted border border-transparent",
false: "",
},
},
@@ -107,7 +107,7 @@ export function Event({
{displayType === "single-line" && (
<div
className={classNames(
"flex w-full shrink-0 gap-2 overflow-hidden overflow-ellipsis whitespace-nowrap text-left leading-4",
"flex w-full shrink-0 gap-2 overflow-hidden text-ellipsis whitespace-nowrap text-left leading-4",
"items-center"
)}>
<span>{event.title}</span>
@@ -24,13 +24,13 @@ export const HorizontalLines = ({
return (
<div
className={classNames(
"pointer-events-none relative z-[60] col-start-1 col-end-2 row-start-1 grid divide-y",
"pointer-events-none relative z-60 col-start-1 col-end-2 row-start-1 grid divide-y",
borderColor === "subtle" ? "divide-subtle" : "divide-default"
)}
style={{
gridTemplateRows: `repeat(${hours.length}, minmax(var(--gridDefaultSize),1fr)`,
}}>
<div className="row-end-1 h-[--calendar-offset-top] " ref={containerOffsetRef} />
<div className="row-end-1 h-(--calendar-offset-top) " ref={containerOffsetRef} />
{hours.map((hour) => (
<div key={`${id}-${hour.get("hour")}`}>
<div className="text-muted sticky left-0 z-20 -ml-14 -mt-2.5 w-14 pr-2 text-right text-xs leading-5 rtl:-mr-14">
@@ -3,7 +3,7 @@ import classNames from "@calcom/ui/classNames";
export const Spinner = ({ className }: { className?: string }) => (
<div
className={classNames(
"fixed left-[calc(50%+calc(var(--booker-meta-width,0px)/2))] top-1/2 z-[80] h-10 w-10 -translate-x-1/2 -translate-y-1/2",
"fixed left-[calc(50%+calc(var(--booker-meta-width,0px)/2))] top-1/2 z-80 h-10 w-10 -translate-x-1/2 -translate-y-1/2",
className
)}>
<svg className="h-10 w-10" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
@@ -19,7 +19,7 @@ export const VerticalLines = ({ days, borderColor }: { days: dayjs.Dayjs[]; bord
return (
<div
className={classNames(
"pointer-events-none relative z-[60] col-start-1 col-end-2 row-start-1 grid auto-cols-auto grid-rows-1 divide-x",
"pointer-events-none relative z-60 col-start-1 col-end-2 row-start-1 grid auto-cols-auto grid-rows-1 divide-x",
borderColor === "subtle" ? "divide-subtle" : "divide-default"
)}
dir={direction}
@@ -161,7 +161,7 @@ export function TimezoneSelectComponent({
classNames(
"bg-default py-2.5 px-3 rounded-md text-default ",
state.isFocused && "bg-subtle",
state.isDisabled && "bg-muted",
state.isDisabled && "bg-cal-muted",
state.isSelected && "bg-emphasis text-default",
timezoneClassNames?.option && timezoneClassNames.option(state)
),
@@ -118,7 +118,7 @@ export function DataTable<TData>({
return (
<div
className={classNames(
!hasWrapperContext ? "grid" : "bg-muted grid rounded-xl px-0.5 pb-0.5",
!hasWrapperContext ? "grid" : "bg-cal-muted grid rounded-xl px-0.5 pb-0.5",
className
)}
style={{
@@ -153,7 +153,7 @@ export function DataTable<TData>({
<TableNew
className={classNames(
"data-table grid border-0",
!hasWrapperContext && "bg-muted rounded-xl px-0.5 pb-0.5"
!hasWrapperContext && "bg-cal-muted rounded-xl px-0.5 pb-0.5"
)}
style={{
...columnSizingVars,
@@ -174,7 +174,7 @@ export function DataTable<TData>({
}}
className={classNames(
"relative flex shrink-0 items-center",
"bg-muted",
"bg-cal-muted",
column.getIsPinned() && "top-0 z-20 sm:sticky"
)}>
<TableHeadLabel header={header} />
@@ -184,9 +184,9 @@ export function DataTable<TData>({
onTouchStart={header.getResizeHandler()}
className={classNames(
"group absolute right-0 top-0 h-full w-[5px] cursor-col-resize touch-none select-none opacity-0 hover:opacity-50",
header.column.getIsResizing() && "!opacity-75"
header.column.getIsResizing() && "opacity-75!"
)}>
<div className="bg-inverted mx-auto h-full w-[1px]" />
<div className="bg-inverted mx-auto h-full w-px" />
</div>
)}
</TableHead>
@@ -287,7 +287,7 @@ function SeparatorRowRenderer({ separator, className }: { separator: SeparatorRo
return (
<div
className={classNames(
"bg-muted text-emphasis w-full px-3 py-2 font-semibold",
"bg-cal-muted text-emphasis w-full px-3 py-2 font-semibold",
separator.className,
className
)}>
@@ -429,10 +429,10 @@ function DataTableBody<TData>({
width: `var(--col-${kebabCase(cell.column.id)}-size)`,
}}
className={classNames(
"bg-default group-hover:!bg-muted group-data-[state=selected]:bg-subtle flex shrink-0 items-center overflow-hidden",
"bg-default group-hover:!bg-cal-muted group-data-[state=selected]:bg-subtle flex shrink-0 items-center overflow-hidden",
variant === "compact" && "p-0",
column.getIsPinned() &&
"bg-default group-hover:!bg-muted group-data-[state=selected]:bg-subtle sm:sticky"
"bg-default group-hover:!bg-cal-muted group-data-[state=selected]:bg-subtle sm:sticky"
)}>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</TableCell>
@@ -471,7 +471,7 @@ const TableHeadLabel = <TData,>({ header }: { header: Header<TData, unknown> })
type="button"
className={classNames(
"group mr-1 flex w-full items-center gap-2 rounded-md px-2 py-1",
open && "bg-muted"
open && "bg-cal-muted"
)}>
<div
className="text-default truncate text-sm leading-none"
@@ -78,7 +78,7 @@ function AddFilterButtonComponent<TData>(
addFilter(column.id);
setOpen(false);
}}
className="flex items-center justify-between px-4 py-2"
className="flex items-center justify-between px-4 py-2 rounded-none"
data-testid={`add-filter-item-${column.id}`}>
<span>{startCase(column.title)}</span>
{showHiddenIndicator && <Icon name="eye-off" className="h-4 w-4 opacity-50" />}
@@ -142,8 +142,8 @@ export function BaseSelectFilterOptions<
onSelect={() => onOptionSelect(column, filterValue, optionValue)}>
<div
className={classNames(
"border-subtle mr-2 flex h-4 w-4 items-center justify-center rounded-sm border",
isOptionSelected(filterValue, optionValue) ? "bg-primary" : "opacity-50"
"border-subtle mr-2 flex h-4 w-4 items-center justify-center rounded-sm",
isOptionSelected(filterValue, optionValue) ? "bg-primary-default" : "border opacity-50"
)}>
{isOptionSelected(filterValue, optionValue) && (
<Icon name="check" className="text-primary-foreground h-4 w-4" />
@@ -220,7 +220,7 @@ export const DateRangeFilter = ({
key={option.value}
data-testid={`date-range-options-${option.value}`}
className={classNames(
"cursor-pointer justify-between px-3 py-2",
"cursor-pointer justify-between px-3 py-2 rounded-none",
selectedPreset.value === option.value && "bg-emphasis"
)}
onSelect={() => {
@@ -87,7 +87,7 @@ export function DuplicateSegmentDialog({
<DialogContent>
<DialogHeader title={t("duplicate_segment")} />
<Form form={form} handleSubmit={handleSubmit}>
<div className="space-y-4">
<div className="stack-y-4">
<TextField
required
data-testid="duplicate-segment-name"
@@ -70,7 +70,7 @@ export function RenameSegmentDialog({
<DialogContent>
<DialogHeader title={t("rename_segment")} />
<Form form={form} handleSubmit={handleSubmit}>
<div className="space-y-4">
<div className="stack-y-4">
<TextField
required
data-testid="rename-segment-name"
@@ -184,7 +184,7 @@ export function SaveFilterSegmentButton() {
<RadioGroup
defaultValue="update"
onValueChange={(value: string) => setSaveMode(value as "create" | "update")}
className="space-y-2">
className="stack-y-2">
<RadioField
id="update_segment"
label={t("override_segment", { name: selectedSegment.name })}
@@ -216,7 +216,7 @@ export function SaveFilterSegmentButton() {
</div>
{isTeamSegment && teams && teams.length > 0 && (
<div>
<div className="mt-1.5">
<Select<{ value: string; label: string }>
options={teams.map((team) => ({
value: team.id.toString(),
@@ -151,7 +151,7 @@ export default function ApiKeyDialogForm({
setSuccessfulNewApiKeyModal(true);
}
}}
className="space-y-4">
className="stack-y-4">
<div className="mb-4 mt-1">
<h2 className="font-semi-bold font-cal text-emphasis text-xl tracking-wide">
{defaultValues ? t("edit_api_key") : t("create_api_key")}
@@ -7,7 +7,7 @@ export const AppearanceSkeletonLoader = () => {
<div className="border-subtle mt-6 flex items-center rounded-t-xl border p-6 text-sm">
<SkeletonText className="h-8 w-1/3" />
</div>
<div className="border-subtle space-y-6 border-x px-4 py-6 sm:px-6">
<div className="border-subtle stack-y-6 border-x px-4 py-6 sm:px-6">
<div className="flex w-full items-center justify-center gap-6">
<div className="bg-emphasis h-32 flex-1 animate-pulse rounded-md p-5" />
<div className="bg-emphasis h-32 flex-1 animate-pulse rounded-md p-5" />
@@ -85,7 +85,7 @@ const CreateANewLicenseKeyFormChild = ({ session }: { session: Ensure<SessionCon
{!stripeCheckoutUrl ? (
<Form
form={newLicenseKeyFormMethods}
className="space-y-5"
className="stack-y-5"
id="createOrg"
handleSubmit={(values) => {
mutation.mutate(values);
@@ -177,7 +177,7 @@ const CreateANewLicenseKeyFormChild = ({ session }: { session: Ensure<SessionCon
/>
</div>
<div className="flex flex-wrap gap-2 [&>*]:flex-1">
<div className="flex flex-wrap gap-2 *:flex-1">
<Controller
name="entityCount"
control={newLicenseKeyFormMethods.control}
@@ -257,7 +257,7 @@ const CreateANewLicenseKeyFormChild = ({ session }: { session: Ensure<SessionCon
<TextField className="flex-1" disabled value={stripeCheckoutUrl} />
</div>
<div className="mt-4 flex gap-2 [&>*]:flex-1 [&>*]:justify-center">
<div className="mt-4 flex gap-2 *:flex-1 *:justify-center">
<Button
color="secondary"
onClick={() => {
@@ -38,7 +38,7 @@ const CreateDirectory = ({ orgId }: { orgId: number | null }) => {
{t("directory_sync_title")}
</p>
</div>
<div className="flex-shrink-0 pt-3 sm:ml-auto sm:pl-3 sm:pt-0">
<div className="shrink-0 pt-3 sm:ml-auto sm:pl-3 sm:pt-0">
<Button color="primary" onClick={() => setOpenModal(true)}>
{t("configure")}
</Button>
@@ -61,7 +61,7 @@ const CreateDirectory = ({ orgId }: { orgId: number | null }) => {
</h2>
<p className="mt-1 text-sm text-gray-500">{t("directory_sync_configure_description")}</p>
</div>
<fieldset className="space-y-6 py-2">
<fieldset className="stack-y-6 py-2">
<Controller
control={form.control}
name="name"
@@ -10,7 +10,7 @@ const DirectoryInfo = ({ directory }: { directory: Directory }) => {
const { t } = useLocale();
return (
<div className="space-y-8">
<div className="stack-y-8">
<p className="text-default text-sm font-normal leading-6 dark:text-gray-300">
{t("directory_sync_info_description")}
</p>
@@ -76,7 +76,7 @@ const GroupNameCell = ({ groupNames, teamId, directoryId }: GroupNameCellProps)
{groupNames.map((name) => (
<Badge variant="gray" size="lg" key={name} className="min-h-8 h-auto py-2">
<div className="flex min-w-0 items-center gap-2">
<p className="min-w-0 break-words">{name}</p>
<p className="min-w-0 wrap-break-word">{name}</p>
<div className="hover:bg-emphasis shrink-0 rounded p-1">
<Icon name="x" className="h-4 w-4 stroke-[3px]" onClick={() => removeGroupName(name)} />
</div>
@@ -34,7 +34,7 @@ export const AboutOrganizationForm = () => {
<>
<Form
form={aboutOrganizationFormMethods}
className="space-y-5"
className="stack-y-5"
handleSubmit={(values) => {
setLogo(values.logo);
setBio(values.bio);
@@ -31,7 +31,7 @@ export const AdminOnboardingHandover = () => {
const onboardingUrl = `${WEBAPP_URL}/settings/organizations/new/resume?onboardingId=${onboardingId}`;
return (
<div className="space-y-6">
<div className="stack-y-6">
{/* Instructions Card */}
<div className="bg-subtle rounded-lg p-6">
<h3 className="text-emphasis mb-2 text-lg font-medium">{t("next_steps")}</h3>
@@ -40,7 +40,7 @@ export const AdminOnboardingHandover = () => {
setup:
</p>
<div className="space-y-3">
<div className="stack-y-3">
<div className="bg-default flex items-center gap-2 rounded-md border p-3">
<code className="text-default flex-1 truncate font-mono text-sm" data-testid="onboarding-url">
{onboardingUrl}
@@ -115,7 +115,7 @@ const CreateANewOrganizationFormChild = ({ session }: { session: Ensure<SessionC
<>
<Form
form={newOrganizationFormMethods}
className="space-y-5"
className="stack-y-5"
id="createOrg"
handleSubmit={async (v) => {
if (!needToCreateOnboarding) {
@@ -325,7 +325,7 @@ const CreateANewOrganizationFormChild = ({ session }: { session: Ensure<SessionC
{/* This radio group does nothing - its just for visual purposes */}
{isBillingEnabled && !isAdmin && (
<>
<div className="bg-subtle space-y-5 rounded-lg p-5">
<div className="bg-subtle stack-y-5 rounded-lg p-5">
<h3 className="font-cal text-default text-lg font-semibold leading-4">
Upgrade to Organizations
</h3>
@@ -29,12 +29,12 @@ export default function TeamInviteFromOrg({
});
return (
<div className="bg-muted border-subtle flex flex-col rounded-md border p-4">
<div className="bg-cal-muted border-subtle flex flex-col rounded-md border p-4">
<div className="-my-1">
<TextField placeholder="Search..." onChange={(e) => setSearchQuery(e.target.value)} />
</div>
<hr className="border-subtle -mx-4 mt-2" />
<div className="scrollbar min-h-48 flex max-h-48 flex-col space-y-0.5 overflow-y-scroll pt-2">
<div className="scrollbar min-h-48 flex max-h-48 flex-col stack-y-0.5 overflow-y-scroll pt-2">
<>
{filteredMembers &&
filteredMembers.map((member) => {
@@ -31,7 +31,7 @@ export function WelcomeToOrganizationsModal() {
return (
<Dialog open={isOpen} onOpenChange={(open) => !open && closeModal()}>
<DialogContent size="default" className="!p-0 flex flex-col max-h-[95vh]" enableOverflow>
<DialogContent size="default" className="flex max-h-[95vh] flex-col !p-0" enableOverflow>
<div className="flex flex-1 flex-col overflow-y-auto">
<div className="flex flex-col gap-4 p-6">
<div className="flex flex-col items-center gap-1">
@@ -136,14 +136,16 @@ export function WelcomeToOrganizationsModal() {
</div>
<div className="mb-2 flex flex-col gap-2 text-center">
<h2 className="font-cal text-emphasis text-2xl leading-none">{t("welcome_to_organizations")}</h2>
<h2 className="font-cal text-emphasis text-2xl leading-none">
{t("welcome_to_organizations")}
</h2>
<p className="text-default text-sm leading-normal">{t("organizations_welcome_description")}</p>
</div>
<div className="mb-2 flex flex-col gap-3">
{features.map((feature) => (
<div key={feature} className="flex items-start gap-2">
<Icon name="check" className="text-muted mt-0.5 h-4 w-4 flex-shrink-0" />
<Icon name="check" className="text-muted mt-0.5 h-4 w-4 shrink-0" />
<span className="text-default text-sm font-medium leading-tight">{t(feature)}</span>
</div>
))}
Loaded 100 of 447 files, more files were not shown because too many files have changed in this diff. Show more