Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
Russell/dechud modals (#3077)
Fake-User9e1b0d9d8c3b
diff --git a/js/app/packages/app/component/FatalError.tsx b/js/app/packages/app/component/FatalError.tsxindex 296f5c92b6..3fa1ea7f96 100644--- a/js/app/packages/app/component/FatalError.tsx+++ b/js/app/packages/app/component/FatalError.tsx@@ -3,6 +3,7 @@ import ResetIcon from '@icon/regular/arrow-clockwise.svg';import HomeIcon from '@icon/regular/house.svg';import { logger } from '@observability';import { Show } from 'solid-js';+import { Dialog, Panel } from '@ui';interface FatalErrorProps {error?: Error;@@ -15,46 +16,48 @@ export function FatalError(props: FatalErrorProps) {});return (- <div class="min-h-screen flex items-center justify-center bg-panel">- <div class="max-w-md w-full p-8 bg-panel rounded-xl shadow-lg shadow-edge">- <div class="text-center">- <h1 class="text-2xl font-bold text-failure mb-4">- Something went terribly wrong- </h1>+ <Dialog open position="center" class="w-[480px]">+ <Panel active depth={2}>+ <div class="p-6 sm:p-8 font-sans">+ <div class="text-center">+ <h1 class="text-ink text-lg font-semibold leading-7 mb-4">+ Something went terribly wrong+ </h1>- <Show when={props.error} keyed>- {(error) => (- <div class="mb-6 p-4 bg-failure/10 rounded text-left">- <p class="text-sm text-failure font-mono break-all">- {error.message || error.toString()}- </p>- </div>- )}- </Show>+ <Show when={props.error} keyed>+ {(error) => (+ <div class="mb-6 p-3 bg-failure/10 border border-edge rounded text-left">+ <p class="text-sm text-failure-ink font-mono break-all">+ {error.message || error.toString()}+ </p>+ </div>+ )}+ </Show>- <p class="text-ink mb-6">- We apologize for the inconvenience. Please try again or contact- support.- </p>+ <p class="text-ink-muted text-sm mb-6">+ We apologize for the inconvenience. Please try again or contact+ support.+ </p>- <div class="flex flex-row gap-4 justify-center">- <DeprecatedTextButton- theme="accent"- onClick={() => {- window.location.href = window.location.origin + '/app';- }}- text="Home"- icon={HomeIcon}- />- <DeprecatedTextButton- theme="base"- onClick={props.reset}- text="Try Again"- icon={ResetIcon}- />+ <div class="flex flex-row gap-3 justify-center">+ <DeprecatedTextButton+ theme="accent"+ onClick={() => {+ window.location.href = window.location.origin + '/app';+ }}+ text="Home"+ icon={HomeIcon}+ />+ <DeprecatedTextButton+ theme="base"+ onClick={props.reset}+ text="Try Again"+ icon={ResetIcon}+ />+ </div></div></div>- </div>- </div>+ </Panel>+ </Dialog>);}diff --git a/js/app/packages/app/component/app-sidebar/invite-modal.tsx b/js/app/packages/app/component/app-sidebar/invite-modal.tsxindex 62b4ad37fb..8d88de2bd3 100644--- a/js/app/packages/app/component/app-sidebar/invite-modal.tsx+++ b/js/app/packages/app/component/app-sidebar/invite-modal.tsx@@ -1,12 +1,10 @@-import { Dialog } from '@kobalte/core/dialog';import { createSignal, Show } from 'solid-js';import { useReferralCode } from '@core/context/user';import { getWebOrigin } from '@core/util/webOrigin';import { authServiceClient } from '@service-auth/client';import { contactsClient } from '@service-contacts/client';import { isOk } from '@core/util/maybeResult';-import { DialogWrapper } from '@core/component/DialogWrapper';-import { Button } from '@ui/components/Button';+import { Dialog, Button, Panel } from '@ui';import { toast } from '@core/component/Toast/Toast';import CloseIcon from '@icon/regular/x.svg';import ClipboardIcon from '@icon/regular/clipboard.svg';@@ -69,8 +67,8 @@ export const InviteModal = () => {return (<Dialog open={inviteModalOpen()} onOpenChange={(o) => !o && handleClose()}>- <Dialog.Portal>- <DialogWrapper>+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-col text-ink"><div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-[40px]"><Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">@@ -153,8 +151,8 @@ export const InviteModal = () => {</Show></div></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog>);};diff --git a/js/app/packages/app/component/bulk-edit-entity/BulkEditEntityModal.tsx b/js/app/packages/app/component/bulk-edit-entity/BulkEditEntityModal.tsxindex 9af37a8e3f..cf3d067b35 100644--- a/js/app/packages/app/component/bulk-edit-entity/BulkEditEntityModal.tsx+++ b/js/app/packages/app/component/bulk-edit-entity/BulkEditEntityModal.tsx@@ -1,6 +1,5 @@import { createControlledOpenSignal } from '@core/util/createControlledOpenSignal';-import { DialogWrapper } from '@core/component/DialogWrapper';-import { Dialog } from '@kobalte/core/dialog';+import { Dialog, Panel } from '@ui';import type { EntityData } from '@entity';import {type Accessor,@@ -43,10 +42,9 @@ const BulkEditEntityModalContent = (props: {}props.setIsOpen(open);}}- modal={true}>- <Dialog.Portal>- <DialogWrapper>+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-col text-ink"><Show when={props.view === 'rename'}><BulkRenameEntitiesView@@ -72,8 +70,8 @@ const BulkEditEntityModalContent = (props: {/></Show></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog>);};diff --git a/js/app/packages/app/component/command/CommandMenu.tsx b/js/app/packages/app/component/command/CommandMenu.tsxindex 1aa6f68a59..b67ed5c0a0 100644--- a/js/app/packages/app/component/command/CommandMenu.tsx+++ b/js/app/packages/app/component/command/CommandMenu.tsx@@ -1,4 +1,3 @@-import { DialogWrapper } from '@core/component/DialogWrapper';import {isCommandItem,isEntityItem,@@ -7,7 +6,7 @@ import {} from './useCommandItems';import { getActiveCommandsFromScope } from '@core/hotkey/getCommands';import { runCommand } from '@core/hotkey/utils';-import { Dialog } from '@kobalte/core/dialog';+import { Dialog, Panel } from '@ui';import { Tabs } from '@core/component/Tabs';import { registerHotkey, useHotkeyDOMScope } from 'core/hotkey/hotkeys';import {@@ -84,23 +83,25 @@ export function CommandMenu() {};return (- <Dialog open={CommandState.isOpen()} onOpenChange={CommandState.setIsOpen}>- <Dialog.Portal>- <DialogWrapper- contentRef={setCommandMenuRef}- onCloseAutoFocus={(event) => {- if (suppressCloseAutoFocus) {- event.preventDefault();- suppressCloseAutoFocus = false;- }- }}- >+ <Dialog+ open={CommandState.isOpen()}+ onOpenChange={CommandState.setIsOpen}+ contentRef={setCommandMenuRef}+ onCloseAutoFocus={(event) => {+ if (suppressCloseAutoFocus) {+ event.preventDefault();+ suppressCloseAutoFocus = false;+ }+ }}+ >+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><CommandMenuInnercommandMenuRef={commandMenuRef}onSelect={handleSelect}/>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog>);}diff --git a/js/app/packages/app/component/macro-mcp-setup-modal/MacroMcpSetupModal.tsx b/js/app/packages/app/component/macro-mcp-setup-modal/MacroMcpSetupModal.tsxindex bbaaaf254b..ab9fe70f72 100644--- a/js/app/packages/app/component/macro-mcp-setup-modal/MacroMcpSetupModal.tsx+++ b/js/app/packages/app/component/macro-mcp-setup-modal/MacroMcpSetupModal.tsx@@ -1,8 +1,7 @@import { AiChatEmptyState } from '@core/component/AI/component/AIChatEmptyState';-import { DialogWrapper } from '@core/component/DialogWrapper';import { createControlledOpenSignal } from '@core/util/createControlledOpenSignal';-import { Dialog } from '@kobalte/core/dialog';import { Show } from 'solid-js';+import { Dialog, Panel } from '@ui';const [macroMcpSetupOpen, setMacroMcpSetupOpen] = createControlledOpenSignal(false,@@ -22,12 +21,16 @@ export const closeMacroMcpSetupModal = () => {export function MacroMcpSetupModal() {return (<Show when={macroMcpSetupOpen()}>- <Dialog open={macroMcpSetupOpen()} onOpenChange={setMacroMcpSetupOpen}>- <Dialog.Portal>- <DialogWrapper width="760px">+ <Dialog+ open={macroMcpSetupOpen()}+ onOpenChange={setMacroMcpSetupOpen}+ class="w-[760px]"+ >+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><AiChatEmptyState />- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog></Show>);diff --git a/js/app/packages/app/component/next-soup/soup-view/NewCallButton.tsx b/js/app/packages/app/component/next-soup/soup-view/NewCallButton.tsxindex 688cf0fb16..e611bc02da 100644--- a/js/app/packages/app/component/next-soup/soup-view/NewCallButton.tsx+++ b/js/app/packages/app/component/next-soup/soup-view/NewCallButton.tsx@@ -6,12 +6,10 @@ import type { WithCustomUserInput } from '@core/user';import { isErr } from '@core/util/maybeResult';import { toast } from '@core/component/Toast/Toast';import { commsServiceClient } from '@service-comms/client';-import { DialogWrapper } from '@core/component/DialogWrapper';import PhoneCallIcon from '@macro-icons/wide/call.svg';import XIcon from '@icon/regular/x.svg';-import { Dialog } from '@kobalte/core/dialog';import { createSignal } from 'solid-js';-import { Button } from '@ui/components/Button';+import { Dialog, Button, Panel } from '@ui';export function NewCallButton() {const [isOpen, setIsOpen] = createSignal(false);@@ -81,59 +79,61 @@ export function NewCallButton() {}return (- <Dialog- modal- open={isOpen()}- onOpenChange={(open) => {- setIsOpen(open);- if (!open) reset();- }}- >- <Dialog.Trigger- as={Button}+ <>+ <Buttonvariant="secondary"size="sm"class="rounded-xs whitespace-nowrap px-2 text-ink-muted hover:text-ink"+ onClick={() => setIsOpen(true)}><PhoneCallIcon class="size-3.5" />New Call- </Dialog.Trigger>- <Dialog.Portal>- <DialogWrapper width="512px">- <div class="flex flex-col text-ink">- <div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-[40px]">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">- <XIcon />- </Dialog.CloseButton>- <Dialog.Title as="span" class="text-sm font-medium p-0 m-0">- New Call- </Dialog.Title>- </div>- <div class="flex flex-col p-4 gap-4">- <RecipientSelector<'user' | 'contact' | 'channel'>- options={destinationOptions}- selectedOptions={selectedOptions()}- setSelectedOptions={setSelectedOptions}- placeholder="To: Macro users or email addresses"- triedToSubmit={triedToSubmit}- focusOnMount- triggerMode="input"- />- <div class="flex justify-end">- <Button- variant="secondary"- size="sm"- disabled={isSubmitting()}- onClick={handleStartCall}- >- <PhoneCallIcon class="size-3.5" />- {isSubmitting() ? 'Starting...' : 'Start Call'}- </Button>+ </Button>+ <Dialog+ open={isOpen()}+ onOpenChange={(open) => {+ setIsOpen(open);+ if (!open) reset();+ }}+ class="w-[512px]"+ >+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]">+ <div class="flex flex-col text-ink">+ <div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-[40px]">+ <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">+ <XIcon />+ </Dialog.CloseButton>+ <Dialog.Title as="span" class="text-sm font-medium p-0 m-0">+ New Call+ </Dialog.Title>+ </div>+ <div class="flex flex-col p-4 gap-4">+ <RecipientSelector<'user' | 'contact' | 'channel'>+ options={destinationOptions}+ selectedOptions={selectedOptions()}+ setSelectedOptions={setSelectedOptions}+ placeholder="To: Macro users or email addresses"+ triedToSubmit={triedToSubmit}+ focusOnMount+ triggerMode="input"+ />+ <div class="flex justify-end">+ <Button+ variant="secondary"+ size="sm"+ disabled={isSubmitting()}+ onClick={handleStartCall}+ >+ <PhoneCallIcon class="size-3.5" />+ {isSubmitting() ? 'Starting...' : 'Start Call'}+ </Button>+ </div></div></div></div>- </DialogWrapper>- </Dialog.Portal>- </Dialog>+ </Panel>+ </Dialog>+ </>);}diff --git a/js/app/packages/app/component/paywall/Paywall.tsx b/js/app/packages/app/component/paywall/Paywall.tsxindex a77b80825e..fc31fb8c43 100644--- a/js/app/packages/app/component/paywall/Paywall.tsx+++ b/js/app/packages/app/component/paywall/Paywall.tsx@@ -1,8 +1,8 @@import { globalSplitManager } from '@app/signal/splitLayout';import { usePaywallState } from '@core/constant/PaywallState';import { useHotkeyDOMScope } from '@core/hotkey/hotkeys';-import Dialog from '@corvu/dialog';import { onMount } from 'solid-js';+import { Dialog, Panel } from '@ui';import PaywallComponent from './PaywallComponent';export function Paywall() {@@ -17,7 +17,6 @@ export function Paywall() {const hidePaywall = () => {_hidePaywall();- // TODO: correctly return focus back soupsetTimeout(() => {setTimeout(() => {const activeId = split?.activeSplitId();@@ -31,7 +30,6 @@ export function Paywall() {return;}- // Fallback to the unified entity listconst unifiedEntityList = document.querySelector('[data-unified-entity-list]')?.closest('[tabindex="0"]') as HTMLElement;@@ -56,74 +54,24 @@ export function Paywall() {});});- // const formSubmit = async (e: SubmitEvent) => {- // e.preventDefault();- // if (isLoading()) return;- // setIsLoading(true);- // try {- // if (!discountCode().trim()) {- // if (!checkoutSessionUrl()) {- // toast.failure('Failed to create checkout session');- // return;- // }- // window.location.href = checkoutSessionUrl() ?? '';- // return;- // }- // const session = await stripeServiceClient.createCheckoutSession(- // discountCode()- // );- // if (session) {- // window.location.href = session;- // }- // } catch (error) {- // console.error(error);- // toast.failure('Failed to apply discount');- // } finally {- // setDiscountCode('');- // setIsLoading(false);- // }- // };-return (<Dialogopen={paywallOpen()}- // closeOnOutsidePointerStrategy="pointerdown"- // noOutsidePointerEvents={!paywallOpen()}- // trapFocus={true}- modal={true}- onEscapeKeyDown={hidePaywall}+ onOpenChange={(open) => !open && hidePaywall()}+ position="center"+ class="w-[900px]">- <Dialog.Portal>- {/* Full screen overlay with onboarding styling */}-- <Dialog.Content>- <div- class="fixed top-0 left-0 w-full h-full bg-dialog font-sans z-9999"- ref={paywallContentEl}- tabIndex={-1}- >- {/* Subtle border decorations matching onboarding - closer on mobile */}- <div class="w-px border-edge border-dashed border-r h-full top-0 left-4 sm:left-12 absolute"></div>- <div class="w-px border-edge border-dashed border-r h-full top-0 right-4 sm:right-12 absolute"></div>- <div class="w-full h-px border-edge border-dashed border-b bottom-4 sm:bottom-12 left-0 absolute"></div>- <div class="w-full h-px border-edge border-dashed border-b top-4 sm:top-12 left-0 absolute"></div>-- {/* Content area with same padding as onboarding */}- <div class="flex flex-col h-full">- <div class="flex-1 overflow-y-auto px-8 sm:px-16 pb-8 pt-16 sm:pt-8">- <div class="max-w-4xl mx-auto min-h-full flex items-center justify-center">- <div class="w-full py-4 sm:py-8">- <PaywallComponent- cb={hidePaywall}- errorKey={paywallKey()}- />- </div>- </div>- </div>- </div>+ <Panel active depth={2}>+ <div+ class="*:max-h-[85vh] font-sans"+ ref={paywallContentEl}+ tabIndex={-1}+ >+ <div class="overflow-y-auto p-6 sm:p-8">+ <PaywallComponent cb={hidePaywall} errorKey={paywallKey()} /></div>- </Dialog.Content>- </Dialog.Portal>+ </div>+ </Panel></Dialog>);}diff --git a/js/app/packages/app/component/paywall/PaywallComponent.tsx b/js/app/packages/app/component/paywall/PaywallComponent.tsxindex 1d0a2da728..c3e0b53fc6 100644--- a/js/app/packages/app/component/paywall/PaywallComponent.tsx+++ b/js/app/packages/app/component/paywall/PaywallComponent.tsx@@ -137,11 +137,11 @@ const PaywallComponent = (props: PaywallComponent) => {};return (- <div class="space-y-2 w-full">+ <div class="relative space-y-2 w-full"><Show when={!props.hideCloseButton}><buttononClick={props.cb}- class="fixed top-6 right-6 sm:top-3 sm:right-3 text-ink-extra-muted hover:text-ink transition-colors"+ class="absolute -top-2 -right-2 sm:-top-3 sm:-right-3 text-ink-extra-muted hover:text-ink transition-colors z-10"><IconX class="w-5 sm:w-6 h-5 sm:h-6" /></button>diff --git a/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx b/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsxindex b2892bafe5..caf4e118c5 100644--- a/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx+++ b/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx@@ -1,5 +1,4 @@-import { DialogWrapper } from '@core/component/DialogWrapper';-import { Dialog } from '@kobalte/core/dialog';+import { Dialog, Panel } from '@ui';import { registerHotkey, useHotkeyDOMScope } from 'core/hotkey/hotkeys';import {type Accessor,@@ -149,9 +148,13 @@ export function PropertyEditorModal() {const keybindings = useListKeyBindings(() => dialogRef());return (- <Dialog open={propertyEditorOpen()} onOpenChange={togglePropertyEditor}>- <Dialog.Portal>- <DialogWrapper contentRef={mergeRefs(attach, setDialogRef)}>+ <Dialog+ open={propertyEditorOpen()}+ onOpenChange={togglePropertyEditor}+ contentRef={mergeRefs(attach, setDialogRef)}+ >+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-col max-h-108 overflow-hidden text-sm"><div class="flex items-center gap-2 bg-panel px-2 h-10 border-b border-edge-muted shrink-0"><span class="pl-2 pointer-events-none">❯</span>@@ -197,8 +200,8 @@ export function PropertyEditorModal() {</Match></Switch></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog>);}diff --git a/js/app/packages/app/component/settings/Account.tsx b/js/app/packages/app/component/settings/Account.tsxindex 9a5a4a2927..b0fdbf56de 100644--- a/js/app/packages/app/component/settings/Account.tsx+++ b/js/app/packages/app/component/settings/Account.tsx@@ -5,10 +5,8 @@ import { useHasPaidAccess } from '@core/auth/license';import { UserIcon } from '@core/component/UserIcon';import { useLogout } from '@core/auth/logout';import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';-import { Modal, Overlay, Content, Header, Message, ButtonBar } from '@core/component/Modal';import { toast } from '@core/component/Toast/Toast';-import { Button } from '@ui';-import { Panel } from '@ui';+import { Dialog, Button, Panel } from '@ui';import {blockNameToFileExtensions,blockNameToMimeTypes,@@ -410,45 +408,61 @@ export function Account() {<Button variant="destructive" depth={3} onClick={() => setShowDeleteModal(true)}>Delete Account</Button>- <Modal open={showDeleteModal()} onOpenChange={setShowDeleteModal}>- <Overlay />- <Content>- <Header>Delete Account</Header>- <Message>- Are you sure you want to delete your account? This action is- permanent and cannot be undone.- </Message>- <ButtonBar>- <Button variant="secondary" depth={3} onClick={() => setShowDeleteModal(false)}>- Cancel- </Button>- <Button variant="destructive" depth={3} onClick={() => {- setShowDeleteModal(false);- setShowDeleteConfirmModal(true);- }}>- Delete- </Button>- </ButtonBar>- </Content>- </Modal>- <Modal open={showDeleteConfirmModal()} onOpenChange={setShowDeleteConfirmModal}>- <Overlay />- <Content>- <Header>Are you absolutely sure?</Header>- <Message>- This will permanently delete your account and all associated- data. This cannot be undone.- </Message>- <ButtonBar>- <Button variant="secondary" depth={3} onClick={() => setShowDeleteConfirmModal(false)}>- Cancel- </Button>- <Button variant="destructive" depth={3} onClick={deleteAccountHandler}>- Delete My Account- </Button>- </ButtonBar>- </Content>- </Modal>+ <Dialog+ open={showDeleteModal()}+ onOpenChange={setShowDeleteModal}+ position="center"+ class="w-[480px]"+ >+ <Panel active depth={2}>+ <div class="p-6 font-sans flex flex-col gap-3">+ <Dialog.Title class="text-ink text-lg font-semibold leading-7">+ Delete Account+ </Dialog.Title>+ <Dialog.Description class="text-ink-muted text-sm font-normal leading-tight">+ Are you sure you want to delete your account? This action is+ permanent and cannot be undone.+ </Dialog.Description>+ <div class="pt-3 justify-end items-center gap-3 inline-flex">+ <Button variant="secondary" depth={3} onClick={() => setShowDeleteModal(false)}>+ Cancel+ </Button>+ <Button variant="destructive" depth={3} onClick={() => {+ setShowDeleteModal(false);+ setShowDeleteConfirmModal(true);+ }}>+ Delete+ </Button>+ </div>+ </div>+ </Panel>+ </Dialog>+ <Dialog+ open={showDeleteConfirmModal()}+ onOpenChange={setShowDeleteConfirmModal}+ position="center"+ class="w-[480px]"+ >+ <Panel active depth={2}>+ <div class="p-6 font-sans flex flex-col gap-3">+ <Dialog.Title class="text-ink text-lg font-semibold leading-7">+ Are you absolutely sure?+ </Dialog.Title>+ <Dialog.Description class="text-ink-muted text-sm font-normal leading-tight">+ This will permanently delete your account and all associated+ data. This cannot be undone.+ </Dialog.Description>+ <div class="pt-3 justify-end items-center gap-3 inline-flex">+ <Button variant="secondary" depth={3} onClick={() => setShowDeleteConfirmModal(false)}>+ Cancel+ </Button>+ <Button variant="destructive" depth={3} onClick={deleteAccountHandler}>+ Delete My Account+ </Button>+ </div>+ </div>+ </Panel>+ </Dialog></div></Show></div>diff --git a/js/app/packages/app/component/settings/Team.tsx b/js/app/packages/app/component/settings/Team.tsxindex 940842262c..7adbb5b879 100644--- a/js/app/packages/app/component/settings/Team.tsx+++ b/js/app/packages/app/component/settings/Team.tsx@@ -8,13 +8,12 @@ import EnvelopeIcon from '@icon/regular/envelope.svg';import XIcon from '@icon/regular/x.svg';import CaretDownIcon from '@icon/regular/caret-down.svg';import CheckIcon from '@icon/regular/check.svg';-import { DialogWrapper } from '@core/component/DialogWrapper';+import { toast } from '@core/component/Toast/Toast';import { Tooltip } from '@core/component/Tooltip';import { Button } from '@ui/components/Button';-import { Panel } from '@ui';+import { Dialog, Panel } from '@ui';import { cn } from '@ui/utils/classname';-import { Dialog } from '@kobalte/core/dialog';import { Select } from '@kobalte/core/select';import { useUserId } from '@core/context/user';import { useDisplayName, tryMacroId } from '@core/user';@@ -671,14 +670,16 @@ function CreateTeamDialog(props: { open: boolean; onClose: () => void }) {};return (- <Dialog open={props.open} onOpenChange={(open) => !open && props.onClose()}>- <Dialog.Portal>- <DialogWrapper- onOpenAutoFocus={(e) => {- e.preventDefault();- teamNameInputRef?.focus();- }}- >+ <Dialog+ open={props.open}+ onOpenChange={(open) => !open && props.onClose()}+ onOpenAutoFocus={(e) => {+ e.preventDefault();+ teamNameInputRef?.focus();+ }}+ >+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-col text-ink"><div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-10"><Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">@@ -754,8 +755,8 @@ function CreateTeamDialog(props: { open: boolean; onClose: () => void }) {</div></div></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog>);}@@ -1127,11 +1128,15 @@ function TeamManagement(props: {open={showDeleteTeamModal()}onOpenChange={handleDeleteTeamModalClose}>- <Dialog.Portal>- <DialogWrapper>+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-col text-ink"><div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-10">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">+ <Dialog.CloseButton+ as={Button}+ variant="ghost"+ size="icon-sm"+ ><XIcon /></Dialog.CloseButton><Dialog.Title as="span" class="text-sm font-medium p-0 m-0">@@ -1183,19 +1188,23 @@ function TeamManagement(props: {</div></div></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog><Dialogopen={!!showRemoveModal()}onOpenChange={() => setShowRemoveModal(null)}>- <Dialog.Portal>- <DialogWrapper>+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-col text-ink"><div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-10">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">+ <Dialog.CloseButton+ as={Button}+ variant="ghost"+ size="icon-sm"+ ><XIcon /></Dialog.CloseButton><Dialog.Title as="span" class="text-sm font-medium p-0 m-0">@@ -1232,19 +1241,23 @@ function TeamManagement(props: {</div></div></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog><Dialogopen={!!showCancelInviteModal()}onOpenChange={() => setShowCancelInviteModal(null)}>- <Dialog.Portal>- <DialogWrapper>+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-col text-ink"><div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-[40px]">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">+ <Dialog.CloseButton+ as={Button}+ variant="ghost"+ size="icon-sm"+ ><XIcon /></Dialog.CloseButton><Dialog.Title as="span" class="text-sm font-medium p-0 m-0">@@ -1284,16 +1297,23 @@ function TeamManagement(props: {</div></div></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog>- <Dialog open={showInviteModal()} onOpenChange={handleInviteModalClose}>- <Dialog.Portal>- <DialogWrapper>+ <Dialog+ open={showInviteModal()}+ onOpenChange={handleInviteModalClose}+ >+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-col text-ink"><div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-10">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">+ <Dialog.CloseButton+ as={Button}+ variant="ghost"+ size="icon-sm"+ ><XIcon /></Dialog.CloseButton><Dialog.Title as="span" class="text-sm font-medium p-0 m-0">@@ -1338,8 +1358,8 @@ function TeamManagement(props: {</div></div></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog></div>);diff --git a/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx b/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsxindex 013def1199..c31e96910c 100644--- a/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx+++ b/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx@@ -1,7 +1,6 @@-import { DialogWrapper } from '@core/component/DialogWrapper';import clickOutside from '@core/directive/clickOutside';import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';-import { Dialog } from '@kobalte/core/dialog';+import { Dialog, Panel } from '@ui';import { createMemo, createSignal, For, Show } from 'solid-js';import { Dynamic } from 'solid-js/web';import { SplitPanelContext, type SplitPanelContextType } from '../context';@@ -126,22 +125,22 @@ function PopoverSplitModal(props: {props.onClose();}}}- modal={true}+ contentRef={(r) => {+ setPanelRef(r);+ bindHotKeyDom(r);+ }}>- <DialogWrapper- contentRef={(r) => {- setPanelRef(r);- bindHotKeyDom(r);- }}- >- <SplitPanelContext.Provider value={stubPanelContext}>- <SoupContextProvider>- <Show when={props.popover.mount}>- <Dynamic component={props.popover.mount.element} />- </Show>- </SoupContextProvider>- </SplitPanelContext.Provider>- </DialogWrapper>+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]">+ <SplitPanelContext.Provider value={stubPanelContext}>+ <SoupContextProvider>+ <Show when={props.popover.mount}>+ <Dynamic component={props.popover.mount.element} />+ </Show>+ </SoupContextProvider>+ </SplitPanelContext.Provider>+ </div>+ </Panel></Dialog>);}diff --git a/js/app/packages/block-automation/component/AutomationComposer.tsx b/js/app/packages/block-automation/component/AutomationComposer.tsxindex e8467f63f2..8f53634aa6 100644--- a/js/app/packages/block-automation/component/AutomationComposer.tsx+++ b/js/app/packages/block-automation/component/AutomationComposer.tsx@@ -1,11 +1,9 @@import { useSplitLayout } from '@app/component/split-layout/layout';-import { DialogWrapper } from '@core/component/DialogWrapper';import { toast } from '@core/component/Toast/Toast';import { createControlledOpenSignal } from '@core/util/createControlledOpenSignal';import { useCreateScheduleMutation } from '@queries/agent-schedule/schedules';-import { Dialog } from '@kobalte/core/dialog';import { debounce } from '@solid-primitives/scheduled';-import { Button } from '@ui/components/Button';+import { Dialog, Button, Panel } from '@ui';import { cn } from '@ui/utils/classname';import {createEffect,@@ -143,8 +141,8 @@ export function AutomationComposer() {open={automationComposerOpen()}onOpenChange={(open) => setAutomationComposerOpen(open, false)}>- <Dialog.Portal>- <DialogWrapper width="800px">+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex cursor-default flex-col text-ink"><div class="flex items-center justify-between border-b border-edge-muted px-3 py-2"><Dialog.Title class="m-0 p-0 text-sm font-semibold">@@ -320,8 +318,8 @@ export function AutomationComposer() {</Button></div></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog>);}diff --git a/js/app/packages/block-pdf/component/placeables/Signature.tsx b/js/app/packages/block-pdf/component/placeables/Signature.tsxindex 032fc44a82..477ebd59ff 100644--- a/js/app/packages/block-pdf/component/placeables/Signature.tsx+++ b/js/app/packages/block-pdf/component/placeables/Signature.tsx@@ -3,12 +3,21 @@ import {newPlaceableSignal,} from '@block-pdf/signal/placeables';import { DeprecatedIconButton } from '@core/component/DeprecatedIconButton';-import { Content, Modal, Overlay } from '@core/component/Modal';+import { blockElementSignal } from '@core/signal/blockElement';+import { cn } from '@ui/utils/classname';+import Dialog from '@corvu/dialog';import Check from '@icon/regular/check.svg';import Trash from '@icon/regular/trash-simple.svg';import { createCallback } from '@solid-primitives/rootless';import SignaturePad from 'signature_pad';-import { onCleanup, onMount, Show } from 'solid-js';+import {+ createMemo,+ createSignal,+ type JSX,+ onCleanup,+ onMount,+ Show,+} from 'solid-js';import { Portal } from 'solid-js/web';import { themeReactive } from '../../../theme/signals/themeReactive';import { useDeletePlaceable, useModifyPayload } from '../../store/placeables';@@ -61,11 +70,81 @@ function SignatureEditor(props: SignatureEditorProps) {deletePlaceable(props.id);});+ // Anchor the editor to the center of the active block rather than the+ // viewport, so the signature canvas appears over the PDF block it belongs to+ // (which may not be the only thing on screen).+ const [blockRect, setBlockRect] = createSignal<DOMRect | undefined>(+ undefined+ );++ onMount(() => {+ const el = blockElementSignal.get();+ if (!el) {+ setBlockRect(undefined);+ return;+ }+ setBlockRect(el.getBoundingClientRect());++ const observer = new ResizeObserver(() => {+ setBlockRect(el.getBoundingClientRect());+ });+ observer.observe(el);+ onCleanup(() => observer.disconnect());+ });++ const positionStyle = createMemo<JSX.CSSProperties>(() => {+ const rect = blockRect();+ if (rect) {+ const centerX = rect.left + rect.width / 2;+ const centerY = rect.top + rect.height / 2;+ return {+ position: 'absolute',+ top: `${centerY}px`,+ left: `${centerX}px`,+ transform: 'translate(-50%, -50%)',+ };+ }+ return {+ position: 'absolute',+ top: '50%',+ left: '50%',+ transform: 'translate(-50%, -50%)',+ };+ });+return (- <Modal open={true} restoreFocus={false}>+ <Dialog+ open={true}+ restoreFocus={false}+ // prevents the dialog from immediately being dismissed+ closeOnOutsidePointerStrategy="pointerdown"+ closeOnOutsideFocus={false}+ // this prevents the pointer events helper from getting stuck on dismissed+ // this is because we often prevent default onMouseDown+ noOutsidePointerEvents={false}+ ><Portal mount={document.getElementById('modal') ?? undefined}>- <Overlay />- <Content>+ <Dialog.Overlay+ class="flex sm:max-h-full items-center justify-content z-modal-overlay fixed inset-0 bg-modal-overlay"+ style={{+ 'max-height': `calc(100dvh - env(safe-area-inset-top, 0px))`,+ }}+ />+ <Dialog.Content+ class={cn(+ 'absolute z-modal min-w-[calc(100vw-2rem)]',+ '@sm:min-w-96 p-3',+ 'bg-dialog shadow',+ 'rounded-lg border border-edge',+ 'flex-col justify-start inline-flex gap-3',+ 'duration-slow',+ 'data-open:animate-in',+ 'data-open:fade-in-0 data-open:zoom-in-95',+ 'data-closed:animate-out',+ 'data-closed:fade-out-0 data-closed:zoom-out-95'+ )}+ style={positionStyle()}+ ><canvaswidth={400}height={100}@@ -91,9 +170,9 @@ function SignatureEditor(props: SignatureEditorProps) {}}/></div>- </Content>+ </Dialog.Content></Portal>- </Modal>+ </Dialog>);}diff --git a/js/app/packages/block-project/component/ProjectCreateMenu.tsx b/js/app/packages/block-project/component/ProjectCreateMenu.tsxindex 074e1e4a0a..5e0695b11e 100644--- a/js/app/packages/block-project/component/ProjectCreateMenu.tsx+++ b/js/app/packages/block-project/component/ProjectCreateMenu.tsx@@ -17,13 +17,12 @@ import {createMarkdownFile,createTask,} from '@core/util/create';-import { Dialog } from '@kobalte/core/dialog';import { DropdownMenu } from '@kobalte/core/dropdown-menu';import { Layer } from '@ui';import PlusIcon from '@icon/regular/plus.svg';import { createProject } from '@queries/storage/projects';import { type Component, createSignal, For } from 'solid-js';-import { DialogWrapper } from '@core/component/DialogWrapper';+import { Dialog, Panel } from '@ui';type MenuItemProps = {label: string;@@ -224,8 +223,8 @@ function ProjectCreateDialog(props: {return (<Dialog open={props.open} onOpenChange={(o) => !o && props.onClose()}>- <Dialog.Portal>- <DialogWrapper width="">+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="p-2"><Dialog.Title class="text-md font-semibold text-ink pb-3">Create in {props.name}@@ -251,8 +250,8 @@ function ProjectCreateDialog(props: {)}</For></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog>);}diff --git a/js/app/packages/core/component/AI/component/input/useAiDataConsent.tsx b/js/app/packages/core/component/AI/component/input/useAiDataConsent.tsxindex a4ddf1e7ac..71d5f9fc10 100644--- a/js/app/packages/core/component/AI/component/input/useAiDataConsent.tsx+++ b/js/app/packages/core/component/AI/component/input/useAiDataConsent.tsx@@ -1,10 +1,9 @@-import { Dialog } from '@kobalte/core/dialog';import { useAiDataConsent } from '@core/context/user';import { authServiceClient } from '@service-auth/client';import { invalidateUserInfo } from '@queries/auth/user-info';import { DeprecatedButton } from '@core/component/FormControls/DeprecatedButton';import { DeprecatedIconButton } from '@core/component/DeprecatedIconButton';-import { DialogWrapper } from '@core/component/DialogWrapper';+import { Dialog, Panel } from '@ui';import CloseIcon from '@icon/regular/x.svg';import { createSignal } from 'solid-js';@@ -36,9 +35,13 @@ export function useAiDataConsentGate() {function ConsentDialog() {return (- <Dialog open={open()} onOpenChange={(isOpen) => !isOpen && denyConsent()}>- <Dialog.Portal>- <DialogWrapper width="480px">+ <Dialog+ open={open()}+ onOpenChange={(isOpen) => !isOpen && denyConsent()}+ class="w-[480px]"+ >+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-row items-center justify-between px-2 h-[40px] gap-2 border-b border-b-edge-muted"><div class="flex flex-row items-center gap-2"><Dialog.CloseButton>@@ -68,8 +71,8 @@ export function useAiDataConsentGate() {</DeprecatedButton></div></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog>);}diff --git a/js/app/packages/core/component/DialogWrapper.tsx b/js/app/packages/core/component/DialogWrapper.tsxdeleted file mode 100644index 5a04507837..0000000000--- a/js/app/packages/core/component/DialogWrapper.tsx+++ /dev/null@@ -1,54 +0,0 @@-import { Dialog } from '@kobalte/core';-import { cn } from '@ui/utils/classname';-import type { JSXElement, Ref } from 'solid-js';-import { Panel } from '@ui';--export interface DialogWrapperProps {- children: JSXElement;- class?: string;- width?: string;- overlayRef?: Ref<HTMLDivElement>;- contentRef?: Ref<HTMLDivElement>;- onOpenAutoFocus?: (event: Event) => void;- onCloseAutoFocus?: (event: Event) => void;-}--/**- * Your one-stop-shop for creating Macro-themed Dialogs. Handles both the Overlay and the frame around the Dialog Content.- *- * Correct usage is to put this immediately below the <Dialog.Portal>. No other Dialog machinery necesary. Just this and then the content.- *- * Note: DialogWrapper constrains its height by applying a max-height to its immediate children. This allows the child content to be properly constrained (e.g. for flex-box layouts) without the children needing to know that they are inside a dialog. For this to work as expected, child content should start with a single container element.- */-export function DialogWrapper(props: DialogWrapperProps) {- const width = props.width ?? '800px';-- return (- <>- <Dialog.Overlay- class="z-modal fixed inset-0 bg-modal-overlay pattern-edge-muted pattern-diagonal-4"- ref={props.overlayRef}- />- <div class="z-modal fixed inset-0">- <Dialog.Content- class={cn(- 'max-w-[calc(100vw-16px)] mt-40 mx-auto overflow-hidden portal-scope'- )}- style={{ width: width }}- onOpenAutoFocus={props.onOpenAutoFocus}- onCloseAutoFocus={props.onCloseAutoFocus}- >- <Panel depth={2} active>- <div- class={cn('*:max-h-[75vh]', props.class)}- ref={props.contentRef}- >- {props.children}- </div>- </Panel>- </Dialog.Content>- </div>- </>- // Overlay with Diagonal pattern- );-}diff --git a/js/app/packages/core/component/Modal.tsx b/js/app/packages/core/component/Modal.tsxdeleted file mode 100644index 322c5e4fad..0000000000--- a/js/app/packages/core/component/Modal.tsx+++ /dev/null@@ -1,153 +0,0 @@-import { blockElementSignal } from '@core/signal/blockElement';-import { cn } from '@ui/utils/classname';-import Dialog from '@corvu/dialog';-import {- type ComponentProps,- createMemo,- createSignal,- type JSX,- onCleanup,- onMount,-} from 'solid-js';--// See Corvu documentation for usage:-// https://corvu.dev/docs/primitives/dialog/-// https://corvu.dev/docs/state/--export function Modal(props: ComponentProps<typeof Dialog>) {- return (- <Dialog- // prevents the dialog from immediately being dismissed- closeOnOutsidePointerStrategy="pointerdown"- closeOnOutsideFocus={false}- // this prevents the pointer events helper from getting stuck on dismissed- // this is because we often prevent default onMouseDown- noOutsidePointerEvents={false}- contextId={props.contextId}- {...props}- />- );-}--export function Overlay(props: ComponentProps<typeof Dialog.Overlay<'div'>>) {- return (- <Dialog.Overlay- {...props}- class={cn(- 'flex sm:max-h-full items-center justify-content z-modal-overlay fixed inset-0 bg-modal-overlay',- props.class- )}- style={{- 'max-height': `calc(100dvh - env(safe-area-inset-top, 0px))`,- }}- >- {props.children}- </Dialog.Overlay>- );-}--export function Content(props: ComponentProps<typeof Dialog.Content<'div'>>) {- const [rect, setRect] = createSignal<DOMRect | undefined>(undefined);-- onMount(() => {- const el = blockElementSignal();- if (!el) {- setRect(undefined);- return;- }- setRect(el.getBoundingClientRect());-- const observer = new ResizeObserver(() => {- setRect(el.getBoundingClientRect());- });- observer.observe(el);- onCleanup(() => {- observer.disconnect();- });- });-- const positionStyle = createMemo(() => {- const currentRect = rect();- if (currentRect) {- const centerX = currentRect.left + currentRect.width / 2;- const centerY = currentRect.top + currentRect.height / 2;-- return {- position: 'absolute',- top: `${centerY}px`,- left: `${centerX}px`,- transform: 'translate(-50%, -50%)',- };- }- return {- position: 'absolute',- top: '50%',- left: '50%',- transform: 'translate(-50%, -50%)',- };- });-- return (- <Dialog.Content- {...props}- class={cn(- 'absolute z-modal min-w-[calc(100vw-2rem)]',- '@sm:min-w-96 p-3',- 'bg-dialog shadow',- 'rounded-lg border border-edge',- 'flex-col justify-start inline-flex gap-3',- 'duration-slow',- 'data-open:animate-in',- 'data-open:fade-in-0 data-open:zoom-in-95',- 'data-closed:animate-out',- 'data-closed:fade-out-0 data-closed:zoom-out-95',- props.class- )}- style={positionStyle() as JSX.CSSProperties}- >- {props.children}- </Dialog.Content>- );-}--export function Header(props: ComponentProps<typeof Dialog.Label<'h2'>>) {- return (- <Dialog.Label- {...props}- class={cn(- 'text-ink text-lg font-semibold font-sans leading-7',- props.class- )}- >- {props.children}- </Dialog.Label>- );-}--export function Message(props: ComponentProps<typeof Dialog.Description<'p'>>) {- return (- <Dialog.Description- {...props}- class={cn(- 'text-ink-muted text-sm font-normal font-sans leading-tight',- props.class- )}- >- {props.children}- </Dialog.Description>- );-}--export function ButtonBar(props: ComponentProps<'div'>) {- return (- <div- {...props}- class={cn(- 'pt-3 justify-start items-start self-end gap-3 inline-flex',- props.class- )}- >- {props.children}- </div>- );-}diff --git a/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx b/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsxindex f43875def6..8db4040794 100644--- a/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx+++ b/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx@@ -1,10 +1,9 @@import { useBlockId } from '@core/block';import { Button } from '@ui/components/Button';import { SegmentedControl } from '@ui/components/SegmentedControl';-import { DialogWrapper } from '@core/component/DialogWrapper';+import { Dialog, Panel } from '@ui';import LoadingSpinner from '@icon/regular/spinner.svg';import XIcon from '@icon/regular/x.svg';-import { Dialog } from '@kobalte/core/dialog';import { useAddEntityPropertyMutation } from '@queries/properties/entity';import { useCreatePropertyDefinitionMutation } from '@queries/properties/definitions';import { useUserId } from '@core/context/user';@@ -25,7 +24,6 @@ import {} from '../../utils';import { ERROR_MESSAGES } from '../../utils/errorHandling';import { Dropdown, type DropdownOption } from './shared/Dropdown';-import { Panel } from '@ui';// Derive DataTypeValue from the dropdown optionstype DataTypeValue = ReturnType<@@ -413,206 +411,193 @@ export const CreatePropertyModal: Component<CreatePropertyModalProps> = (onOpenChange={(open) => {if (!open) props.onClose();}}- modal={true}>- <Dialog.Portal>- <DialogWrapper>- <Panel depth={2} class="flex flex-col text-sm">- <div class="flex items-center justify-between gap-2 bg-panel px-2 h-10 border-b border-edge-muted shrink-0">- <Dialog.Title class="pl-2 text-sm font-medium">- Create New Property- </Dialog.Title>- <Button- variant="ghost"- size="icon-sm"- onClick={() => props.onClose()}- >- <XIcon />- </Button>- </div>-- <div class="min-h-0 overflow-y-auto scrollbar-hidden p-4">- <div class="space-y-3">- <Show when={error()}>- <div class="text-failure-ink text-sm p-2 bg-failure-bg">- {error()}- </div>- </Show>+ <Panel depth={2} class="*:max-h-[75vh]">+ <div class="flex flex-col text-sm">+ <div class="flex items-center justify-between gap-2 bg-panel px-2 h-10 border-b border-edge-muted shrink-0">+ <Dialog.Title class="pl-2 text-sm font-medium">+ Create New Property+ </Dialog.Title>+ <Button+ variant="ghost"+ size="icon-sm"+ onClick={() => props.onClose()}+ >+ <XIcon />+ </Button>+ </div>- <div>- <label- for="property-name"- class="block text-xs font-medium text-ink mb-1"- >- Property Name- </label>- <input- id="property-name"- ref={propertyNameInputRef}- type="text"- value={newPropertyName()}- onInput={(e) => setNewPropertyName(e.currentTarget.value)}- placeholder="Enter property name"- class="w-full p-1.5 border border-edge-muted text-sm rounded-sm bg-input placeholder:text-ink-placeholder"- />+ <div class="min-h-0 overflow-y-auto scrollbar-hidden p-4">+ <div class="space-y-3">+ <Show when={error()}>+ <div class="text-failure-ink text-sm p-2 bg-failure-bg">+ {error()}</div>+ </Show>+ <div>+ <label+ for="property-name"+ class="block text-xs font-medium text-ink mb-1"+ >+ Property Name+ </label>+ <input+ id="property-name"+ ref={propertyNameInputRef}+ type="text"+ value={newPropertyName()}+ onInput={(e) => setNewPropertyName(e.currentTarget.value)}+ placeholder="Enter property name"+ class="w-full p-1.5 border border-edge-muted text-sm rounded-sm bg-input placeholder:text-ink-placeholder"+ />+ </div>++ <div>+ <label class="block text-xs font-medium text-ink mb-1">+ Data Type+ </label>+ <Dropdown+ value={selectedDataType()}+ options={dataTypeDropdownOptions}+ onChange={(value) => {+ setSelectedDataType(value);+ setNewStringOptions([]);+ setNewNumberOptions([]);+ setIsMultiSelect(false);+ }}+ placeholder="Select type"+ />+ </div>++ <Show when={shouldShowMultiSelect()}><div><label class="block text-xs font-medium text-ink mb-1">- Data Type+ Selection Type</label>- <Dropdown- value={selectedDataType()}- options={dataTypeDropdownOptions}- onChange={(value) => {- setSelectedDataType(value);- setNewStringOptions([]);- setNewNumberOptions([]);- setIsMultiSelect(false);- }}- placeholder="Select type"+ <SegmentedControl+ value={isMultiSelect() ? 'multi' : 'single'}+ onChange={(v) => setIsMultiSelect(v === 'multi')}+ options={[+ { value: 'single', label: 'Single Select' },+ { value: 'multi', label: 'Multi Select' },+ ]}/></div>+ </Show>- <Show when={shouldShowMultiSelect()}>- <div>- <label class="block text-xs font-medium text-ink mb-1">- Selection Type+ <Show when={shouldShowOptions()}>+ <div>+ <div class="flex items-center justify-between mb-2">+ <label class="block text-xs font-medium text-ink">+ Options</label>- <SegmentedControl- value={isMultiSelect() ? 'multi' : 'single'}- onChange={(v) => setIsMultiSelect(v === 'multi')}- options={[- { value: 'single', label: 'Single Select' },- { value: 'multi', label: 'Multi Select' },- ]}- />- </div>- </Show>-- <Show when={shouldShowOptions()}>- <div>- <div class="flex items-center justify-between mb-2">- <label class="block text-xs font-medium text-ink">- Options- </label>- <Button- variant="secondary"- size="sm"- class="rounded-xs"- onClick={() => {- const { type } = parseDataTypeValue(- selectedDataType()- );- if (type === 'select_string') {- addOption(- newStringOptions,- setNewStringOptions,- ''- );- } else {- addOption(newNumberOptions, setNewNumberOptions, 0);- }- }}- >- + Add Option- </Button>- </div>- <Show- when={selectedDataType() === 'select_string'}- fallback={- <OptionInput- options={newNumberOptions}- type="number"- onAdd={() =>- addOption(newNumberOptions, setNewNumberOptions, 0)- }- onRemove={(id) =>- removeOption(- newNumberOptions,- setNewNumberOptions,- id- )- }- onUpdate={(id, value) =>- updateOption(- newNumberOptions,- setNewNumberOptions,- id,- value as number- )- }- placeholder="Enter number"- />- }+ <Button+ variant="secondary"+ size="sm"+ class="rounded-xs"+ onClick={() => {+ const { type } = parseDataTypeValue(selectedDataType());+ if (type === 'select_string') {+ addOption(newStringOptions, setNewStringOptions, '');+ } else {+ addOption(newNumberOptions, setNewNumberOptions, 0);+ }+ }}>+ + Add Option+ </Button>+ </div>+ <Show+ when={selectedDataType() === 'select_string'}+ fallback={<OptionInput- options={newStringOptions}- type="string"+ options={newNumberOptions}+ type="number"onAdd={() =>- addOption(newStringOptions, setNewStringOptions, '')+ addOption(newNumberOptions, setNewNumberOptions, 0)}onRemove={(id) =>removeOption(- newStringOptions,- setNewStringOptions,+ newNumberOptions,+ setNewNumberOptions,id)}onUpdate={(id, value) =>updateOption(- newStringOptions,- setNewStringOptions,+ newNumberOptions,+ setNewNumberOptions,id,- value as string+ value as number)}- placeholder="Enter option value"+ placeholder="Enter number"/>- </Show>- </div>- </Show>- </div>+ }+ >+ <OptionInput+ options={newStringOptions}+ type="string"+ onAdd={() =>+ addOption(newStringOptions, setNewStringOptions, '')+ }+ onRemove={(id) =>+ removeOption(newStringOptions, setNewStringOptions, id)+ }+ onUpdate={(id, value) =>+ updateOption(+ newStringOptions,+ setNewStringOptions,+ id,+ value as string+ )+ }+ placeholder="Enter option value"+ />+ </Show>+ </div>+ </Show></div>+ </div>- <div class="flex items-center justify-end gap-2 px-2 py-1.5 border-t border-edge-muted shrink-0">- <Button- variant="ghost"- class="rounded-xs"- onClick={() => {- resetCreateForm();- props.onClose();- }}- disabled={createPropertyMutation.isPending}- >- Cancel- </Button>- <Button- variant="secondary"- class="rounded-xs"- onClick={handleCreateProperty}- disabled={- !newPropertyName().trim() || createPropertyMutation.isPending+ <div class="flex items-center justify-end gap-2 px-2 py-1.5 border-t border-edge-muted shrink-0">+ <Button+ variant="ghost"+ class="rounded-xs"+ onClick={() => {+ resetCreateForm();+ props.onClose();+ }}+ disabled={createPropertyMutation.isPending}+ >+ Cancel+ </Button>+ <Button+ variant="secondary"+ class="rounded-xs"+ onClick={handleCreateProperty}+ disabled={+ !newPropertyName().trim() || createPropertyMutation.isPending+ }+ >+ <Show+ when={!createPropertyMutation.isPending}+ fallback={+ <div class="flex items-center gap-1.5">+ <div class="w-3 h-3 animate-spin">+ <LoadingSpinner />+ </div>+ Creating...+ </div>}>- <Show- when={!createPropertyMutation.isPending}- fallback={- <div class="flex items-center gap-1.5">- <div class="w-3 h-3 animate-spin">- <LoadingSpinner />- </div>- Creating...- </div>- }- >- Create Property- </Show>- </Button>- </div>- </Panel>- </DialogWrapper>- </Dialog.Portal>+ Create Property+ </Show>+ </Button>+ </div>+ </div>+ </Panel></Dialog>);};diff --git a/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx b/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsxindex 1048422197..9d9cd0fb58 100644--- a/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx+++ b/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx@@ -1,9 +1,7 @@import { useBlockId } from '@core/block';-import { DialogWrapper } from '@core/component/DialogWrapper';import { useListKeyBindings } from '@core/util/useListKeyBindings';import LoadingSpinner from '@icon/regular/spinner.svg';import PlusIcon from '@icon/regular/plus.svg';-import { Dialog } from '@kobalte/core/dialog';import { useAddEntityPropertyMutation } from '@queries/properties/entity';import { useListPropertiesQuery } from '@queries/properties/definitions';import { cn } from '@ui/utils/classname';@@ -27,7 +25,7 @@ import {toPropertyDefinitionDomain,useSearchInputFocus,} from '../../utils';-import { Panel } from '@ui';+import { Dialog, Panel } from '@ui';export function SelectPropertyModal(props: PropertySelectorProps) {const blockId = useBlockId();@@ -157,91 +155,85 @@ export function SelectPropertyModal(props: PropertySelectorProps) {onOpenChange={(open) => {if (!open) props.onClose();}}- modal={true}+ contentRef={setDialogRef}>- <Dialog.Portal>- <DialogWrapper contentRef={setDialogRef}>- <Panel depth={2} class="flex flex-col text-sm">- <div class="flex items-center gap-2 bg-panel px-2 h-10 border-b border-edge-muted shrink-0">- <span class="pl-2 pointer-events-none text-ink-extra-muted">- ❯- </span>- <input- ref={searchInputRef}- type="text"- value={searchQuery()}- onInput={(e) => setSearchQuery(e.currentTarget.value)}- placeholder="Add a property..."- class="flex-1 text-base border-0 outline-none! focus:outline-none ring-0! focus:ring-0 bg-transparent"- autofocus- />- </div>-- <div class="min-h-0 overflow-y-auto scrollbar-hidden">- <Show- when={!listPropertiesQuery.isLoading}- fallback={- <div class="flex items-center justify-center py-8">- <div class="w-5 h-5 animate-spin">- <LoadingSpinner />- </div>- <span class="ml-2 text-ink-muted">- Loading properties...- </span>+ <Panel depth={2} class="*:max-h-[75vh]">+ <div class="flex flex-col text-sm">+ <div class="flex items-center gap-2 bg-panel px-2 h-10 border-b border-edge-muted shrink-0">+ <span class="pl-2 pointer-events-none text-ink-extra-muted">❯</span>+ <input+ ref={searchInputRef}+ type="text"+ value={searchQuery()}+ onInput={(e) => setSearchQuery(e.currentTarget.value)}+ placeholder="Add a property..."+ class="flex-1 text-base border-0 outline-none! focus:outline-none ring-0! focus:ring-0 bg-transparent"+ autofocus+ />+ </div>++ <div class="min-h-0 overflow-y-auto scrollbar-hidden">+ <Show+ when={!listPropertiesQuery.isLoading}+ fallback={+ <div class="flex items-center justify-center py-8">+ <div class="w-5 h-5 animate-spin">+ <LoadingSpinner /></div>- }- >- <div class="p-1">- <For each={filteredProperties()}>- {(property, index) => (- <button- type="button"- id={`select-property-option-${index()}`}- class={cn(- 'flex flex-row w-full items-center gap-2 py-1.5 px-2 scroll-my-1',- isFocused(index()) && 'bg-active'- )}- onClick={() => addProperty(property.id)}- onMouseEnter={() => setFocusedIndex(index())}- >- <PropertyDataTypeIcon- property={property}- class="opacity-50 shrink-0"- />- <p class="text-sm font-medium truncate text-left grow">- {property.displayName}- </p>- <p class="text-sm text-ink-extra-muted/50 shrink-0">- {getPropertyDefinitionTypeDisplay({- dataType: property.valueType,- specificEntityType: property.specificEntityType,- isMultiSelect: property.isMultiSelect,- })}- </p>- </button>- )}- </For>- <button- type="button"- id={`select-property-option-${createIndex()}`}- class={cn(- 'flex flex-row w-full items-center gap-2 py-1.5 px-2 scroll-my-1',- isFocused(createIndex()) && 'bg-hover'- )}- onClick={handleCreate}- onMouseEnter={() => setFocusedIndex(createIndex())}- >- <PlusIcon class="size-4 shrink-0" />- <p class="text-sm font-medium truncate flex-1 text-left">- {createLabel()}- </p>- </button>+ <span class="ml-2 text-ink-muted">Loading properties...</span></div>- </Show>- </div>- </Panel>- </DialogWrapper>- </Dialog.Portal>+ }+ >+ <div class="p-1">+ <For each={filteredProperties()}>+ {(property, index) => (+ <button+ type="button"+ id={`select-property-option-${index()}`}+ class={cn(+ 'flex flex-row w-full items-center gap-2 py-1.5 px-2 scroll-my-1',+ isFocused(index()) && 'bg-active'+ )}+ onClick={() => addProperty(property.id)}+ onMouseEnter={() => setFocusedIndex(index())}+ >+ <PropertyDataTypeIcon+ property={property}+ class="opacity-50 shrink-0"+ />+ <p class="text-sm font-medium truncate text-left grow">+ {property.displayName}+ </p>+ <p class="text-sm text-ink-extra-muted/50 shrink-0">+ {getPropertyDefinitionTypeDisplay({+ dataType: property.valueType,+ specificEntityType: property.specificEntityType,+ isMultiSelect: property.isMultiSelect,+ })}+ </p>+ </button>+ )}+ </For>+ <button+ type="button"+ id={`select-property-option-${createIndex()}`}+ class={cn(+ 'flex flex-row w-full items-center gap-2 py-1.5 px-2 scroll-my-1',+ isFocused(createIndex()) && 'bg-hover'+ )}+ onClick={handleCreate}+ onMouseEnter={() => setFocusedIndex(createIndex())}+ >+ <PlusIcon class="size-4 shrink-0" />+ <p class="text-sm font-medium truncate flex-1 text-left">+ {createLabel()}+ </p>+ </button>+ </div>+ </Show>+ </div>+ </div>+ </Panel></Dialog>);}diff --git a/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx b/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsxindex d18a2cc0f9..7068e77ca9 100644--- a/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx+++ b/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx@@ -1,12 +1,10 @@import { useMaybeBlockAliasedName, useMaybeBlockId } from '@core/block';import { cn } from '@ui/utils/classname';-import { Button } from '@ui/components/Button';-import { DialogWrapper } from '@core/component/DialogWrapper';+import { Dialog, Button, Panel } from '@ui';import DeleteIcon from '@icon/bold/x-bold.svg';import PinIcon from '@icon/regular/push-pin.svg';import UnpinIcon from '@icon/regular/push-pin-slash.svg';import XIcon from '@icon/regular/x.svg';-import { Dialog } from '@kobalte/core/dialog';import { useDeleteEntityPropertyMutation } from '@queries/properties/entity';import { type Component, createMemo, createSignal, Show } from 'solid-js';import {@@ -157,8 +155,8 @@ export const PropertyLabel: Component<PropertyLabelProps> = (props) => {open={deleteConfirmVisible()}onOpenChange={setDeleteConfirmVisible}>- <Dialog.Portal>- <DialogWrapper>+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-col overflow-hidden text-sm"><div class="flex items-center justify-between gap-2 bg-panel px-2 h-10 border-b border-edge-muted shrink-0"><Dialog.Title class="pl-2 text-sm font-medium">@@ -197,8 +195,8 @@ export const PropertyLabel: Component<PropertyLabelProps> = (props) => {</Button></div></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog></>);diff --git a/js/app/packages/core/mobile/IosPushNotificationModal.tsx b/js/app/packages/core/mobile/IosPushNotificationModal.tsxindex 6ebcd12604..5c25f757e2 100644--- a/js/app/packages/core/mobile/IosPushNotificationModal.tsx+++ b/js/app/packages/core/mobile/IosPushNotificationModal.tsx@@ -1,9 +1,7 @@-import { DialogWrapper } from '@core/component/DialogWrapper';import { isPlatform } from '@core/util/platform';-import { Dialog } from '@kobalte/core/dialog';import { useNotificationSettings } from '@notifications/notification-settings';import { useIsAuthenticated } from '@queries/auth';-import { Button } from '@ui/components/Button';+import { Dialog, Button, Panel } from '@ui';import { createMemo, Show } from 'solid-js';const DEBUG_FORCE_OPEN = false;@@ -23,13 +21,14 @@ export function IosPushNotificationModal() {return (<Show when={shouldShow()}><Dialog- open={true}+ openonOpenChange={(open) => {if (!open) settings.dismissPrompt();}}+ class="w-[90%]">- <Dialog.Portal>- <DialogWrapper width="90%">+ <Panel depth={2} active>+ <div class="*:max-h-[75vh]"><div class="flex flex-col gap-4 px-4 py-6"><Dialog.Title class="text-lg font-semibold text-ink">Enable Push Notifications@@ -57,8 +56,8 @@ export function IosPushNotificationModal() {</Button></div></div>- </DialogWrapper>- </Dialog.Portal>+ </div>+ </Panel></Dialog></Show>);diff --git a/js/app/packages/ui/components/Dialog.tsx b/js/app/packages/ui/components/Dialog.tsxnew file mode 100644index 0000000000..6b19d4d209--- /dev/null+++ b/js/app/packages/ui/components/Dialog.tsx@@ -0,0 +1,44 @@+import { Dialog as KobalteDialog } from '@kobalte/core/dialog';+import type { JSX, Ref } from 'solid-js';+import { cn } from '../utils/classname';++export type DialogProps = {+ onEscapeKeyDown?: (event: KeyboardEvent) => void; /* Forwarded to Kobalte */+ onCloseAutoFocus?: (event: Event) => void; /* Forwarded to Kobalte */+ onOpenAutoFocus?: (event: Event) => void; /* Forwarded to Kobalte */+ onOpenChange?: (open: boolean) => void; /* Forwarded to Kobalte */+ contentRef?: Ref<HTMLDivElement>; /* content element ref */+ position?: 'top' | 'center'; /* Vertical position */+ children: JSX.Element; /* Content children */+ class?: string; /* classes for content */+ open: boolean; /* if dialog is open */+};++export function Dialog(props: DialogProps) {+ return (+ <KobalteDialog+ onOpenChange={props.onOpenChange}+ open={props.open}+ modal+ >+ <KobalteDialog.Portal>+ <KobalteDialog.Overlay class="fixed inset-0 z-modal bg-modal-overlay pattern-edge-muted pattern-diagonal-4" />+ <div class={cn('fixed inset-0 z-modal flex justify-center px-2', props.position === 'center' ? 'items-center' : 'items-start pt-[10vh]')}>+ <KobalteDialog.Content+ ref={props.contentRef}+ class={cn('w-200 max-w-[calc(100vw-16px)] overflow-hidden portal-scope', props.class)}+ onCloseAutoFocus={props.onCloseAutoFocus}+ onEscapeKeyDown={props.onEscapeKeyDown}+ onOpenAutoFocus={props.onOpenAutoFocus}+ >+ {props.children}+ </KobalteDialog.Content>+ </div>+ </KobalteDialog.Portal>+ </KobalteDialog>+ );+}++Dialog.CloseButton = KobalteDialog.CloseButton; /* Forwarded to Kobalte */+Dialog.Description = KobalteDialog.Description; /* Forwarded to Kobalte */+Dialog.Title = KobalteDialog.Title; /* Forwarded to Kobalte */diff --git a/js/app/packages/ui/index.ts b/js/app/packages/ui/index.tsindex 78c3234ada..b4dc926fad 100644--- a/js/app/packages/ui/index.ts+++ b/js/app/packages/ui/index.ts@@ -5,6 +5,7 @@ export { Keyboard } from './components/Keyboard';export { Button } from './components/Button';export { Layer } from './components/Layer';export { Panel } from './components/Panel';+export { Dialog, type DialogProps } from './components/Dialog';/* utils */export { cn } from './utils/classname';diff --git a/js/app/tsconfig.json b/js/app/tsconfig.jsonindex 9ff41c5a05..bdcb032729 100644--- a/js/app/tsconfig.json+++ b/js/app/tsconfig.json@@ -30,8 +30,8 @@"webworker","DOM.Iterable"],- "jsx": "react-jsx",- "jsxImportSource": "react",+ "jsx": "preserve",+ "jsxImportSource": "solid-js","declaration": true,"declarationMap": true,"forceConsistentCasingInFileNames": true,