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(style): various style nits and upgrades (#3314)

Seamus427f9cb7fcb3
diff --git a/js/app/packages/app/component/EntitySelectionToolbarModal.tsx b/js/app/packages/app/component/EntitySelectionToolbarModal.tsx
index 45705a178c..11e391f527 100644
--- a/js/app/packages/app/component/EntitySelectionToolbarModal.tsx
+++ b/js/app/packages/app/component/EntitySelectionToolbarModal.tsx
@@ -2,7 +2,7 @@ import { ScopedPortal } from '@core/component/ScopedPortal';
import { TOKENS } from '@core/hotkey/tokens';
import type { EntityData } from '@entity';
import CloseIcon from '@phosphor-icons/core/regular/x.svg?component-solid';
-import { Hotkey } from '@ui';
+import { Button, Hotkey, Layer } from '@ui';
interface EntitySelectionToolbarModalProps {
multiSelectEntities: EntityData[];
@@ -15,41 +15,41 @@ export const EntitySelectionToolbarModal = (
) => {
return (
<ScopedPortal scope="split">
- <div class="absolute left-1/2 bottom-16 -translate-x-1/2">
- {/*<div class="absolute size-full pattern-edge-muted pattern-diagonal-4 left-1 top-1 -z-1" />*/}
- <div class="text-sm font-bold flex rounded-sm flex-row items-center gap-2 p-2 bg-surface border border-edge-muted">
- <div class="flex items-center">
- <button
+ <Layer depth={2}>
+ <div class="absolute left-1/2 bottom-16 -translate-x-1/2">
+ <div class="text-sm font-bold flex rounded-xl flex-row items-center gap-2 p-2 bg-surface border border-edge shadow-xl shadow-drop-shadow">
+ <Button
type="button"
- class="size-6 aspect-square p-1 flex items-center justify-center hover:bg-hover"
+ size="icon-sm"
+ variant="ghost"
onClick={props.onClose}
>
- <CloseIcon class="shrink-0 size-full" />
- </button>
+ <CloseIcon />
+ </Button>
<span class="text-ink font-regular w-full whitespace-nowrap">
{props.multiSelectEntities.length} selected
</span>
+ <Button
+ onClick={props.onAction}
+ variant="base"
+ class="p-1 pl-2 rounded-md bg-surface"
+ depth={3}
+ >
+ <span>Actions</span>
+ <Hotkey token={TOKENS.global.commandMenu} theme="subtle" />
+ </Button>
+ <Button
+ onClick={props.onClose}
+ variant="base"
+ class="p-1 pl-2 rounded-md bg-surface"
+ depth={3}
+ >
+ <span>Clear</span>
+ <Hotkey shortcut="escape" theme="subtle" />
+ </Button>
</div>
- <button
- onClick={props.onAction}
- class="p-1 px-2 flex gap-1 border-edge-muted rounded-xs border items-center size-full hover:bg-hover hover-transition-bg"
- >
- <div class="flex border border-edge-muted text-xxs rounded-xs items-center px-1.5 py-px font-normal">
- <Hotkey token={TOKENS.global.commandMenu} class="space-x-1" />
- </div>
- <span>Actions</span>
- </button>
- <button
- onClick={props.onClose}
- class="p-1 px-2 flex gap-1 border-edge-muted rounded-xs border items-center size-full hover:bg-hover hover-transition-bg"
- >
- <div class="flex border border-edge-muted text-xxs rounded-xs items-center px-1.5 py-px font-normal">
- <Hotkey shortcut="escape" />
- </div>
- <span>Clear</span>
- </button>
</div>
- </div>
+ </Layer>
</ScopedPortal>
);
};
diff --git a/js/app/packages/app/component/command/CommandMenu.tsx b/js/app/packages/app/component/command/CommandMenu.tsx
index 7419fba67c..c86ce59854 100644
--- a/js/app/packages/app/component/command/CommandMenu.tsx
+++ b/js/app/packages/app/component/command/CommandMenu.tsx
@@ -491,8 +491,8 @@ export function CommandMenuInner(props: {
<Show when={isEntityActionMode() || !isInCommandScope()}>
<Panel.Toolbar
class={cn(
- 'bg-surface border-0',
- isEntityActionMode() ? 'px-3 gap-2' : 'px-1.5'
+ 'bg-surface px-1.5 border-0',
+ isEntityActionMode() && 'gap-1.5'
)}
>
<Show
@@ -607,7 +607,7 @@ function EntityActionPreview(props: { entities: EntityData[] }) {
return (
<div
class={cn(
- 'bg-hover border border-edge-muted px-2 py-1 truncate text-xs rounded-xs',
+ 'bg-active border border-edge-muted px-2 py-1 truncate text-xs rounded',
{
'max-w-[50%]': props.entities.length === 2,
}
diff --git a/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx b/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
index 9d37ae5d21..aeecd6f378 100644
--- a/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
+++ b/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
@@ -73,10 +73,10 @@ function ListItem(props: {
id={props.id}
disabled={props.disabled}
class={cn(
- 'flex flex-row w-full justify-between items-center gap-2 py-1.5 px-2 scroll-my-1',
+ 'rounded-md group w-full flex items-center h-10 px-2 gap-2 text-sm font-semibold relative scroll-m-1',
{
- 'bg-hover': props.isSelected && !props.disabled,
- 'opacity-50 cursor-not-allowed': props.disabled,
+ 'bg-active': props.isSelected,
+ 'hover:bg-hover/50': !props.isSelected,
}
)}
onClick={props.onClick}
@@ -299,7 +299,7 @@ function PropertyList(props: {
>
<div
ref={containerRef}
- class="max-h-50 overflow-y-auto overflow-x-hidden scrollbar-hidden p-1"
+ class="max-h-52 overflow-y-auto overflow-x-hidden scrollbar-hidden p-1"
>
<For each={filteredProperties()}>
{(property, index) => (
@@ -331,7 +331,7 @@ function EditingEntityPreview(props: { entities: EntityData[] }) {
return (
<div
class={cn(
- 'bg-hover border border-edge-muted px-2 py-1 truncate text-xs rounded-xs',
+ 'bg-active border border-edge-muted px-2 py-1 truncate text-xs rounded',
{
'max-w-[50%]': props.entities.length === 2,
}
@@ -486,7 +486,7 @@ function SelectPropertyEditor(props: {
const selector = createSelector(props.selectedIndex);
return (
- <div class="p-1 max-h-50 overflow-y-auto overflow-x-hidden scrollbar-hidden">
+ <div class="p-1 max-h-52 overflow-y-auto overflow-x-hidden scrollbar-hidden">
<Show
when={filteredOptions().length > 0}
fallback={
diff --git a/js/app/packages/app/component/side-panel/SidePanel.tsx b/js/app/packages/app/component/side-panel/SidePanel.tsx
index fc4a4eaad5..321452fc4a 100644
--- a/js/app/packages/app/component/side-panel/SidePanel.tsx
+++ b/js/app/packages/app/component/side-panel/SidePanel.tsx
@@ -1,7 +1,7 @@
import { Resize, ResizeZoneContext } from '@core/component/Resize/Resize';
import { TabsInset } from '@core/component/TabsInset';
import { isMobile } from '@core/mobile/isMobile';
-import CaretRight from '@icon/fill/caret-right-fill.svg';
+import CaretRight from '@icon/regular/caret-right.svg';
import { Accordion } from '@kobalte/core/accordion';
import { Panel, Scroll } from '@ui';
import {
@@ -244,8 +244,8 @@ function Section(
>
<Accordion.Header class="group">
<Accordion.Trigger class="px-2 py-3 flex w-full items-center gap-2 text-sm hover:underline">
+ <CaretRight class="size-3 text-ink-muted transition-transform duration-90 group-data-expanded:rotate-90" />
<span>{props.title}</span>
- <CaretRight class="size-2.5 text-ink-extra-muted transition-transform duration-90 group-data-expanded:rotate-90" />
</Accordion.Trigger>
</Accordion.Header>
<Accordion.Content class="group/content overflow-hidden data-expanded:animate-accordion-down data-closed:animate-accordion-up">
diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.css
index bdb15b76bd..e96b7c876f 100644
--- a/js/app/packages/app/index.css
+++ b/js/app/packages/app/index.css
@@ -105,7 +105,7 @@
--color-accent-hover: oklch(var(--a0) / 0.20);
--color-surface: var(--b0);
- --color-drop-shadow: oklch(calc(var(--b0l) - 0.01 ) var(--b0c) var(--b0h) / 0.4);
+ --color-drop-shadow: oklch(calc(var(--b0l) - 0.01 ) var(--b0c) var(--b0h) / 0.2);
--color-message: color-mix(in oklch, var(--b1) 50%, var(--b2));
--color-hover: var(--b2);
--color-active: var(--b1);
diff --git a/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx b/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx
index e5864dfe73..1944fa8484 100644
--- a/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx
+++ b/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx
@@ -139,7 +139,7 @@ function DetailsGrid(props: {
updatedAt: () => DateValue | null | undefined;
}) {
return (
- <div class="grid grid-cols-[auto_1fr] gap-x-2 gap-y-2 items-center text-sm">
+ <div class="grid grid-cols-[auto_1fr] gap-x-2 gap-y-2 items-center text-xs">
<Show when={props.owner()}>
{(ownerId) => (
<DetailsRow label="Owner">
@@ -207,7 +207,7 @@ function FolderLink(props: { projectId: string; projectName: string }) {
function OwnerValue(props: { ownerId: string }) {
const [displayName] = useDisplayName(tryMacroId(props.ownerId));
return (
- <div class="rounded-full flex gap-1 items-center px-1 ring ring-edge-muted">
+ <div class="rounded-full flex gap-1 items-center px-1">
<div class="flex">
<UserIcon id={props.ownerId} size="sm" showTooltip suppressClick />
</div>
@@ -368,42 +368,44 @@ function PropertiesSectionContent(props: {
}
>
<Suspense>
- <PropertiesProvider
- entityType={entityType}
- canEdit={props.canEdit}
- documentName={props.documentName}
- properties={filteredPinnedProperties}
- onRefresh={refetch}
- onPropertyAdded={handlePropertyAdded}
- onPropertyDeleted={handlePropertyDeleted}
- onPropertyPinned={handlePropertyPinned}
- onPropertyUnpinned={handlePropertyUnpinned}
- pinnedPropertyIds={pinnedPropertyIds}
- saveHandler={saveHandler}
- >
- <Show when={isLoading()}>
- <div class="flex items-center justify-center py-8">
- <div class="w-5 h-5 animate-spin">
- <LoadingSpinner />
+ <div class="text-xs">
+ <PropertiesProvider
+ entityType={entityType}
+ canEdit={props.canEdit}
+ documentName={props.documentName}
+ properties={filteredPinnedProperties}
+ onRefresh={refetch}
+ onPropertyAdded={handlePropertyAdded}
+ onPropertyDeleted={handlePropertyDeleted}
+ onPropertyPinned={handlePropertyPinned}
+ onPropertyUnpinned={handlePropertyUnpinned}
+ pinnedPropertyIds={pinnedPropertyIds}
+ saveHandler={saveHandler}
+ >
+ <Show when={isLoading()}>
+ <div class="flex items-center justify-center py-8">
+ <div class="w-5 h-5 animate-spin">
+ <LoadingSpinner />
+ </div>
</div>
- </div>
- </Show>
-
- <Show when={filteredPinnedProperties().length > 0}>
- <PanelContainer
- properties={filteredPinnedProperties}
- isLoading={isLoading}
- error={error}
- />
- </Show>
-
- <Show when={props.canEdit}>
- <div class="py-2">
- <AddPinnedPropertyButton />
- </div>
- </Show>
- <Modals />
- </PropertiesProvider>
+ </Show>
+
+ <Show when={filteredPinnedProperties().length > 0}>
+ <PanelContainer
+ properties={filteredPinnedProperties}
+ isLoading={isLoading}
+ error={error}
+ />
+ </Show>
+
+ <Show when={props.canEdit}>
+ <div class="py-2">
+ <AddPinnedPropertyButton />
+ </div>
+ </Show>
+ <Modals />
+ </PropertiesProvider>
+ </div>
</Suspense>
</Show>
);
@@ -438,7 +440,7 @@ function StatsSectionContent() {
>
{(stats) => (
<Wordcount.Root stats={stats()}>
- <div class="grid grid-cols-[auto_1fr] gap-x-4 gap-y-3 items-center text-sm">
+ <div class="grid grid-cols-[auto_1fr] gap-x-4 gap-y-3 items-center text-xs">
<span class="text-xs text-ink-muted">Words</span>
<div class="flex items-center gap-2 min-w-0">
<Wordcount.Words />
@@ -490,10 +492,12 @@ function NotificationsSectionConditional(props: { entity: Entity }) {
</div>
}
>
- <Notifications
- entity={props.entity}
- notificationSource={notificationSource}
- />
+ <div class="text-xs">
+ <Notifications
+ entity={props.entity}
+ notificationSource={notificationSource}
+ />
+ </div>
</Suspense>
</SidePanel.Section>
</Show>
@@ -544,7 +548,9 @@ function ReferencesSectionConditional(props: { documentId: string }) {
</div>
}
>
- <References documentId={props.documentId} />
+ <div class="text-xs">
+ <References documentId={props.documentId} />
+ </div>
</Suspense>
</SidePanel.Section>
</Show>
diff --git a/js/app/packages/core/component/ForwardToChannel.tsx b/js/app/packages/core/component/ForwardToChannel.tsx
index 95e5740705..a16828be90 100644
--- a/js/app/packages/core/component/ForwardToChannel.tsx
+++ b/js/app/packages/core/component/ForwardToChannel.tsx
@@ -435,7 +435,7 @@ export function ForwardToChannel(props: ForwardToChannelProps) {
<Show when={isAuthenticated()}>
{/* Row 1: Recipient input + ShareOptions */}
<div class="flex items-center">
- <div class="min-w-0 flex-1 px-1 py-2 min-h-11">
+ <div class="min-w-0 flex-1 px-1 min-h-11">
<RecipientSelector<'user' | 'contact' | 'channel'>
placeholder="To: Email or group"
setSelectedOptions={setSelectedOptions}
@@ -443,9 +443,9 @@ export function ForwardToChannel(props: ForwardToChannelProps) {
triedToSubmit={triedToSubmit}
options={destinationOptions}
triggerMode="input"
- class="border border-edge-muted p-1"
focusOnMount
horizontalScroll
+ hideBorder
/>
</div>
<Show
@@ -454,9 +454,9 @@ export function ForwardToChannel(props: ForwardToChannelProps) {
Permissions.OWNER && !props.hideAccessLevelSelector
}
>
- <div class="shrink-0 pr-2 flex items-center">
+ <div class="shrink-0 pr-2 flex items-center gap-2">
<Show when={selectedOptions().length > 0}>
- <span class="text-sm text-ink-muted pr-2">can</span>
+ <span class="text-sm text-ink-extra-muted">can</span>
</Show>
<ShareOptions
setPermissions={(accessLevel) =>
diff --git a/js/app/packages/core/component/RecipientSelector.tsx b/js/app/packages/core/component/RecipientSelector.tsx
index 9ce83ae41d..1179665f08 100644
--- a/js/app/packages/core/component/RecipientSelector.tsx
+++ b/js/app/packages/core/component/RecipientSelector.tsx
@@ -28,7 +28,7 @@ import {
useComboboxContext,
} from '@kobalte/core/combobox';
import { debounce } from '@solid-primitives/scheduled';
-import { cn } from '@ui';
+import { cn, Layer } from '@ui';
import * as EmailValidator from 'email-validator';
import {
type Accessor,
@@ -71,7 +71,7 @@ function RecipientChip(props: {
}) {
return (
<div
- class="flex flex-row shrink-0 py-1 pl-2 gap-1 pr-0.5 overflow-hidden items-center bg-hover"
+ class="flex flex-row shrink-0 py-1 pl-2 gap-1 pr-1 overflow-hidden items-center bg-active rounded-full"
classList={{ 'cursor-grab active:cursor-grabbing': props.draggable }}
draggable={props.draggable}
onDragStart={props.onDragStart}
@@ -80,7 +80,7 @@ function RecipientChip(props: {
<Show when={props.icon}>{props.icon}</Show>
<p class="text-sm whitespace-nowrap">{truncateString(props.label, 20)}</p>
<XIcon
- class="size-5 hover:bg-hover hover-transition-bg p-1"
+ class="size-5 hover:bg-hover hover:text-failure p-1 rounded-full"
onClick={props.onRemove}
/>
</div>
@@ -180,8 +180,8 @@ function RecipientComboboxItem(props: RecipientComboboxItemProps): JSX.Element {
<Combobox.Item
item={props}
class={cn(
- 'flex flex-row px-2 py-1 mb-1 justify-between items-center data-highlighted:bg-hover hover-transition-bg',
- props.disabled && 'hover:bg-hover hover-transition-bg'
+ 'flex flex-row p-2 mb-1 rounded-md justify-between items-center data-highlighted:bg-hover',
+ props.disabled && 'hover:bg-hover'
)}
onMouseEnter={props.disabled ? handleMouseEnter : undefined}
onMouseLeave={props.disabled ? handleMouseLeave : undefined}
@@ -263,6 +263,7 @@ type RecipientSelectorProps<K extends CombinedRecipientKind> = {
onChipDragEnd?: (e: DragEvent) => void;
horizontalScroll?: boolean;
class?: string;
+ depth?: 0 | 1 | 2 | 3 | 4 | 5;
};
export function RecipientSelector<K extends CombinedRecipientKind>(
@@ -474,264 +475,270 @@ export function RecipientSelector<K extends CombinedRecipientKind>(
};
return (
- <Combobox<CombinedRecipientItem>
- multiple
- virtualized
- triggerMode={props.triggerMode ?? 'input'}
- closeOnSelection={true}
- open={isOpen()}
- onOpenChange={setIsOpen}
- disabled={props.disabled}
- validationState={invalid() ? 'invalid' : 'valid'}
- options={options() as CombinedRecipientItem[]}
- optionLabel={getRecipientOptionLabel}
- optionValue={getRecipientOptionValue}
- optionTextValue={getRecipientOptionTextValue}
- optionDisabled={getOptionDisabled}
- value={props.selectedOptions as CombinedRecipientItem[]}
- onChange={debouncedHandleChange}
- onInputChange={onInputChange}
- shouldFocusWrap
- placeholder={
- props.selectedOptions?.length === 0
- ? (props.placeholder ?? placeholderText())
- : undefined
- }
- class={cn(
- 'ph-no-capture w-full text-sm offset-2 bg-surface focus-within:bg-active',
- !props.hideBorder && 'border border-edge',
- !props.noPadding && 'py-2',
- props.class
- )}
- >
- <Combobox.Control<CombinedRecipientItem>>
- {(state) => {
- const context = useComboboxContext();
- const [chipsScrollRef, setChipsScrollRef] =
- createSignal<HTMLElement>();
- return (
- <div class="relative">
- <div
- ref={props.horizontalScroll ? setChipsScrollRef : undefined}
- class={cn(
- 'flex gap-1.5 text-ink scrollbar-hidden',
- props.horizontalScroll
- ? 'flex-nowrap overflow-x-auto sm:flex-wrap sm:overflow-x-hidden sm:max-h-37.5 sm:overflow-y-auto pb-0.5 sm:pb-0'
- : 'flex-wrap max-h-37.5 overflow-y-auto'
- )}
+ <Layer depth={props.depth ?? 2}>
+ <Combobox<CombinedRecipientItem>
+ multiple
+ virtualized
+ triggerMode={props.triggerMode ?? 'input'}
+ closeOnSelection={true}
+ open={isOpen()}
+ onOpenChange={setIsOpen}
+ disabled={props.disabled}
+ validationState={invalid() ? 'invalid' : 'valid'}
+ options={options() as CombinedRecipientItem[]}
+ optionLabel={getRecipientOptionLabel}
+ optionValue={getRecipientOptionValue}
+ optionTextValue={getRecipientOptionTextValue}
+ optionDisabled={getOptionDisabled}
+ value={props.selectedOptions as CombinedRecipientItem[]}
+ onChange={debouncedHandleChange}
+ onInputChange={onInputChange}
+ shouldFocusWrap
+ placeholder={
+ props.selectedOptions?.length === 0
+ ? (props.placeholder ?? placeholderText())
+ : undefined
+ }
+ class={cn(
+ 'ph-no-capture w-full text-sm offset-2 bg-surface rounded-xl',
+ !props.hideBorder && 'border border-edge',
+ !props.noPadding && 'p-2',
+ props.class
+ )}
+ >
+ <Combobox.Control<CombinedRecipientItem>>
+ {(state) => {
+ const context = useComboboxContext();
+ const [chipsScrollRef, setChipsScrollRef] =
+ createSignal<HTMLElement>();
+ return (
+ <div class="relative">
+ <div
+ ref={props.horizontalScroll ? setChipsScrollRef : undefined}
+ class={cn(
+ 'flex gap-1.5 text-ink scrollbar-hidden',
+ props.horizontalScroll
+ ? 'flex-nowrap overflow-x-auto sm:flex-wrap sm:overflow-x-hidden sm:max-h-37.5 sm:overflow-y-auto pb-0.5 sm:pb-0'
+ : 'flex-wrap max-h-37.5 overflow-y-auto'
+ )}
+ >
+ <For each={state.selectedOptions()}>
+ {(option) => {
+ return (
+ <Switch>
+ <Match
+ when={matches(
+ option,
+ (o) => o.kind === 'user' || o.kind === 'contact'
+ )}
+ >
+ {(userOrContactOption) => {
+ const opt = userOrContactOption();
+ const name = getRecipientOptionName(opt);
+ const email = getRecipientOptionEmail(opt);
+
+ const displayText = () => name || email;
+
+ return (
+ <ChipWithUserTooltip
+ chip={
+ <RecipientChip
+ icon={
+ <UserIcon
+ id={opt.id}
+ size="sm"
+ isDeleted={false}
+ showTooltip={false}
+ />
+ }
+ label={displayText() ?? ''}
+ onRemove={() => state.remove(option)}
+ draggable={!!props.onChipDragStart}
+ onDragStart={(e) =>
+ props.onChipDragStart?.(
+ option as WithCustomUserInput<K>,
+ e
+ )
+ }
+ onDragEnd={props.onChipDragEnd}
+ />
+ }
+ renderTooltip={(close) => (
+ <UserTooltip
+ displayName={name || ''}
+ email={email}
+ id={opt.id}
+ isDeleted={false}
+ onClose={close}
+ />
+ )}
+ />
+ );
+ }}
+ </Match>
+ <Match
+ when={matches(option, (o) => o.kind === 'channel')}
+ >
+ {(channelOption) => {
+ return (
+ <RecipientChip
+ icon={<HashIcon class="size-4" />}
+ label={
+ channelOption().data.name ??
+ channelOption().id
+ }
+ onRemove={() => state.remove(option)}
+ />
+ );
+ }}
+ </Match>
+ <Match
+ when={matches(option, (o) => o.kind === 'custom')}
+ >
+ {(customOption) => {
+ const email = customOption().data.email;
+
+ return (
+ <ChipWithUserTooltip
+ chip={
+ <RecipientChip
+ icon={
+ <UserIcon
+ id={email}
+ size="sm"
+ isDeleted={false}
+ showTooltip={false}
+ />
+ }
+ label={email}
+ onRemove={() => state.remove(option)}
+ draggable={!!props.onChipDragStart}
+ onDragStart={(e) =>
+ props.onChipDragStart?.(
+ option as WithCustomUserInput<K>,
+ e
+ )
+ }
+ onDragEnd={props.onChipDragEnd}
+ />
+ }
+ renderTooltip={(close) => (
+ <UserTooltip
+ displayName={email}
+ email={email}
+ isDeleted={false}
+ onClose={close}
+ />
+ )}
+ />
+ );
+ }}
+ </Match>
+ </Switch>
+ );
+ }}
+ </For>
+ <Combobox.Input
+ disabled={disabled()}
+ ref={(el) => {
+ setInputRef(el);
+ props.inputRef?.(el);
+ }}
+ class="flex-1 min-h-7 p-1 min-w-50 outline-none placeholder:text-ink-placeholder"
+ classList={{ 'ml-1': selectedLen() === 0 }}
+ onKeyDown={(e) => {
+ if (
+ (e.key === 'a' && e.ctrlKey) ||
+ (e.key === 'a' && e.metaKey)
+ ) {
+ setDisabled(true);
+ queueMicrotask(() => setDisabled(false));
+ }
+ if (e.key === 'Escape') {
+ if (inputValue().length === 0) {
+ inputRef()?.blur();
+ }
+ }
+ }}
+ // use a non-delegated event here so that we can process it before Kobalte
+ on:keydown={(e: KeyboardEvent) => {
+ if (e.key === 'Tab' && context.isOpen()) {
+ e.preventDefault();
+ e.stopPropagation();
+ inputRef()?.dispatchEvent(
+ // We need to send `bubbles: true` because otherwise Kobalte ignores the event
+ new KeyboardEvent('keydown', {
+ bubbles: true,
+ key: 'Enter',
+ })
+ );
+ }
+ }}
+ />
+ </div>
+ <Show when={props.horizontalScroll}>
+ <CustomScrollbar
+ scrollContainer={chipsScrollRef}
+ horizontal
+ class="sm:hidden"
+ />
+ </Show>
+ </div>
+ );
+ }}
+ </Combobox.Control>
+
+ <Combobox.Portal>
+ <Layer depth={2}>
+ <Combobox.Content class="z-modal-content bg-surface translate-y-1 border-edge p-1 rounded-lg shadow-lg shadow-drop-shadow ring ring-edge">
+ <Combobox.Listbox
+ ref={setListboxRef}
+ class="flex flex-col gap-1"
+ scrollToItem={scrollToItem()}
+ autoFocus="first"
>
- <For each={state.selectedOptions()}>
- {(option) => {
- return (
- <Switch>
- <Match
- when={matches(
- option,
- (o) => o.kind === 'user' || o.kind === 'contact'
- )}
- >
- {(userOrContactOption) => {
- const opt = userOrContactOption();
- const name = getRecipientOptionName(opt);
- const email = getRecipientOptionEmail(opt);
-
- const displayText = () => name || email;
-
- return (
- <ChipWithUserTooltip
- chip={
- <RecipientChip
- icon={
- <UserIcon
- id={opt.id}
- size="sm"
- isDeleted={false}
- showTooltip={false}
- />
- }
- label={displayText() ?? ''}
- onRemove={() => state.remove(option)}
- draggable={!!props.onChipDragStart}
- onDragStart={(e) =>
- props.onChipDragStart?.(
- option as WithCustomUserInput<K>,
- e
- )
- }
- onDragEnd={props.onChipDragEnd}
- />
- }
- renderTooltip={(close) => (
- <UserTooltip
- displayName={name || ''}
- email={email}
- id={opt.id}
- isDeleted={false}
- onClose={close}
- />
- )}
- />
- );
- }}
- </Match>
- <Match
- when={matches(option, (o) => o.kind === 'channel')}
- >
- {(channelOption) => {
- return (
- <RecipientChip
- icon={<HashIcon class="size-4" />}
- label={
- channelOption().data.name ??
- channelOption().id
- }
- onRemove={() => state.remove(option)}
- />
- );
- }}
- </Match>
- <Match
- when={matches(option, (o) => o.kind === 'custom')}
- >
- {(customOption) => {
- const email = customOption().data.email;
-
- return (
- <ChipWithUserTooltip
- chip={
- <RecipientChip
- icon={
- <UserIcon
- id={email}
- size="sm"
- isDeleted={false}
- showTooltip={false}
- />
- }
- label={email}
- onRemove={() => state.remove(option)}
- draggable={!!props.onChipDragStart}
- onDragStart={(e) =>
- props.onChipDragStart?.(
- option as WithCustomUserInput<K>,
- e
- )
- }
- onDragEnd={props.onChipDragEnd}
- />
- }
- renderTooltip={(close) => (
- <UserTooltip
- displayName={email}
- email={email}
- isDeleted={false}
- onClose={close}
- />
- )}
- />
- );
- }}
- </Match>
- </Switch>
- );
- }}
- </For>
- <Combobox.Input
- disabled={disabled()}
- ref={(el) => {
- setInputRef(el);
- props.inputRef?.(el);
- }}
- class="flex-1 min-h-7 p-1 min-w-50 outline-none placeholder:text-ink-placeholder"
- classList={{ 'ml-1': selectedLen() === 0 }}
- onKeyDown={(e) => {
- if (
- (e.key === 'a' && e.ctrlKey) ||
- (e.key === 'a' && e.metaKey)
- ) {
- setDisabled(true);
- queueMicrotask(() => setDisabled(false));
- }
- if (e.key === 'Escape') {
- if (inputValue().length === 0) {
- inputRef()?.blur();
+ {(items) => {
+ const arr = Array.from(items());
+ const count = arr.length;
+ const height = clamp(count, 0, 6) * 36;
+
+ const [handle, setHandle] =
+ createSignal<VirtualizerHandle | null>(null);
+
+ setScrollToItem(() => (key: string) => {
+ const virtualizerHandle = handle();
+ if (virtualizerHandle) {
+ const ndx = arr.findIndex((item) => item.key === key);
+ if (ndx > -1) {
+ virtualizerHandle.scrollToIndex(ndx, {
+ align: 'nearest',
+ });
}
}
- }}
- // use a non-delegated event here so that we can process it before Kobalte
- on:keydown={(e: KeyboardEvent) => {
- if (e.key === 'Tab' && context.isOpen()) {
- e.preventDefault();
- e.stopPropagation();
- inputRef()?.dispatchEvent(
- // We need to send `bubbles: true` because otherwise Kobalte ignores the event
- new KeyboardEvent('keydown', {
- bubbles: true,
- key: 'Enter',
- })
- );
- }
- }}
- />
- </div>
- <Show when={props.horizontalScroll}>
- <CustomScrollbar
- scrollContainer={chipsScrollRef}
- horizontal
- class="sm:hidden"
- />
- </Show>
- </div>
- );
- }}
- </Combobox.Control>
-
- <Combobox.Portal>
- <Combobox.Content class="z-modal-content bg-surface border translate-y-1 border-edge p-1">
- <Combobox.Listbox
- ref={setListboxRef}
- class="flex flex-col gap-1"
- scrollToItem={scrollToItem()}
- autoFocus="first"
- >
- {(items) => {
- const arr = Array.from(items());
- const count = arr.length;
- const height = clamp(count, 0, 6) * 36;
-
- const [handle, setHandle] =
- createSignal<VirtualizerHandle | null>(null);
-
- setScrollToItem(() => (key: string) => {
- const virtualizerHandle = handle();
- if (virtualizerHandle) {
- const ndx = arr.findIndex((item) => item.key === key);
- if (ndx > -1) {
- virtualizerHandle.scrollToIndex(ndx, { align: 'nearest' });
- }
- }
- });
-
- return (
- <VList
- data={arr}
- style={{
- height: `${height}px`,
- }}
- ref={setHandle}
- >
- {(item) => {
- return <RecipientComboboxItem {...item} />;
- }}
- </VList>
- );
- }}
- </Combobox.Listbox>
- </Combobox.Content>
- </Combobox.Portal>
- <Combobox.ErrorMessage class="text-xs text-failure mt-1">
- *At least one participant is required
- </Combobox.ErrorMessage>
- </Combobox>
+ });
+
+ return (
+ <VList
+ data={arr}
+ style={{
+ height: `${height}px`,
+ }}
+ ref={setHandle}
+ >
+ {(item) => {
+ return <RecipientComboboxItem {...item} />;
+ }}
+ </VList>
+ );
+ }}
+ </Combobox.Listbox>
+ </Combobox.Content>
+ </Layer>
+ </Combobox.Portal>
+ <Combobox.ErrorMessage class="text-xs text-failure mt-1">
+ *At least one participant is required
+ </Combobox.ErrorMessage>
+ </Combobox>
+ </Layer>
);
}
diff --git a/js/app/packages/core/component/TopBar/ShareButton.tsx b/js/app/packages/core/component/TopBar/ShareButton.tsx
index 56382020c1..1650e80bcc 100644
--- a/js/app/packages/core/component/TopBar/ShareButton.tsx
+++ b/js/app/packages/core/component/TopBar/ShareButton.tsx
@@ -945,7 +945,7 @@ export function ShareModal(props: ShareModalProps) {
style={{ width: '800px' }}
>
{/* Card 1: Share form — gradient border */}
- <Panel active>
+ <Panel active depth={2}>
<Panel.Header class="px-3">
<Dialog.Title class="flex items-center gap-1.5 min-w-0 overflow-hidden whitespace-nowrap w-full text-sm font-medium">
<span class="shrink-0">Share:</span>
@@ -981,7 +981,7 @@ export function ShareModal(props: ShareModalProps) {
{/* Card 2: Recipients — plain border */}
<Show when={(recipients()?.length ?? 0) > 0 || !!props.owner}>
- <Panel>
+ <Panel depth={2}>
<Panel.Header class="px-3">
<span class="text-sm font-medium">
People with access to this{' '}
@@ -1115,7 +1115,7 @@ export function ShareModal(props: ShareModalProps) {
props.itemType !== 'email'
}
>
- <Panel>
+ <Panel depth={2}>
<Panel.Header class="justify-between px-3">
<div class="flex items-center gap-2">
<span class="text-sm font-medium">Public link</span>
@@ -1408,7 +1408,7 @@ export function ShareOptions(props: {
<Button
disabled={props.disabled}
class={`min-w-16.75 py-1 pl-2 pr-1 rounded-xs flex items-center gap-1 ${props.noBorder ? 'border-0 sm:border' : ''}`}
- variant="base"
+ variant="ghost"
>
{currentValueText()}
<ChevronDownIcon class="size-4 text-ink-extra-muted/50" />