Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(ui): more color and account fixes (#2992)

Fake-User44a0102fd209
diff --git a/js/app/packages/app/component/settings/Account.tsx b/js/app/packages/app/component/settings/Account.tsx
index 06bd611642..23e7fdad9b 100644
--- a/js/app/packages/app/component/settings/Account.tsx
+++ b/js/app/packages/app/component/settings/Account.tsx
@@ -1,14 +1,13 @@
import { uploadProfilePicture } from '@core/component/ProfilePicture';
import EditableField from '@core/component/EditableField';
import { capitalize } from '@block-pdf/util/StringUtils';
-import { DeprecatedTextButton } from '@core/component/DeprecatedTextButton';
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/components/Button';
+import { Button } from '@ui';
import { Panel } from '@ui';
import {
blockNameToFileExtensions,
@@ -26,6 +25,7 @@ import {
useProfilePictureUrl,
} from '@core/signal/profilePicture';
import IconUpload from '@macro-icons/macro-upload.svg';
+import SignOutIcon from '@phosphor-icons/core/regular/sign-out.svg?component-solid';
import { authServiceClient } from '@service-auth/client';
import { useEmail, useLicenseStatus, useUserId } from '@core/context/user';
import { createMemo, createResource, createSignal, Show } from 'solid-js';
@@ -181,7 +181,10 @@ export function Account() {
},
}}
>
- <DeprecatedTextButton text="Upload" icon={IconUpload} theme="accent" />
+ <Button variant="secondary" size="sm" depth={3}>
+ <IconUpload class="size-4" />
+ Upload
+ </Button>
</div>
<UserIcon
id={userId() as string}
@@ -232,11 +235,14 @@ export function Account() {
{capitalize(licenseStatus() ?? '')}
</span>
<Show when={!hasPaidAccess()}>
- <DeprecatedTextButton
- theme="accent"
- text="Upgrade"
+ <Button
+ variant="accent"
+ size="sm"
+ depth={3}
onClick={() => showPaywall()}
- />
+ >
+ Upgrade
+ </Button>
</Show>
</div>
</Row>
@@ -248,19 +254,25 @@ export function Account() {
<Show
when={!emailActive()}
fallback={
- <DeprecatedTextButton
- theme="base"
- text="Disable"
+ <Button
+ variant="secondary"
+ size="sm"
+ depth={3}
onClick={() => setShowEmailModal(true)}
- />
+ >
+ Disable
+ </Button>
}
>
<Show when={!showEnableEmailModal()}>
- <DeprecatedTextButton
- theme="base"
- text="Enable"
+ <Button
+ variant="secondary"
+ size="sm"
+ depth={3}
onClick={() => setShowEnableEmailModal(true)}
- />
+ >
+ Enable
+ </Button>
</Show>
</Show>
</Row>
@@ -276,18 +288,24 @@ export function Account() {
<Show
when={!githubLinkExists()}
fallback={
- <DeprecatedTextButton
- theme="base"
- text="Disable"
+ <Button
+ variant="secondary"
+ size="sm"
+ depth={3}
onClick={handleGithubDisable}
- />
+ >
+ Disable
+ </Button>
}
>
- <DeprecatedTextButton
- theme="base"
- text="Enable"
+ <Button
+ variant="secondary"
+ size="sm"
+ depth={3}
onClick={handleGithubEnable}
- />
+ >
+ Enable
+ </Button>
</Show>
</Show>
</Row>
@@ -297,11 +315,15 @@ export function Account() {
</div>
<div class="flex items-center justify-end h-10 px-6">
- <DeprecatedTextButton
- text="Logout"
- theme="base"
+ <Button
+ variant="secondary"
+ size="sm"
+ depth={3}
onClick={logoutHandler}
- />
+ >
+ <SignOutIcon class="size-4" />
+ Logout
+ </Button>
</div>
<Show when={showEnableEmailModal()}>
@@ -310,19 +332,25 @@ export function Account() {
Email requires additional Google permissions. Select the permissions on sign-in to enable.
</div>
<div class="ml-auto flex flex-row">
- <DeprecatedTextButton
- theme="clear"
- text="Logout"
+ <Button
+ variant="ghost"
+ size="sm"
+ depth={3}
onClick={() => {
setShowEnableEmailModal(false);
logout();
}}
- />
- <DeprecatedTextButton
- theme="clear"
- text="Cancel"
+ >
+ Logout
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ depth={3}
onClick={() => setShowEnableEmailModal(false)}
- />
+ >
+ Cancel
+ </Button>
</div>
</div>
</Show>
@@ -333,9 +361,10 @@ export function Account() {
Disabling will clear all email data from Macro
</div>
<div class="ml-auto flex flex-row">
- <DeprecatedTextButton
- theme="clear"
- text="Confirm"
+ <Button
+ variant="ghost"
+ size="sm"
+ depth={3}
onClick={async () => {
setShowEmailModal(false);
await disconnectEmail().match(
@@ -347,19 +376,24 @@ export function Account() {
},
);
}}
- />
- <DeprecatedTextButton
- theme="clear"
- text="Cancel"
+ >
+ Confirm
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ depth={3}
onClick={() => setShowEmailModal(false)}
- />
+ >
+ Cancel
+ </Button>
</div>
</div>
</Show>
<Show when={isNativeMobilePlatform()}>
<div class="border-t border-edge pt-4">
- <Button variant="destructive" onClick={() => setShowDeleteModal(true)}>
+ <Button variant="destructive" depth={3} onClick={() => setShowDeleteModal(true)}>
Delete Account
</Button>
<Modal open={showDeleteModal()} onOpenChange={setShowDeleteModal}>
@@ -371,10 +405,10 @@ export function Account() {
permanent and cannot be undone.
</Message>
<ButtonBar>
- <Button variant="secondary" onClick={() => setShowDeleteModal(false)}>
+ <Button variant="secondary" depth={3} onClick={() => setShowDeleteModal(false)}>
Cancel
</Button>
- <Button variant="destructive" onClick={() => {
+ <Button variant="destructive" depth={3} onClick={() => {
setShowDeleteModal(false);
setShowDeleteConfirmModal(true);
}}>
@@ -392,10 +426,10 @@ export function Account() {
data. This cannot be undone.
</Message>
<ButtonBar>
- <Button variant="secondary" onClick={() => setShowDeleteConfirmModal(false)}>
+ <Button variant="secondary" depth={3} onClick={() => setShowDeleteConfirmModal(false)}>
Cancel
</Button>
- <Button variant="destructive" onClick={deleteAccountHandler}>
+ <Button variant="destructive" depth={3} onClick={deleteAccountHandler}>
Delete My Account
</Button>
</ButtonBar>
@@ -445,11 +479,14 @@ function NotificationSettings(props: {
return (
<Row label="Notifications">
- <DeprecatedTextButton
- theme="base"
- text={props.settings.isEnabled() ? "Disable" : "Enable"}
+ <Button
+ variant="secondary"
+ size="sm"
+ depth={3}
onClick={handleToggle}
- />
+ >
+ {props.settings.isEnabled() ? "Disable" : "Enable"}
+ </Button>
</Row>
);
}
@@ -497,7 +534,7 @@ function BundleUpdateRow() {
</span>
<Show when={action()}>
{(a) => (
- <Button variant="accent" size="sm" onClick={a().action}>
+ <Button variant="accent" size="sm" depth={3} onClick={a().action}>
{a().label}
</Button>
)}
diff --git a/js/app/packages/theme/constants.ts b/js/app/packages/theme/constants.ts
index eca72d9a21..a3da6a5d3e 100644
--- a/js/app/packages/theme/constants.ts
+++ b/js/app/packages/theme/constants.ts
@@ -61,11 +61,11 @@ export const DEFAULT_THEMES = [
a2: { l: 0.65, c: 0.20, h: 139 },
a3: { l: 0.65, c: 0.20, h: 179 },
a4: { l: 0.65, c: 0.20, h: 219 },
- b0: { l: 0.84, c: 0.00, h: 59 },
- b1: { l: 0.83, c: 0.00, h: 59 },
- b2: { l: 0.81, c: 0.00, h: 59 },
- b3: { l: 0.76, c: 0.00, h: 59 },
- b4: { l: 0.74, c: 0.00, h: 59 },
+ b0: { l: 0.95, c: 0.00, h: 59 },
+ b1: { l: 0.94, c: 0.00, h: 59 },
+ b2: { l: 0.92, c: 0.00, h: 59 },
+ b3: { l: 0.87, c: 0.00, h: 59 },
+ b4: { l: 0.86, c: 0.00, h: 59 },
c0: { l: 0.04, c: 0.00, h: 59 },
c1: { l: 0.07, c: 0.00, h: 59 },
c2: { l: 0.10, c: 0.00, h: 59 },
@@ -178,7 +178,7 @@ export const DEFAULT_THEMES = [
a3: { l: 0.82, c: 0.28, h: 379 },
a4: { l: 0.82, c: 0.28, h: 419 },
b0: { l: 0.22, c: 0.02, h: 259 },
- b1: { l: 0.68, c: 0.02, h: 259 },
+ b1: { l: 0.28, c: 0.02, h: 259 },
b2: { l: 0.31, c: 0.02, h: 259 },
b3: { l: 0.33, c: 0.02, h: 259 },
b4: { l: 0.36, c: 0.02, h: 259 },
@@ -201,7 +201,7 @@ export const DEFAULT_THEMES = [
a3: { l: 0.60, c: 0.32, h: 363 },
a4: { l: 0.60, c: 0.32, h: 403 },
b0: { l: 0.90, c: 0.01, h: 243 },
- b1: { l: 0.21, c: 0.01, h: 243 },
+ b1: { l: 0.81, c: 0.01, h: 243 },
b2: { l: 0.80, c: 0.01, h: 243 },
b3: { l: 0.77, c: 0.01, h: 243 },
b4: { l: 0.72, c: 0.01, h: 243 },
diff --git a/js/app/packages/ui/components/Button.tsx b/js/app/packages/ui/components/Button.tsx
index 598f71bd61..fd07ebc24f 100644
--- a/js/app/packages/ui/components/Button.tsx
+++ b/js/app/packages/ui/components/Button.tsx
@@ -4,6 +4,7 @@ import { cn } from '../utils/classname';
import CorvuTooltip from '@corvu/tooltip';
import type { Placement } from '@floating-ui/dom';
import { type JSX, Show, splitProps, type ValidComponent } from 'solid-js';
+import { Layer } from './Layer';
export type ButtonVariant =
| 'primary'
@@ -26,6 +27,7 @@ export type ButtonProps<T extends ValidComponent = 'button'> = PolymorphicProps<
tooltipPlacement?: Placement;
class?: string;
children?: JSX.Element;
+ depth?: 0 | 1 | 2 | 3 | 4 | 5;
};
const variantStyles: Record<ButtonVariant, string> = {
@@ -73,6 +75,7 @@ const TOOLTIP_FLOATING_OPTIONS = {
* @param props.size - sm, md (default), lg, icon-sm, icon-md, or icon-lg.
* @param props.tooltip - Optional tooltip content to display when hovering over the button.
* @param props.tooltipPlacement - Placement of the tooltip (default: "bottom"). Accepts any Floating UI placement string.
+ * @param props.depth - Layer depth (0-5). Wraps the button in a `Layer` so theme color tokens shift accordingly.
* @param props.as - Override the rendered element (e.g. `"a"` or a router `<Link>` component).
*
* @example
@@ -106,6 +109,7 @@ export const Button = <T extends ValidComponent = 'button'>(
'children',
'tooltip',
'tooltipPlacement',
+ 'depth',
]);
const variant = () => local.variant ?? 'ghost';
@@ -113,7 +117,7 @@ export const Button = <T extends ValidComponent = 'button'>(
const cls = () =>
cn(
- 'relative inline-flex items-center justify-center font-medium leading-none border border-transparent',
+ 'relative inline-flex items-center justify-center font-medium leading-none border border-transparent rounded-xs',
'data-disabled:cursor-not-allowed',
'touch:min-h-11 touch:min-w-11 touch:[&_svg]:size-6',
variantStyles[variant()],
@@ -122,35 +126,37 @@ export const Button = <T extends ValidComponent = 'button'>(
);
return (
- <Show
- when={local.tooltip}
- fallback={
- <KButton class={cls()} {...others}>
- {local.children}
- </KButton>
- }
- >
- <CorvuTooltip
- placement={local.tooltipPlacement ?? 'bottom'}
- floatingOptions={TOOLTIP_FLOATING_OPTIONS}
- group="tooltip-single-group"
- openDelay={TOOLTIP_DELAY}
- closeDelay={TOOLTIP_DELAY}
+ <Layer depth={local.depth ?? 0}>
+ <Show
+ when={local.tooltip}
+ fallback={
+ <KButton class={cls()} {...others}>
+ {local.children}
+ </KButton>
+ }
>
- <CorvuTooltip.Trigger as={KButton} class={cls()} {...others}>
- {local.children}
- </CorvuTooltip.Trigger>
- <CorvuTooltip.Portal>
- <CorvuTooltip.Content
- class="z-tool-tip"
- style={{ 'max-width': 'calc(100vw - 32px)' }}
- >
- <div class="flex items-center justify-center bg-panel p-1.5 text-ink-muted text-xs wrap-break-word rounded-sm border border-edge-muted shadow-md shadow-[#000]/5">
- {local.tooltip}
- </div>
- </CorvuTooltip.Content>
- </CorvuTooltip.Portal>
- </CorvuTooltip>
- </Show>
+ <CorvuTooltip
+ placement={local.tooltipPlacement ?? 'bottom'}
+ floatingOptions={TOOLTIP_FLOATING_OPTIONS}
+ group="tooltip-single-group"
+ openDelay={TOOLTIP_DELAY}
+ closeDelay={TOOLTIP_DELAY}
+ >
+ <CorvuTooltip.Trigger as={KButton} class={cls()} {...others}>
+ {local.children}
+ </CorvuTooltip.Trigger>
+ <CorvuTooltip.Portal>
+ <CorvuTooltip.Content
+ class="z-tool-tip"
+ style={{ 'max-width': 'calc(100vw - 32px)' }}
+ >
+ <div class="flex items-center justify-center bg-panel p-1.5 text-ink-muted text-xs wrap-break-word rounded-sm border border-edge-muted shadow-md shadow-[#000]/5">
+ {local.tooltip}
+ </div>
+ </CorvuTooltip.Content>
+ </CorvuTooltip.Portal>
+ </CorvuTooltip>
+ </Show>
+ </Layer>
);
};