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): update all settings tabs (#3060)

Fake-Userfa266ce30c0c
diff --git a/js/app/packages/app/component/paywall/PaywallComponent.tsx b/js/app/packages/app/component/paywall/PaywallComponent.tsx
index 4ba78d788d..1d0a2da728 100644
--- a/js/app/packages/app/component/paywall/PaywallComponent.tsx
+++ b/js/app/packages/app/component/paywall/PaywallComponent.tsx
@@ -1,4 +1,4 @@
-import { cn } from '@ui/utils/classname';
+import { Button } from '@ui/components/Button';
import { useHasPaidAccess } from '@core/auth';
import { toast } from '@core/component/Toast/Toast';
import { type PaywallKey, PaywallMessages } from '@core/constant/PaywallState';
@@ -10,6 +10,7 @@ import { createMemo, createSignal, For, Show } from 'solid-js';
import { match } from 'ts-pattern';
import { useAnalytics } from '@app/component/analytics-context';
import { PLANS, PLAN_FEATURES, type PaidPlanTier } from './plans';
+import SubscriptionTier from './SubscriptionTier';
// Paid-only plans for the billing paywall — Stripe has no product for the
// 'free' tier, so it must be excluded here. Filtered once at module scope so
@@ -136,17 +137,17 @@ const PaywallComponent = (props: PaywallComponent) => {
};
return (
- <div class="space-y-6 sm:space-y-8 w-full">
- <div class="relative w-full text-center">
- <Show when={!props.hideCloseButton}>
- <button
- onClick={props.cb}
- class="fixed top-6 right-6 sm:top-3 sm:right-3 text-ink-extra-muted hover:text-ink transition-colors"
- >
- <IconX class="w-5 sm:w-6 h-5 sm:h-6" />
- </button>
- </Show>
- <Show when={!hasPaid()}>
+ <div class="space-y-2 w-full">
+ <Show when={!props.hideCloseButton}>
+ <button
+ onClick={props.cb}
+ class="fixed top-6 right-6 sm:top-3 sm:right-3 text-ink-extra-muted hover:text-ink transition-colors"
+ >
+ <IconX class="w-5 sm:w-6 h-5 sm:h-6" />
+ </button>
+ </Show>
+ <Show when={!hasPaid()}>
+ <div class="relative w-full text-center">
<div class="space-y-6 sm:space-y-8">
<div class="text-center">
<h2 class="mb-2 font-semibold text-ink text-xl sm:text-2xl">
@@ -159,19 +160,18 @@ const PaywallComponent = (props: PaywallComponent) => {
</Show>
</div>
</div>
- </Show>
- </div>
+ </div>
+ </Show>
- <div class="mx-auto mt-6 w-full max-w-2xl">
- <div class="gap-3 sm:gap-4 grid grid-cols-1 sm:grid-cols-3">
+ <div class="w-full @container">
+ <div class="gap-2 grid grid-cols-1 @[530px]:grid-cols-3">
<For each={PAID_PLANS}>
{(plan) => (
<button
onClick={() => setUserSelectedTier(plan.tier)}
class="p-4 sm:p-5 border flex flex-col transition-all relative text-left"
classList={{
- 'border-accent ring-1 ring-accent bg-active':
- selectedTier() === plan.tier,
+ 'border-accent-ink bg-active': selectedTier() === plan.tier,
'border-edge hover:border-edge': selectedTier() !== plan.tier,
}}
style={{ 'border-radius': '2px' }}
@@ -183,9 +183,12 @@ const PaywallComponent = (props: PaywallComponent) => {
{plan.name}
</div>
</div>
- {selectedTier() === plan.tier && (
- <div class="bg-accent w-3 sm:w-4 h-3 sm:h-4 shrink-0"></div>
- )}
+ <SubscriptionTier
+ class="w-7 shrink-0"
+ tier={
+ selectedTier() === plan.tier ? plan.tier : undefined
+ }
+ />
</div>
<div class="flex items-baseline gap-0.5">
<span class="text-3xl font-bold text-ink">
@@ -209,40 +212,43 @@ const PaywallComponent = (props: PaywallComponent) => {
</div>
</div>
- <div class="mx-auto mt-8 max-w-2xl text-center">
+ <div class="w-full">
<Show
when={hasPaid() && currentTier() && selectedTier() !== currentTier()}
fallback={
- <button
+ <Button
onClick={handleContinue}
- class={cn(
- 'w-full px-4 py-2 sm:px-6 sm:py-3 font-medium transition-none hover:transition text-sm sm:text-base border border-transparent',
- hasPaid()
- ? 'bg-active text-ink border-edge hover:bg-hover hover:border-edge'
- : 'bg-accent text-page hover:bg-accent-ink'
- )}
+ variant="secondary"
+ size="lg"
+ depth={3}
+ class="w-full"
>
<Show when={!hasPaid()} fallback={'Manage Subscription'}>
Get {PLANS.find((p) => p.tier === selectedTier())?.name}
</Show>
- </button>
+ </Button>
}
>
- <button
+ <Button
onClick={handleUpdateTier}
disabled={updating()}
- class="w-full px-4 py-2 sm:px-6 sm:py-3 font-medium transition-none hover:transition text-sm sm:text-base border border-transparent bg-accent text-page hover:bg-accent-ink disabled:opacity-60"
+ variant="active"
+ size="lg"
+ depth={3}
+ class="w-full"
>
{updating() ? 'Updating…' : 'Update Subscription'}
- </button>
+ </Button>
</Show>
<Show when={!hasPaid() && props.handleGuest}>
- <button
+ <Button
onClick={() => props.handleGuest?.()}
- class="mt-3 text-xs text-ink/40 hover:text-ink/60 underline"
+ variant="link"
+ size="sm"
+ class="mt-3 text-ink/40 hover:text-ink/60"
>
Continue with free plan
- </button>
+ </Button>
</Show>
</div>
</div>
diff --git a/js/app/packages/app/component/paywall/SubscriptionTier.tsx b/js/app/packages/app/component/paywall/SubscriptionTier.tsx
new file mode 100644
index 0000000000..97353d096e
--- /dev/null
+++ b/js/app/packages/app/component/paywall/SubscriptionTier.tsx
@@ -0,0 +1,63 @@
+import type { PaidPlanTier } from './plans';
+
+interface SubscriptionTierProps {
+ tier?: PaidPlanTier;
+ class?: string;
+}
+
+const SubscriptionTier = (props: SubscriptionTierProps) => {
+ const active1 = () => props.tier === 'opus';
+ const active2 = () => props.tier === 'opus' || props.tier === 'sonnet';
+ const active3 = () => !!props.tier;
+
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 16"
+ class={props.class}
+ display="block"
+ >
+ <path
+ d="m15.578 0.043946-2.2441 0.87891v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l1.041 0.98242 7.0859 6.6973 2.2402-0.87891v-6.6758c0-0.2568-0.10497-0.50153-0.29297-0.67773z"
+ fill="var(--b4)"
+ />
+ <path
+ d="m6.25 0.041992-2.2422 0.88086v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l1.0391 0.98242 7.084 6.6973 2.2441-0.87891v-6.6758c0-0.2568-0.10302-0.50153-0.29102-0.67773l-1.043-0.98438-7.082-6.6973z"
+ fill="var(--b4)"
+ />
+ <path
+ d="m2.252 5.083-2.2422 0.87891v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l2.793 2.6406 2.2441-0.87891v-6.6758c0-0.2568-0.10302-0.50153-0.29102-0.67773z"
+ fill="var(--b4)"
+ />
+
+ <path
+ d="m15.578 0.043946-2.2441 0.87891v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l1.041 0.98242 7.0859 6.6973 2.2402-0.87891v-6.6758c0-0.2568-0.10497-0.50153-0.29297-0.67773z"
+ style={{
+ transform: `translateY(${active1() ? 0 : 16}px)`,
+ transition: 'transform 0.3s ease 0.2s',
+ fill: 'var(--a0)',
+ }}
+ />
+ <path
+ d="m6.25 0.041992-2.2422 0.88086v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l1.0391 0.98242 7.084 6.6973 2.2441-0.87891v-6.6758c0-0.2568-0.10302-0.50153-0.29102-0.67773l-1.043-0.98438-7.082-6.6973z"
+ style={{
+ transform: `translateY(${active2() ? 0 : 16}px)`,
+ transition: 'transform 0.3s ease 0.1s',
+ fill: 'var(--a0)',
+ }}
+ />
+ <path
+ d="m2.252 5.083-2.2422 0.87891v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l2.793 2.6406 2.2441-0.87891v-6.6758c0-0.2568-0.10302-0.50153-0.29102-0.67773z"
+ style={{
+ transform: `translateY(${active3() ? 0 : 16}px)`,
+ transition: 'transform 0.3s ease 0s',
+ fill: 'var(--a0)',
+ }}
+ />
+
+ {/*<path fill="var(--b0)" d="m5.3398 9.2617v5.8164l-2.2441 0.87891-2.793-2.6387c-0.186-0.1764-0.29296-0.42289-0.29297-0.67969v3.3613h23.99l-0.0059-0.91992-2.2402 0.87891-7.0859-6.6973v5.8184l-2.2441 0.87891z"/>*/}
+ </svg>
+ );
+};
+
+export default SubscriptionTier;
diff --git a/js/app/packages/app/component/paywall/plans.ts b/js/app/packages/app/component/paywall/plans.ts
index a380454103..c6010614ad 100644
--- a/js/app/packages/app/component/paywall/plans.ts
+++ b/js/app/packages/app/component/paywall/plans.ts
@@ -37,21 +37,21 @@ export interface PlanFeature {
export const PLAN_FEATURES: PlanFeature[] = [
{
- label: 'AI Agent',
+ label: 'AI Tool Calls',
values: {
free: '—',
- haiku: 'Haiku',
- sonnet: 'Sonnet',
- opus: 'Opus',
+ haiku: '1,000',
+ sonnet: '5,000',
+ opus: 'Unlimited',
},
},
{
- label: 'AI tool calls',
+ label: 'AI Agent',
values: {
free: '—',
- haiku: '1,000/month',
- sonnet: '5,000/month',
- opus: 'Unlimited',
+ haiku: 'Haiku',
+ sonnet: 'Sonnet',
+ opus: 'Opus',
},
},
{
diff --git a/js/app/packages/app/component/settings/Account.tsx b/js/app/packages/app/component/settings/Account.tsx
index c1977255a3..7cffb1e19f 100644
--- a/js/app/packages/app/component/settings/Account.tsx
+++ b/js/app/packages/app/component/settings/Account.tsx
@@ -29,6 +29,9 @@ import SignOutIcon from '@phosphor-icons/core/regular/sign-out.svg?component-sol
import { authServiceClient } from '@service-auth/client';
import { useEmail, useLicenseStatus, useUserId } from '@core/context/user';
import { createMemo, createResource, createSignal, Show } from 'solid-js';
+import { usePermissions } from '@core/context/user';
+import { useSettingsState } from '@core/constant/SettingsState';
+import PaywallComponent from '../paywall/PaywallComponent';
import {
useEmailLinks,
useEmailLinksStatus,
@@ -86,6 +89,8 @@ export function Account() {
const logout = useLogout();
const { showPaywall } = usePaywallState();
const hasPaidAccess = useHasPaidAccess();
+ const permissions = usePermissions();
+ const { toggleSettings } = useSettingsState();
const [showEmailModal, setShowEmailModal] = createSignal<boolean>(false);
const [showEnableEmailModal, setShowEnableEmailModal] = createSignal<boolean>(false);
const [showDeleteModal, setShowDeleteModal] = createSignal<boolean>(false);
@@ -154,165 +159,173 @@ export function Account() {
class="h-full overflow-y-auto p-2"
style="scrollbar-width: none;"
>
- <div class="max-w-2xl w-full mx-auto">
+ <div class="max-w-200 w-full mx-auto">
<Panel depth={2}>
<div class="text-ink">
<div class="relative flex items-center justify-between h-10 px-6 after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-edge-muted after:content-['']">
<div class="text-sm font-semibold">Account</div>
</div>
<div class="grid gap-px bg-edge-muted border-b border-edge-muted">
-
- <Show when={ENABLE_PROFILE_PICTURES && userId()}>
- <Row label="Profile Picture">
- <div
- class="relative group cursor-pointer"
- use:fileSelector={{
- acceptedFileExtensions: blockNameToFileExtensions.image,
- acceptedMimeTypes: blockNameToMimeTypes.image,
- onSelect: async (files: File[]) => {
- let response = await uploadProfilePicture(files[0]);
- if (!response || !userId()) return;
- let { url } = response;
- let pic: ProfilePictureItem = {
- _createdAt: new Date(),
- url,
- id: userId()!,
- loading: false,
- };
- // update the cache directly to force a reload
- const [_, controls] = useProfilePictureUrl(userId());
- controls.mutate(pic);
- },
- }}
- >
- <UserIcon
- id={userId() as string}
- isDeleted={false}
- size="lg"
- class="bg-transparent"
+ <Show when={permissions()?.includes('write:stripe_subscription') && !isNativeMobilePlatform()}>
+ <div class="bg-panel px-6 py-2">
+ <PaywallComponent
+ hideCloseButton
+ cb={() => {}}
+ handleGuest={() => toggleSettings()}
/>
- <div class="absolute inset-0 flex items-center justify-center rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity">
- <IconUpload class="size-5 text-white" />
- </div>
</div>
- </Row>
- </Show>
+ </Show>
- <Row label="Email">
- <span class="ph-no-capture text-sm text-ink-muted">
- {email() ?? ''}
- </span>
- </Row>
-
- <Row label="First Name">
- <EditableField
- class="ph-no-capture [&_span]:text-sm [&_span]:text-ink-muted [&_span]:leading-normal"
- value={firstName()}
- onSave={(newValue: string) => {
- setUpdatedFirstName(newValue);
- authServiceClient.putUserName({ first_name: newValue });
- }}
- placeholder="Enter First Name"
- allowEmpty={true}
- />
- </Row>
-
- <Row label="Last Name">
- <EditableField
- class="ph-no-capture [&_span]:text-sm [&_span]:text-ink-muted [&_span]:leading-normal"
- value={lastName()}
- onSave={(newValue: string) => {
- setUpdatedLastName(newValue);
- authServiceClient.putUserName({ last_name: newValue });
- }}
- placeholder="Enter Last Name"
- allowEmpty={true}
- />
- </Row>
-
- <Row label="License Status">
- <div class="flex items-center gap-3">
- <span class="text-sm text-ink-muted">
- {capitalize(licenseStatus() ?? '')}
- </span>
- <Show when={!hasPaidAccess()}>
- <Button
- variant="accent"
- size="sm"
- depth={3}
- onClick={() => showPaywall()}
+ <Show when={ENABLE_PROFILE_PICTURES && userId()}>
+ <Row label="Profile Picture">
+ <div
+ class="relative group cursor-pointer"
+ use:fileSelector={{
+ acceptedFileExtensions: blockNameToFileExtensions.image,
+ acceptedMimeTypes: blockNameToMimeTypes.image,
+ onSelect: async (files: File[]) => {
+ let response = await uploadProfilePicture(files[0]);
+ if (!response || !userId()) return;
+ let { url } = response;
+ let pic: ProfilePictureItem = {
+ _createdAt: new Date(),
+ url,
+ id: userId()!,
+ loading: false,
+ };
+ // update the cache directly to force a reload
+ const [_, controls] = useProfilePictureUrl(userId());
+ controls.mutate(pic);
+ },
+ }}
>
- Upgrade
- </Button>
- </Show>
- </div>
- </Row>
-
- <BundleUpdateRow />
+ <UserIcon
+ id={userId() as string}
+ isDeleted={false}
+ size="lg"
+ class="bg-transparent"
+ />
+ <div class="absolute inset-0 flex items-center justify-center rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity">
+ <IconUpload class="size-5 text-white" />
+ </div>
+ </div>
+ </Row>
+ </Show>
- <Show when={ENABLE_EMAIL && (!emailActive() || DEV_MODE_ENV)}>
<Row label="Email">
- <Show
- when={!emailActive()}
- fallback={
- <Button
- variant="secondary"
- size="sm"
- depth={3}
- onClick={() => setShowEmailModal(true)}
- >
- Disable
- </Button>
- }
- >
- <Show when={!showEnableEmailModal()}>
+ <span class="ph-no-capture text-sm text-ink-muted">
+ {email() ?? ''}
+ </span>
+ </Row>
+
+ <Row label="First Name">
+ <EditableField
+ class="ph-no-capture [&_span]:text-sm [&_span]:text-ink-muted [&_span]:leading-normal"
+ value={firstName()}
+ onSave={(newValue: string) => {
+ setUpdatedFirstName(newValue);
+ authServiceClient.putUserName({ first_name: newValue });
+ }}
+ placeholder="Enter First Name"
+ allowEmpty={true}
+ />
+ </Row>
+
+ <Row label="Last Name">
+ <EditableField
+ class="ph-no-capture [&_span]:text-sm [&_span]:text-ink-muted [&_span]:leading-normal"
+ value={lastName()}
+ onSave={(newValue: string) => {
+ setUpdatedLastName(newValue);
+ authServiceClient.putUserName({ last_name: newValue });
+ }}
+ placeholder="Enter Last Name"
+ allowEmpty={true}
+ />
+ </Row>
+
+ <Row label="License Status">
+ <div class="flex items-center gap-3">
+ <span class="text-sm text-ink-muted">
+ {capitalize(licenseStatus() ?? '')}
+ </span>
+ <Show when={!hasPaidAccess()}>
<Button
- variant="secondary"
+ variant="accent"
size="sm"
depth={3}
- onClick={() => setShowEnableEmailModal(true)}
+ onClick={() => showPaywall()}
>
- Enable
+ Upgrade
</Button>
</Show>
- </Show>
+ </div>
</Row>
- </Show>
- <Row label="GitHub">
- <Show
- when={!githubLinkExists.loading}
- fallback={
- <span class="text-sm text-ink-muted">Loading…</span>
- }
- >
+ <BundleUpdateRow />
+
+ <Show when={ENABLE_EMAIL && (!emailActive() || DEV_MODE_ENV)}>
+ <Row label="Email">
+ <Show
+ when={!emailActive()}
+ fallback={
+ <Button
+ variant="secondary"
+ size="sm"
+ depth={3}
+ onClick={() => setShowEmailModal(true)}
+ >
+ Disable
+ </Button>
+ }
+ >
+ <Show when={!showEnableEmailModal()}>
+ <Button
+ variant="secondary"
+ size="sm"
+ depth={3}
+ onClick={() => setShowEnableEmailModal(true)}
+ >
+ Enable
+ </Button>
+ </Show>
+ </Show>
+ </Row>
+ </Show>
+
+ <Row label="GitHub">
<Show
- when={!githubLinkExists()}
+ when={!githubLinkExists.loading}
fallback={
+ <span class="text-sm text-ink-muted">Loading…</span>
+ }
+ >
+ <Show
+ when={!githubLinkExists()}
+ fallback={
+ <Button
+ variant="secondary"
+ size="sm"
+ depth={3}
+ onClick={handleGithubDisable}
+ >
+ Disable
+ </Button>
+ }
+ >
<Button
variant="secondary"
size="sm"
depth={3}
- onClick={handleGithubDisable}
+ onClick={handleGithubEnable}
>
- Disable
+ Enable
</Button>
- }
- >
- <Button
- variant="secondary"
- size="sm"
- depth={3}
- onClick={handleGithubEnable}
- >
- Enable
- </Button>
+ </Show>
</Show>
- </Show>
- </Row>
-
- <NotificationToggle />
+ </Row>
+ <NotificationToggle />
</div>
<div class="flex items-center justify-end h-10 px-6">
diff --git a/js/app/packages/app/component/settings/Appearance.tsx b/js/app/packages/app/component/settings/Appearance.tsx
index e26c2687ae..4487b00275 100644
--- a/js/app/packages/app/component/settings/Appearance.tsx
+++ b/js/app/packages/app/component/settings/Appearance.tsx
@@ -3,35 +3,71 @@ import { ThemeEditorBasic } from '@theme/components/ThemeEditorBasic';
import ThemeTools from '@theme/components/ThemeTools';
import ThemeList from '@theme/components/ThemeList';
-import { isMobile } from '@core/mobile/isMobile';
import { Panel } from '@ui';
-import { cn } from '@ui/utils/classname';
+import { Tabs } from '@core/component/Tabs';
+import { createSignal, Show } from 'solid-js';
+import { isMobile } from '@core/mobile/isMobile';
+
+type EditorTab = 'basic' | 'advanced';
export function Appearance() {
+ const [activeTab, setActiveTab] = createSignal<EditorTab>('basic');
+
+ const tabList = [
+ { value: 'basic', label: 'Basic' },
+ { value: 'advanced', label: 'Advanced' },
+ ];
+
return (
- <div
- style={{
- 'grid-template-rows': 'min-content 1fr',
- 'grid-template-columns': '1fr',
- 'overflow': 'hidden',
- 'display': 'grid',
- 'height': '100%',
- 'padding': '8px',
- 'gap': '8px',
- }}
- >
- <Panel depth={2}>
- <ThemeTools />
- <ThemeEditorBasic />
- </Panel>
-
- <div class="@container grid grid-cols-1 @[700px]:grid-cols-2 gap-2 overflow-hidden min-h-0">
+ <div class="h-full overflow-hidden flex justify-center p-2">
+ <div
+ class="max-w-200 w-full h-full"
+ style={{
+ 'grid-template-rows': 'min-content 1fr',
+ 'grid-template-columns': '1fr',
+ 'overflow': 'hidden',
+ 'display': 'grid',
+ 'gap': '8px',
+ }}
+ >
<Panel depth={2}>
- <ThemeList />
+ <div class="flex flex-col h-full overflow-hidden">
+ <div class="relative flex items-center gap-3 h-10 shrink-0 px-[20px] after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-edge-muted after:content-['']">
+ <div class="h-full shrink-0">
+ <Tabs
+ list={tabList}
+ value={activeTab()}
+ defaultValue="basic"
+ onChange={(value) => setActiveTab(value as EditorTab)}
+ />
+ </div>
+ <Show when={!isMobile()}>
+ <div class="flex-1 min-w-0 h-full">
+ <ThemeTools />
+ </div>
+ </Show>
+ </div>
+
+ <Show when={isMobile()}>
+ <div class="flex items-center px-[20px] py-1.5 border-b border-edge-muted shrink-0 min-w-0 overflow-hidden">
+ <ThemeTools />
+ </div>
+ </Show>
+
+ <div class="flex-1 overflow-auto min-h-0">
+ <Show when={activeTab() === 'basic'}>
+ <ThemeEditorBasic />
+ </Show>
+ <Show when={activeTab() === 'advanced'}>
+ <ThemeEditorAdvanced />
+ </Show>
+ </div>
+ </div>
</Panel>
- <div class={cn('contents', isMobile() && 'hidden')}>
+
+ <div class="grid grid-cols-1 gap-2 overflow-hidden min-h-0">
<Panel depth={2}>
- <ThemeEditorAdvanced />
+ <ThemeList />
</Panel>
</div>
</div>
diff --git a/js/app/packages/app/component/settings/MobileApp.tsx b/js/app/packages/app/component/settings/MobileApp.tsx
index fcfc38a099..de2d1b8b88 100644
--- a/js/app/packages/app/component/settings/MobileApp.tsx
+++ b/js/app/packages/app/component/settings/MobileApp.tsx
@@ -4,16 +4,15 @@ import { Panel } from '@ui';
export function MobileApp() {
return (
<div
- class="flex-1 overflow-y-auto py-2 px-4"
- style="scrollbar-width: none;"
+ class="h-full overflow-hidden flex justify-center p-2"
>
- <div class="max-w-2xl w-full mx-auto">
- <Panel depth={2}>
- <div class="text-ink">
- <div class="relative flex items-center justify-between h-10 px-6 after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-edge after:content-['']">
+ <div class="max-w-200 w-full h-full">
+ <Panel depth={2} class="h-full overflow-hidden">
+ <div class="text-ink h-full flex flex-col">
+ <div class="flex items-center justify-between h-10 px-6 border-b border-edge-muted">
<div class="text-sm font-semibold">Mobile App</div>
</div>
- <div class="flex flex-col items-center justify-center gap-6 py-8">
+ <div class="flex-1 flex flex-col items-center justify-center gap-6 py-8">
<AppStoreQr style="display: block; max-width: 300px;" />
<p class="text-sm text-ink text-center">
Download on the<br/>
diff --git a/js/app/packages/app/component/settings/Settings.tsx b/js/app/packages/app/component/settings/Settings.tsx
index fda984ca10..82243a52ca 100644
--- a/js/app/packages/app/component/settings/Settings.tsx
+++ b/js/app/packages/app/component/settings/Settings.tsx
@@ -2,10 +2,10 @@ import { createEffect, onMount, Show, Suspense } from 'solid-js';
import { type SettingsTab, useSettingsState } from '@core/constant/SettingsState';
import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';
import { isMobile } from '@core/mobile/isMobile';
-import { usePermissions } from '@core/context/user';
+
import { DEV_MODE_ENV, ENABLE_APP_STORE_QR_CODE, ENABLE_TEAMS_OVERRIDE } from '@core/constant/featureFlags';
import { useFeatureFlag } from '@app/lib/analytics/posthog';
-import { Subscription } from './Subscription';
+
import { MobileApp } from './MobileApp';
import { Mcp } from './Mcp';
import { Appearance } from './Appearance';
@@ -41,8 +41,7 @@ type SettingsPanelProps = {
export function SettingsPanel(props: SettingsPanelProps) {
const { settingsOpen, closeSettings, activeTabId, setActiveTabId } = useSettingsState();
- const permissions = usePermissions();
- const teamsFlag = useFeatureFlag('enable-teams-settings', { enabledOverride: ENABLE_TEAMS_OVERRIDE });
+ const teamsFlag = useFeatureFlag('enable-teams-settings', { enabledOverride: ENABLE_TEAMS_OVERRIDE });
// Set up hotkey scope for settings panel
const [attachHotkeys, settingsHotkeyScope] = useHotkeyDOMScope('settings');
@@ -66,7 +65,6 @@ export function SettingsPanel(props: SettingsPanelProps) {
];
if (teamsFlag().enabled) { tabs.push({ value: 'Team', label: 'Team' }) }
tabs.push({ value: 'Shortcuts', label: 'Shortcuts' });
- if (permissions()?.includes('write:stripe_subscription') && !isNativeMobilePlatform()) { tabs.push({ value: 'Subscription', label: 'Subscription' }) }
if (ENABLE_APP_STORE_QR_CODE && !isNativeMobilePlatform()) { tabs.push({ value: 'Mobile App', label: 'App' }) }
if (!isNativeMobilePlatform()) { tabs.push({ value: 'MCP', label: 'MCP' }) }
if (isNativeMobilePlatform() && DEV_MODE_ENV) { tabs.push({ value: 'Mobile', label: 'Mobile Dev Tools' }) }
@@ -207,9 +205,7 @@ export function SettingsPanel(props: SettingsPanelProps) {
<Account />
</Suspense>
</Show>
- <Show when={activeTabId() === 'Subscription' && permissions()?.includes('write:stripe_subscription') && !isNativeMobilePlatform()}>
- <Subscription />
- </Show>
+
<Show when={activeTabId() === 'Appearance'}>
<Appearance />
</Show>
diff --git a/js/app/packages/app/component/settings/Shortcuts.tsx b/js/app/packages/app/component/settings/Shortcuts.tsx
index 05c1385821..ce689d3e5b 100644
--- a/js/app/packages/app/component/settings/Shortcuts.tsx
+++ b/js/app/packages/app/component/settings/Shortcuts.tsx
@@ -1,84 +1,78 @@
import { IS_MAC } from '@core/constant/isMac';
-import { CustomScrollbar } from '@core/component/CustomScrollbar';
import { Hotkey } from '@core/component/Hotkey';
+import { Keyboard, Panel } from '@ui';
import { cn } from '@ui/utils/classname';
import { createSignal, For, Index, type JSX } from 'solid-js';
const cmdOrCtrl = IS_MAC ? 'cmd' : 'ctrl';
+const CmdOrCtrl = IS_MAC ? 'MetaLeft' : 'ControlLeft';
-type ShortcutItem = {
+interface ShortcutItem {
+ /** Display strings for `<Hotkey>`, e.g. ['cmd+k']. Multiple = "any of these works". */
keys: string[];
+ /** `e.code` values to light up on the keyboard when this row is hovered. */
+ codes: string[];
description: JSX.Element;
-};
+}
-type ShortcutSection = {
+interface ShortcutSection {
title: string;
items: ShortcutItem[];
-};
+}
const shortcutSections: ShortcutSection[] = [
{
title: 'Core',
items: [
- { keys: ['c'], description: 'Open the create menu' },
- { keys: [`${cmdOrCtrl}+k`], description: 'Open the command menu' },
- {
- keys: ['g'],
- description: (
- <>
- Go to a view (e.g. <Kbd shortcut="g" /> then <Kbd shortcut="i" /> for inbox)
- </>
- ),
- },
- { keys: ['/'], description: 'Go to search view' },
- { keys: [`${cmdOrCtrl}+f`], description: 'Search in current view' },
- { keys: [`${cmdOrCtrl}+j`], description: 'Focus AI chat' },
- { keys: [`${cmdOrCtrl}+;`], description: 'Open settings panel' },
+ { keys: ['c'] , codes: ['KeyC'] , description: 'Open the create menu' },
+ { keys: [`${cmdOrCtrl}+k`], codes: [CmdOrCtrl, 'KeyK'] , description: 'Open the command menu' },
+ { keys: ['g'] , codes: ['KeyG'] , description: 'Go to a view' },
+ { keys: ['/'] , codes: ['Slash'] , description: 'Go to search view' },
+ { keys: [`${cmdOrCtrl}+f`], codes: [CmdOrCtrl, 'KeyF'] , description: 'Search in current view' },
+ { keys: [`${cmdOrCtrl}+j`], codes: [CmdOrCtrl, 'KeyJ'] , description: 'Focus AI chat' },
+ { keys: [`${cmdOrCtrl}+;`], codes: [CmdOrCtrl, 'Semicolon'] , description: 'Open settings panel' },
],
},
{
- title: 'Unified List',
+ title: 'Splits',
items: [
- { keys: ['j', 'arrowdown'], description: 'Move down' },
- { keys: ['k', 'arrowup'], description: 'Move up' },
- { keys: ['shift+j', 'shift+arrowdown'], description: `Select down` },
- { keys: ['shift+k', 'shift+arrowup'], description: `Select up` },
- { keys: ['e'], description: 'Mark done' },
- {
- keys: ['x'],
- description: (
- <>
- Select items (then <Kbd shortcut={`${cmdOrCtrl}+k`} /> to bring up actions)
- </>
- ),
- },
- { keys: ['f'], description: 'Open filter menu' },
- { keys: ['h', 'arrowleft'], description: 'Collapse item' },
- { keys: ['l', 'arrowright'], description: 'Expand item' },
- { keys: ['space'], description: 'Preview item' },
- { keys: ['click', 'enter'], description: 'Open item in current split' },
- { keys: ['shift+click', 'shift+enter'], description: 'Open item in a new split' },
+ { keys: ['\\'] , codes: ['Backslash'] , description: 'Create a split' },
+ { keys: ['cmd+escape'] , codes: ['MetaLeft', 'Escape'] , description: 'Go home / close split' },
+ { keys: ['shift+escape'] , codes: ['ShiftLeft', 'Escape'] , description: 'Spotlight split' },
+ { keys: ['shift+arrowleft'] , codes: ['ShiftLeft', 'ArrowLeft'] , description: 'Focus split to the left' },
+ { keys: ['shift+arrowright'], codes: ['ShiftLeft', 'ArrowRight'] , description: 'Focus split to the right' },
+ { keys: ['opt+['] , codes: ['AltLeft', 'BracketLeft'] , description: 'Go back in current split' },
+ { keys: ['opt+]'] , codes: ['AltLeft', 'BracketRight'] , description: 'Go forward in current split' },
],
},
{
- title: 'Splits',
+ title: 'Unified List',
items: [
- { keys: ['\\', `${cmdOrCtrl}+\\`], description: 'Create a split' },
- { keys: [`cmd+escape`], description: 'Go home / close split'},
- { keys: ['shift+escape'], description: 'Spotlight split' },
- { keys: ['shift+h', 'shift+arrowleft'], description: 'Focus split to the left' },
- { keys: ['shift+l', 'shift+arrowright'], description: 'Focus split to the right' },
- { keys: [`opt+[`], description: 'Go back in current split' },
- { keys: [`opt+]`], description: 'Go forward in current split' },
+ { keys: ['arrowdown'] , codes: ['ArrowDown'] , description: 'Move down' },
+ { keys: ['arrowup'] , codes: ['ArrowUp'] , description: 'Move up' },
+ { keys: ['shift+arrowdown'], codes: ['ShiftLeft', 'ArrowDown'] , description: 'Select down' },
+ { keys: ['shift+arrowup'] , codes: ['ShiftLeft', 'ArrowUp'] , description: 'Select up' },
+ { keys: ['e'] , codes: ['KeyE'] , description: 'Mark done' },
+ { keys: ['x'] , codes: ['KeyX'] , description: 'Select items' },
+ { keys: ['f'] , codes: ['KeyF'] , description: 'Open filter menu' },
+ { keys: ['arrowleft'] , codes: ['ArrowLeft'] , description: 'Collapse item' },
+ { keys: ['arrowright'] , codes: ['ArrowRight'] , description: 'Expand item' },
+ { keys: ['space'] , codes: ['Space'] , description: 'Preview item' },
+ { keys: ['enter'] , codes: ['Enter'] , description: 'Open item in current split' },
+ { keys: ['shift+enter'] , codes: ['ShiftLeft', 'Enter'] , description: 'Open item in a new split' },
],
},
];
+const [hoveredCodes, setHoveredCodes] = createSignal<string[]>([]);
+
function Kbd(props: { shortcut: string; class?: string }) {
return (
<span
class={cn(
- 'inline-flex items-center text-xs px-1.5 py-0.5 rounded-sm border border-edge-muted bg-ink/4 text-ink-muted uppercase',
+ 'inline-flex items-center text-xs px-1.5 py-0.5 rounded-sm uppercase transition-colors',
+ 'border border-edge-muted bg-ink/4 text-ink-muted',
+ 'group-hover:border-accent/30 group-hover:bg-accent/10 group-hover:text-accent',
props.class
)}
>
@@ -89,7 +83,11 @@ function Kbd(props: { shortcut: string; class?: string }) {
function ShortcutRow(props: { item: ShortcutItem; spacer?: string }) {
return (
- <div class="flex items-center gap-2 py-1.5 rounded-md hover:bg-panel-secondary/50 transition-colors">
+ <div
+ class="group flex items-center gap-2 py-1.5 rounded-md hover:bg-panel-secondary/50 transition-colors"
+ onMouseEnter={() => setHoveredCodes(props.item.codes)}
+ onMouseLeave={() => setHoveredCodes([])}
+ >
<div class="shrink-0 flex items-center gap-1 uppercase">
<Index each={props.item.keys}>
{(key, index) => (
@@ -102,7 +100,9 @@ function ShortcutRow(props: { item: ShortcutItem; spacer?: string }) {
)}
</Index>
</div>
- <span class="text-ink-muted text-sm">{props.item.description}</span>
+ <span class="text-sm text-ink-muted group-hover:text-accent transition-colors">
+ {props.item.description}
+ </span>
</div>
);
}
@@ -122,29 +122,52 @@ function ShortcutSectionComponent(props: { section: ShortcutSection }) {
);
}
-export function Shortcuts() {
- const [scrollRef, setScrollRef] = createSignal<HTMLDivElement>();
-
+function ShortcutsContent() {
return (
- <div class="absolute inset-0 bg-panel">
- <div
- ref={setScrollRef}
- class="absolute inset-0 overflow-auto p-6 scrollbar-hidden"
- >
- <div class="max-w-2xl mx-auto">
- <div class="mb-4">
- <h2 class="text-xl font-semibold text-ink mb-2">Keyboard Shortcuts</h2>
- <p class="text-ink-muted text-sm">
- Shortcuts without a {cmdOrCtrl}/option modifier key require text inputs to be unfocused. For example, pressing <kbd>j</kbd> in a document will insert a j, but will move down the list if the document text is unfocused.
- </p>
- </div>
+ <div class="flex flex-col h-full overflow-hidden">
+ <div class="relative flex items-center justify-between h-10 px-6 shrink-0 after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-edge-muted after:content-['']">
+ <div class="text-sm font-semibold">Keyboard Shortcuts</div>
+ </div>
- <For each={shortcutSections}>
- {(section) => <ShortcutSectionComponent section={section} />}
- </For>
+ <div class="flex-1 overflow-auto px-6 py-2 @container">
+ <Keyboard keys={hoveredCodes()} />
+
+ <div class="grid grid-cols-1 @[600px]:grid-cols-2 gap-x-6">
+ {/* Core - left column */}
+ <ShortcutSectionComponent section={shortcutSections[0]} />
+
+ {/* Splits - right column */}
+ <ShortcutSectionComponent section={shortcutSections[1]} />
+
+ {/* Unified List - spans both columns with its own 2-column layout */}
+ <div class="@[600px]:col-span-2">
+ <div class="mb-3">
+ <h3 class="font-medium text-lg mb-2 flex items-center gap-2">
+ {shortcutSections[2].title}
+ </h3>
+ <div class="grid grid-cols-1 @[600px]:grid-cols-2 gap-x-6">
+ <For each={shortcutSections[2].items}>
+ {(item) => <ShortcutRow item={item} spacer="or" />}
+ </For>
+ </div>
+ </div>
+ </div>
</div>
</div>
- <CustomScrollbar scrollContainer={scrollRef} />
+ </div>
+ );
+}
+
+export function Shortcuts() {
+ return (
+ <div class="h-full overflow-hidden flex justify-center p-2">
+ <div class="max-w-200 w-full h-full">
+ <Panel depth={2} class="h-full overflow-hidden">
+ <div class="text-ink h-full">
+ <ShortcutsContent />
+ </div>
+ </Panel>
+ </div>
</div>
);
}
diff --git a/js/app/packages/app/component/settings/Subscription.tsx b/js/app/packages/app/component/settings/Subscription.tsx
deleted file mode 100644
index f2786ef6c3..0000000000
--- a/js/app/packages/app/component/settings/Subscription.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { useSettingsState } from '@core/constant/SettingsState';
-import PaywallComponent from '../paywall/PaywallComponent';
-
-export const Subscription = () => {
- const { toggleSettings } = useSettingsState();
- return (
- <PaywallComponent
- hideCloseButton
- cb={() => {}}
- handleGuest={() => toggleSettings()}
- />
- );
-};
diff --git a/js/app/packages/app/component/settings/Team.tsx b/js/app/packages/app/component/settings/Team.tsx
index c05401d33c..7bb2f90afb 100644
--- a/js/app/packages/app/component/settings/Team.tsx
+++ b/js/app/packages/app/component/settings/Team.tsx
@@ -1382,15 +1382,13 @@ function TeamContent() {
export function Team() {
return (
- <div class="flex justify-center p-2">
- <div class="max-w-2xl w-full">
- <Panel depth={2}>
- <div class="text-ink">
- <Suspense
- fallback={
- <div class="animate-pulse bg-ink-extra-muted rounded h-4 w-32 m-6" />
- }
- >
+ <div
+ class="h-full overflow-hidden flex justify-center p-2"
+ >
+ <div class="max-w-200 w-full h-full">
+ <Panel depth={2} class="h-full overflow-hidden">
+ <div class="text-ink h-full">
+ <Suspense fallback={<div class="animate-pulse bg-ink-extra-muted rounded h-4 w-32 m-6" />}>
<TeamContent />
</Suspense>
</div>
diff --git a/js/app/packages/macro-icons/cover.svg b/js/app/packages/macro-icons/cover.svg
new file mode 100644
index 0000000000..b08d6d6df3
--- /dev/null
+++ b/js/app/packages/macro-icons/cover.svg
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg display="block" version="1.1" viewBox="0 0 24 16" xmlns="http://www.w3.org/2000/svg">
+ <path d="m5.3398 9.2617v5.8164l-2.2441 0.87891-2.793-2.6387c-0.186-0.1764-0.29296-0.42289-0.29297-0.67969v3.3613h23.99l-0.0059-0.91992-2.2402 0.87891-7.0859-6.6973v5.8184l-2.2441 0.87891z" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.999" style="paint-order:markers stroke fill"/>
+</svg>
diff --git a/js/app/packages/macro-icons/macro-brand-loader copy.svg b/js/app/packages/macro-icons/macro-brand-loader copy.svg
new file mode 100644
index 0000000000..1955ffdcb2
--- /dev/null
+++ b/js/app/packages/macro-icons/macro-brand-loader copy.svg
@@ -0,0 +1,26 @@
+<svg xmlns="http://www.w3.org/2000/svg" id="img" width="100%" height="100%" fill="none" stroke="currentColor" stroke-width="1px" stroke-linejoin="round" version="1.1" viewBox="0 0 480 480" xml:space="preserve">
+ <defs>
+ <linearGradient id="gradient" x2="0" y2="48" gradientUnits="userSpaceOnUse">
+ <stop offset="0"/>
+ <stop stop-color="#fff" offset=".2"/>
+ <stop stop-color="#fff" offset=".8"/>
+ <stop offset="1"/>
+ </linearGradient>
+ </defs>
+
+ <mask id="fadeMask">
+ <rect width="48" height="48" fill="url(#gradient)"/>
+ </mask>
+
+ <g transform="matrix(10 0 0 10 -.00285 .0081)" mask="url(#fadeMask)">
+ <path d="m27.557 -43.918-2.2305 0.875v6.6406c0 0.2554 0.10697 0.49843 0.29297 0.67383l8.0801 7.6426 2.2305-0.875v-6.6367c0-0.2554-0.10306-0.50038-0.28906-0.67578z" vector-effect="non-scaling-stroke">
+ <animateTransform keySplines="0 0 1 1; 0.25 0.46 0.45 0.94; 0 0 1 1; 0.55 0.06 0.68 0.19" values="0,-0; 0,62; 0,60; 0,60; 0,120" keyTimes="0; 0.25; 0.3; 0.7; 1" attributeName="transform" repeatCount="indefinite" calcMode="spline" type="translate" begin="0.2s" dur="2s"/>
+ </path>
+ <path d="m18.277 -43.918-2.2305 0.875v6.6406c0 0.2554 0.10697 0.49843 0.29297 0.67383l8.0801 7.6426 2.2305-0.875v-6.6367c0-0.2554-0.10306-0.50038-0.28906-0.67578z" vector-effect="non-scaling-stroke">
+ <animateTransform keySplines="0 0 1 1; 0.25 0.46 0.45 0.94; 0 0 1 1; 0.55 0.06 0.68 0.19" values="0,-0; 0,62; 0,60; 0,60; 0,120" keyTimes="0; 0.25; 0.3; 0.7; 1" attributeName="transform" repeatCount="indefinite" calcMode="spline" type="translate" begin="0.1s" dur="2s"/>
+ </path>
+ <path d="m14.301 -38.902-2.2305 0.87305v6.6426c0 0.2554 0.10697 0.49843 0.29297 0.67383l2.7773 2.6289 2.2324-0.875v-6.6367c0-0.2554-0.10306-0.50038-0.28906-0.67578z" vector-effect="non-scaling-stroke">
+ <animateTransform keySplines="0 0 1 1; 0.25 0.46 0.45 0.94; 0 0 1 1; 0.55 0.06 0.68 0.19" values="0,-0; 0,62; 0,60; 0,60; 0,120" keyTimes="0; 0.25; 0.3; 0.7; 1" attributeName="transform" repeatCount="indefinite" calcMode="spline" type="translate" begin="0s" dur="2s"/>
+ </path>
+ </g>
+<script xmlns=""/></svg>
diff --git a/js/app/packages/macro-icons/macro-subscription.svg b/js/app/packages/macro-icons/macro-subscription.svg
new file mode 100644
index 0000000000..fd43d8b3a3
--- /dev/null
+++ b/js/app/packages/macro-icons/macro-subscription.svg
@@ -0,0 +1,9 @@
+<svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 16"
+ display="block"
+>
+ <path fill="var(--sub-1, var(--b4))" d="m15.578 0.043946-2.2441 0.87891v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l1.041 0.98242 7.0859 6.6973 2.2402-0.87891v-6.6758c0-0.2568-0.10497-0.50153-0.29297-0.67773z"/>
+ <path fill="var(--sub-2, var(--b4))" d="m6.25 0.041992-2.2422 0.88086v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l1.0391 0.98242 7.084 6.6973 2.2441-0.87891v-6.6758c0-0.2568-0.10302-0.50153-0.29102-0.67773l-1.043-0.98438-7.082-6.6973z"/>
+ <path fill="var(--sub-3, var(--b4))" d="m2.252 5.083-2.2422 0.87891v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l2.793 2.6406 2.2441-0.87891v-6.6758c0-0.2568-0.10302-0.50153-0.29102-0.67773z"/>
+</svg>
diff --git a/js/app/packages/theme/components/ThemeEditorAdvanced.tsx b/js/app/packages/theme/components/ThemeEditorAdvanced.tsx
index 4a816f2a31..5e1a23a47d 100644
--- a/js/app/packages/theme/components/ThemeEditorAdvanced.tsx
+++ b/js/app/packages/theme/components/ThemeEditorAdvanced.tsx
@@ -3,6 +3,7 @@ import { convertOklchTo, getOklch, validateColor } from '../utils/colorUtil';
import type { ThemeReactiveColor } from '../types/themeTypes';
import { themeReactive } from '../signals/themeReactive';
import { ColorSwatch } from './ColorSwatch';
+import { isMobile } from '@core/mobile/isMobile';
const displayType = () => 'hex';
@@ -41,23 +42,22 @@ export function ThemeEditorAdvanced(){
`}</style>
<div
- style="
- background-color: var(--b0);
- font-size: var(--text-xs);
- scrollbar-width: none;
- position: relative;
- overflow: hidden;
- font-weight: 300;
- display: block;
- height: 100%;
- "
+ style={{
+ 'height': isMobile() ? '280px' : '390px',
+ 'font-size': 'var(--text-xs)',
+ 'scrollbar-width': 'none',
+ 'position': 'relative',
+ 'overflow': 'hidden',
+ 'font-weight': 300,
+ 'display': 'block',
+ }}
>
<div
style="
overscroll-behavior: none;
box-sizing: border-box;
scrollbar-width: none;
- overflow-y: scroll;
+ overflow-y: auto;
height: 100%;
width: 100%;
"
@@ -71,30 +71,6 @@ export function ThemeEditorAdvanced(){
gap: 1px;
"
>
- <div
- style="
- border-bottom: 1px solid var(--b3);
- background-color: var(--b0);
- align-items: center;
- position: absolute;
- padding: 0 20px;
- display: grid;
- height: 42px;
- width: 100%;
- z-index: 1;
- "
- >
- <div
- style={{
- 'font-size': '0.875rem',
- 'font-weight': '600'
- }}
- >
- Theme Tokens
- </div>
- </div>
- <div style="height: 41px;" />
-
<For each={Object.entries(themeReactive)}>
{([colorKey, colorValue]) => {
// a1 thru a4 are not currently being used, so we will hide them
diff --git a/js/app/packages/theme/components/ThemeEditorBasic.tsx b/js/app/packages/theme/components/ThemeEditorBasic.tsx
index e3cc55c00b..16e592b5d6 100644
--- a/js/app/packages/theme/components/ThemeEditorBasic.tsx
+++ b/js/app/packages/theme/components/ThemeEditorBasic.tsx
@@ -322,13 +322,13 @@ export function ThemeEditorBasic(){
<div
style="
font-family: var(--font-sans);
+ padding: 8px 20px 12px 20px;
background-color: var(--b0);
box-sizing: border-box;
height: min-content;
font-weight: 500;
font-size: 12px;
display: grid;
- padding: 20px;
gap: 20px;
"
>
@@ -509,7 +509,6 @@ export function ThemeEditorBasic(){
style={{
'left': `${(themeReactive.b0.c[0]() / (themeReactive.a0.c[0]() * 0.6) / 0.37) * 100}%`,
'transform': 'translate(-50%, -50%)',
- 'background-color': 'var(--b0)',
'border': '1px solid var(--b4)',
'box-sizing': 'border-box',
'border-radius': '2px',
@@ -605,7 +604,6 @@ export function ThemeEditorBasic(){
style={{
'left': `${(getContrastFromY(themeReactive.b0.l[0]()) / 0.8) * 100}%`,
'transform': 'translate(-50%, -50%)',
- 'background-color': 'var(--b0)',
'border': '1px solid var(--b4)',
'box-sizing': 'border-box',
'border-radius': '2px',
@@ -701,7 +699,6 @@ export function ThemeEditorBasic(){
style={{
'left': `${(themeDepth() / 0.4) * 100}%`,
'transform': 'translate(-50%, -50%)',
- 'background-color': 'var(--b0)',
'border': '1px solid var(--b4)',
'box-sizing': 'border-box',
'border-radius': '2px',
diff --git a/js/app/packages/theme/components/ThemeTools.tsx b/js/app/packages/theme/components/ThemeTools.tsx
index 96479e7d32..19cb353cf3 100644
--- a/js/app/packages/theme/components/ThemeTools.tsx
+++ b/js/app/packages/theme/components/ThemeTools.tsx
@@ -2,6 +2,7 @@ import { deleteTheme, exportTheme, importTheme, invertTheme, saveTheme } from '.
import { currentThemeId, isThemeSaved, themes, userThemes } from '../signals/themeSignals';
import { DeprecatedIconButton } from '@core/component/DeprecatedIconButton';
import { createEffect, createMemo, createSignal, Show } from 'solid-js';
+import { cn } from '@ui/utils/classname';
import IconLightDark from '@macro-icons/macro-light-dark.svg';
import IconClipboard from '@macro-icons/macro-clipboard.svg';
import IconImport from '@macro-icons/macro-import.svg';
@@ -27,61 +28,22 @@ export function ThemeTools() {
else{setShowTrash(false)}
});
- const [columnCount, setColumnCount] = createSignal(0);
- createEffect(() => {
- let count = 5;
- if(showTrash()){count++}
- setColumnCount(count);
- });
-
return (
<div
style={{
- 'grid-template-columns': ` min-content 1fr repeat(${columnCount()}, min-content)`,
- 'padding': '0 12px 0 20px' /* (41 - 32) / 2 */,
- 'border-bottom': '1px solid var(--b3)',
'gap': '4.5px' /* (41 - 32) / 2 */,
'font-family': 'var(--font-sans)',
- 'background-color': 'var(--b0)',
'scrollbar-width': 'none',
'align-items': 'center',
'overflow': 'hidden',
'font-size': '14px',
'height': '39.5px',
- 'display': 'grid',
+ 'display': 'flex',
'width': '100%',
+ 'min-width': '0',
}}
>
- <div
- onKeyDown={(e) => {
- if(e.key === 'Enter'){
- e.preventDefault();
- const name = themeName.innerText.trim();
- if(name){
- saveTheme(name);
- themeName.blur();
- }
- else { themeName.innerText = defaultThemeName; }
- }
- }}
- onBlur={() => {
- if(!themeName.innerText.trim()){
- themeName.innerText = defaultThemeName;
- }
- }}
- style={{
- 'white-space': 'nowrap',
- 'font-size': '0.875rem',
- 'font-weight': '600',
- 'outline': 'none',
- }}
- contentEditable={true}
- ref={themeName}
- >
- {currentThemeName()}
- </div>
-
- <div/>
+ <div style={{ flex: 1 }}/>
<Show when={showTrash()}>
<DeprecatedIconButton
@@ -150,6 +112,41 @@ export function ThemeTools() {
theme="clear"
size="sm"
/>
+
+ <div
+ onKeyDown={(e) => {
+ if(e.key === 'Enter'){
+ e.preventDefault();
+ const name = themeName.innerText.trim();
+ if(name){
+ saveTheme(name);
+ themeName.blur();
+ }
+ else { themeName.innerText = defaultThemeName; }
+ }
+ }}
+ onBlur={() => {
+ if(!themeName.innerText.trim()){
+ themeName.innerText = defaultThemeName;
+ }
+ }}
+ class={cn(
+ 'rounded-xs py-1.5 px-2 border text-xs outline-none',
+ 'bg-transparent text-ink-muted border-edge-muted',
+ 'hover:bg-input hover:text-ink',
+ 'focus:bg-input focus:text-ink',
+ 'min-w-0 overflow-hidden text-ellipsis',
+ )}
+ style={{
+ 'white-space': 'nowrap',
+ 'flex': '0 1 13rem',
+ 'min-width': '0',
+ }}
+ contentEditable={true}
+ ref={themeName}
+ >
+ {currentThemeName()}
+ </div>
</div>
);
}
diff --git a/js/app/packages/ui/components/Button.tsx b/js/app/packages/ui/components/Button.tsx
index 856787f3f0..e691ea037b 100644
--- a/js/app/packages/ui/components/Button.tsx
+++ b/js/app/packages/ui/components/Button.tsx
@@ -13,7 +13,8 @@ export type ButtonVariant =
| 'destructive'
| 'ghost'
| 'link'
- | 'accent';
+ | 'accent'
+ | 'active';
export type ButtonSize = 'sm' | 'md' | 'lg' | 'icon-sm' | 'icon-md' | 'icon-lg';
@@ -44,6 +45,8 @@ const variantStyles: Record<ButtonVariant, string> = {
link: 'bg-transparent text-accent underline-offset-2 not-disabled:hover:underline not-disabled:active:text-accent/80 disabled:text-ink-extra-muted',
accent:
'bg-accent text-panel not-disabled:hover:bg-accent/90 not-disabled:active:bg-accent/80 disabled:bg-ink-extra-muted',
+ active:
+ 'bg-accent/8 text-accent-ink border border-accent-ink not-disabled:hover:bg-accent/20 not-disabled:active:bg-accent/25 disabled:opacity-50',
};
const sizeStyles: Record<ButtonSize, string> = {
diff --git a/js/app/packages/ui/components/Keyboard.tsx b/js/app/packages/ui/components/Keyboard.tsx
new file mode 100644
index 0000000000..4b78815e61
--- /dev/null
+++ b/js/app/packages/ui/components/Keyboard.tsx
@@ -0,0 +1,157 @@
+import { createMemo, For, type JSX } from 'solid-js';
+
+interface KeyDef {
+ height: number;
+ labelX: number;
+ labelY: number;
+ label: string;
+ width: number;
+ name: string;
+ x: number;
+ y: number;
+}
+
+const KEYS: KeyDef[] = [
+ // Row 1: Function keys
+ { name: 'Escape', label: 'esc', x: 0.0763, y: 0.0763, width: 2.8473, height: 1.8473, labelX: 1.50, labelY: 1.0228 },
+ { name: 'F1', label: 'F1', x: 3.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 4.00, labelY: 1.0228 },
+ { name: 'F2', label: 'F2', x: 5.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 6.00, labelY: 1.0228 },
+ { name: 'F3', label: 'F3', x: 7.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 8.00, labelY: 1.0228 },
+ { name: 'F4', label: 'F4', x: 9.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 10.00, labelY: 1.0228 },
+ { name: 'F5', label: 'F5', x: 11.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 12.00, labelY: 1.0228 },
+ { name: 'F6', label: 'F6', x: 13.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 14.00, labelY: 1.0228 },
+ { name: 'F7', label: 'F7', x: 15.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 16.00, labelY: 1.0228 },
+ { name: 'F8', label: 'F8', x: 17.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 18.00, labelY: 1.0228 },
+ { name: 'F9', label: 'F9', x: 19.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 20.00, labelY: 1.0228 },
+ { name: 'F10', label: 'F10', x: 21.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 22.00, labelY: 1.0228 },
+ { name: 'F11', label: 'F11', x: 23.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 24.00, labelY: 1.0228 },
+ { name: 'F12', label: 'F12', x: 25.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 26.00, labelY: 1.0228 },
+ { name: 'F13', label: 'F13', x: 27.0763, y: 0.0763, width: 1.8473, height: 1.8473, labelX: 28.00, labelY: 1.0228 },
+ // Row 2: Number row
+ { name: 'Backquote', label: '`', x: 0.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 1.00, labelY: 3.0228 },
+ { name: 'Digit1', label: '1', x: 2.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 3.00, labelY: 3.0228 },
+ { name: 'Digit2', label: '2', x: 4.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 5.00, labelY: 3.0228 },
+ { name: 'Digit3', label: '3', x: 6.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 7.00, labelY: 3.0228 },
+ { name: 'Digit4', label: '4', x: 8.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 9.00, labelY: 3.0228 },
+ { name: 'Digit5', label: '5', x: 10.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 11.00, labelY: 3.0228 },
+ { name: 'Digit6', label: '6', x: 12.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 13.00, labelY: 3.0228 },
+ { name: 'Digit7', label: '7', x: 14.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 15.00, labelY: 3.0228 },
+ { name: 'Digit8', label: '8', x: 16.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 17.00, labelY: 3.0228 },
+ { name: 'Digit9', label: '9', x: 18.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 19.00, labelY: 3.0228 },
+ { name: 'Digit0', label: '0', x: 20.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 21.00, labelY: 3.0228 },
+ { name: 'Minus', label: '-', x: 22.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 23.00, labelY: 3.0228 },
+ { name: 'Equal', label: '=', x: 24.0763, y: 2.0763, width: 1.8473, height: 1.8473, labelX: 25.00, labelY: 3.0228 },
+ { name: 'Backspace', label: 'del', x: 26.0763, y: 2.0763, width: 2.8473, height: 1.8473, labelX: 27.50, labelY: 3.0228 },
+ // Row 3: QWERTY row
+ { name: 'Tab', label: 'tab', x: 0.0763, y: 4.0763, width: 2.8473, height: 1.8473, labelX: 1.50, labelY: 5.0228 },
+ { name: 'KeyQ', label: 'Q', x: 3.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 4.00, labelY: 5.0228 },
+ { name: 'KeyW', label: 'W', x: 5.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 6.00, labelY: 5.0228 },
+ { name: 'KeyE', label: 'E', x: 7.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 8.00, labelY: 5.0228 },
+ { name: 'KeyR', label: 'R', x: 9.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 10.00, labelY: 5.0228 },
+ { name: 'KeyT', label: 'T', x: 11.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 12.00, labelY: 5.0228 },
+ { name: 'KeyY', label: 'Y', x: 13.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 14.00, labelY: 5.0228 },
+ { name: 'KeyU', label: 'U', x: 15.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 16.00, labelY: 5.0228 },
+ { name: 'KeyI', label: 'I', x: 17.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 18.00, labelY: 5.0228 },
+ { name: 'KeyO', label: 'O', x: 19.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 20.00, labelY: 5.0228 },
+ { name: 'KeyP', label: 'P', x: 21.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 22.00, labelY: 5.0228 },
+ { name: 'BracketLeft', label: '[', x: 23.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 24.00, labelY: 5.0228 },
+ { name: 'BracketRight', label: ']', x: 25.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 26.00, labelY: 5.0228 },
+ { name: 'Backslash', label: '\\', x: 27.0763, y: 4.0763, width: 1.8473, height: 1.8473, labelX: 28.00, labelY: 5.0228 },
+ // Row 4: Home row
+ { name: 'CapsLock', label: 'caps', x: 0.0763, y: 6.0763, width: 3.3473, height: 1.8473, labelX: 1.75, labelY: 7.0228 },
+ { name: 'KeyA', label: 'A', x: 3.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 4.50, labelY: 7.0228 },
+ { name: 'KeyS', label: 'S', x: 5.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 6.50, labelY: 7.0228 },
+ { name: 'KeyD', label: 'D', x: 7.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 8.50, labelY: 7.0228 },
+ { name: 'KeyF', label: 'F', x: 9.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 10.50, labelY: 7.0228 },
+ { name: 'KeyG', label: 'G', x: 11.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 12.50, labelY: 7.0228 },
+ { name: 'KeyH', label: 'H', x: 13.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 14.50, labelY: 7.0228 },
+ { name: 'KeyJ', label: 'J', x: 15.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 16.50, labelY: 7.0228 },
+ { name: 'KeyK', label: 'K', x: 17.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 18.50, labelY: 7.0228 },
+ { name: 'KeyL', label: 'L', x: 19.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 20.50, labelY: 7.0228 },
+ { name: 'Semicolon', label: ';', x: 21.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 22.50, labelY: 7.0228 },
+ { name: 'Quote', label: "'", x: 23.5763, y: 6.0763, width: 1.8473, height: 1.8473, labelX: 24.50, labelY: 7.0228 },
+ { name: 'Enter', label: 'enter', x: 25.5763, y: 6.0763, width: 3.3473, height: 1.8473, labelX: 27.25, labelY: 7.0228 },
+ // Row 5: Bottom letter row
+ { name: 'ShiftLeft', label: 'shift', x: 0.0763, y: 8.0763, width: 4.3473, height: 1.8473, labelX: 2.25, labelY: 9.0228 },
+ { name: 'KeyZ', label: 'Z', x: 4.5763, y: 8.0763, width: 1.8473, height: 1.8473, labelX: 5.50, labelY: 9.0228 },
+ { name: 'KeyX', label: 'X', x: 6.5763, y: 8.0763, width: 1.8473, height: 1.8473, labelX: 7.50, labelY: 9.0228 },
+ { name: 'KeyC', label: 'C', x: 8.5763, y: 8.0763, width: 1.8473, height: 1.8473, labelX: 9.50, labelY: 9.0228 },
+ { name: 'KeyV', label: 'V', x: 10.5763, y: 8.0763, width: 1.8473, height: 1.8473, labelX: 11.50, labelY: 9.0228 },
+ { name: 'KeyB', label: 'B', x: 12.5763, y: 8.0763, width: 1.8473, height: 1.8473, labelX: 13.50, labelY: 9.0228 },
+ { name: 'KeyN', label: 'N', x: 14.5763, y: 8.0763, width: 1.8473, height: 1.8473, labelX: 15.50, labelY: 9.0228 },
+ { name: 'KeyM', label: 'M', x: 16.5763, y: 8.0763, width: 1.8473, height: 1.8473, labelX: 17.50, labelY: 9.0228 },
+ { name: 'Comma', label: ',', x: 18.5763, y: 8.0763, width: 1.8473, height: 1.8473, labelX: 19.50, labelY: 9.0228 },
+ { name: 'Period', label: '.', x: 20.5763, y: 8.0763, width: 1.8473, height: 1.8473, labelX: 21.50, labelY: 9.0228 },
+ { name: 'Slash', label: '/', x: 22.5763, y: 8.0763, width: 1.8473, height: 1.8473, labelX: 23.50, labelY: 9.0228 },
+ { name: 'ShiftRight', label: 'shift', x: 24.5763, y: 8.0763, width: 4.3473, height: 1.8473, labelX: 26.75, labelY: 9.0228 },
+ // Row 6: Bottom row
+ { name: 'Fn', label: 'fn', x: 0.0763, y: 10.0763, width: 1.8473, height: 1.8473, labelX: 1.00, labelY: 11.0228 },
+ { name: 'ControlLeft', label: 'ctrl', x: 2.0763, y: 10.0763, width: 1.8473, height: 1.8473, labelX: 3.00, labelY: 11.0228 },
+ { name: 'AltLeft', label: 'opt', x: 4.0763, y: 10.0763, width: 1.8473, height: 1.8473, labelX: 5.00, labelY: 11.0228 },
+ { name: 'MetaLeft', label: 'cmd', x: 6.0763, y: 10.0763, width: 2.3473, height: 1.8473, labelX: 7.25, labelY: 11.0228 },
+ { name: 'Space', label: 'space', x: 8.5763, y: 10.0763, width: 9.8473, height: 1.8473, labelX: 13.50, labelY: 11.0228 },
+ { name: 'MetaRight', label: 'cmd', x: 18.5763, y: 10.0763, width: 2.3473, height: 1.8473, labelX: 19.75, labelY: 11.0228 },
+ { name: 'AltRight', label: 'opt', x: 21.0763, y: 10.0763, width: 1.8473, height: 1.8473, labelX: 22.00, labelY: 11.0228 },
+ { name: 'ArrowLeft', label: '◂', x: 23.0763, y: 10.0763, width: 1.8473, height: 1.8473, labelX: 24.00, labelY: 11.0228 },
+ { name: 'ArrowUp', label: '▴', x: 25.0763, y: 10.0763, width: 1.8473, height: 0.8473, labelX: 26.00, labelY: 10.5000 },
+ { name: 'ArrowDown', label: '▾', x: 25.0763, y: 11.0763, width: 1.8473, height: 0.8473, labelX: 26.00, labelY: 11.5000 },
+ { name: 'ArrowRight', label: '▸', x: 27.0763, y: 10.0763, width: 1.8473, height: 1.8473, labelX: 28.00, labelY: 11.0228 },
+];
+
+function KeyRect(props: { def: KeyDef; active: boolean }) {
+ const stroke = () => (props.active ? 'var(--a0)' : 'var(--b4)');
+ const fill = () =>
+ props.active ? 'oklch(from var(--a0) l c h / 0.1)' : 'oklch(from var(--b2) l c h / 0.1)';
+
+ return (
+ <>
+ <rect
+ style={{ fill: fill(), stroke: stroke() }}
+ height={props.def.height}
+ width={props.def.width}
+ x={props.def.x}
+ y={props.def.y}
+ ry="0.2"
+ />
+ <text
+ style={{
+ 'font-family': 'var(--font-mono)',
+ 'dominant-baseline': 'central',
+ 'text-anchor': 'middle',
+ 'font-size': '0.4',
+ 'stroke': 'none',
+ 'fill': stroke(),
+ }}
+ x={props.def.labelX}
+ y={props.def.labelY}
+ >
+ {props.def.label}
+ </text>
+ </>
+ );
+}
+
+export function Keyboard(props: { keys?: string[] }): JSX.Element {
+ const active = createMemo(() => new Set(props.keys ?? []));
+
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ style={{
+ 'stroke-linejoin': 'round',
+ 'box-sizing': 'border-box',
+ 'stroke-linecap': 'round',
+ 'stroke-width': '0.0572',
+ 'margin-bottom': '12px',
+ 'display': 'block',
+ 'width': '100%',
+ 'fill': 'none',
+ }}
+ viewBox="0 0 29 12"
+ >
+ <For each={KEYS}>
+ {(key) => <KeyRect def={key} active={active().has(key.name)} />}
+ </For>
+ </svg>
+ );
+}
diff --git a/js/app/packages/ui/index.ts b/js/app/packages/ui/index.ts
index 8af140a41d..78c3234ada 100644
--- a/js/app/packages/ui/index.ts
+++ b/js/app/packages/ui/index.ts
@@ -1,6 +1,7 @@
/* components */
export { SegmentedControl } from './components/SegmentedControl';
export { TabbedControl } from './components/TabbedControl';
+export { Keyboard } from './components/Keyboard';
export { Button } from './components/Button';
export { Layer } from './components/Layer';
export { Panel } from './components/Panel';