Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(style): make empty states more descriptive and useful (#3627)
Aidan Holloway-Bidwell1fe5cf5c305d
diff --git a/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts b/js/app/packages/app/component/app-sidebar/soup-filter-presets.tsindex 3c2c92b83d..d1f81348b1 100644--- a/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts+++ b/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts@@ -6,7 +6,7 @@ import {} from '@app/component/next-soup/filters/filter-store';import type { ListView } from '@app/constants/list-views';import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';-import { subWeeks } from 'date-fns';+import { startOfDay, subWeeks } from 'date-fns';type SoupFiltersPreset = {/** Filter data for server query */@@ -38,7 +38,7 @@ type ViewTabConfig = {/** Filters for inbox/signal: not done, importance=true for emails, 2-week window */const getInboxSignalFilters = () => {- const twoWeeksAgo = subWeeks(new Date(), 2).toISOString();+ const twoWeeksAgo = subWeeks(startOfDay(new Date()), 2).toISOString();return defineQueryFilters({include: {documentDone: false,diff --git a/js/app/packages/app/component/next-soup/soup-view/FolderDropZone.tsx b/js/app/packages/app/component/next-soup/soup-view/FolderDropZone.tsxnew file mode 100644index 0000000000..97d303ad1f--- /dev/null+++ b/js/app/packages/app/component/next-soup/soup-view/FolderDropZone.tsx@@ -0,0 +1,58 @@+import { useHandleFileUpload } from '@app/util/handleFileUpload';+import { useMaybeBlockId, useMaybeBlockName } from '@core/block';+import { fileSelector } from '@core/directive/fileSelector';+import { folderSelector } from '@core/directive/folderSelector';+import { isMobile } from '@core/mobile/isMobile';+import { handleFolderSelect } from '@core/util/upload';+import { createMemo, Show } from 'solid-js';++false && fileSelector;+false && folderSelector;++export function FolderDropZone() {+ const blockName = useMaybeBlockName();+ const blockId = useMaybeBlockId();+ const projectId = createMemo(() => {+ if (blockName === 'project' && blockId) {+ return blockId;+ }+ return undefined;+ });++ const handleFileUpload = useHandleFileUpload({ projectId: projectId() });++ return (+ <Show when={!isMobile()}>+ <div class="drop-zone flex w-full flex-col items-center justify-center rounded-md border border-dashed border-edge-muted bg-hover py-8">+ <p class="text-ink-muted">Drag & drop files and folders here</p>+ <p class="text-ink-muted">+ or{' '}+ <button+ type="button"+ use:fileSelector={{+ multiple: true,+ onSelect: (files) => {+ handleFileUpload(files);+ },+ }}+ class="cursor-pointer border-0 bg-transparent p-0 font-inherit text-inherit underline"+ >+ Upload files+ </button>{' '}+ /{' '}+ <button+ type="button"+ use:folderSelector={{+ onSelect: async (files) => {+ await handleFolderSelect(files, handleFileUpload);+ },+ }}+ class="cursor-pointer border-0 bg-transparent p-0 font-inherit text-inherit underline"+ >+ Upload folders+ </button>+ </p>+ </div>+ </Show>+ );+}diff --git a/js/app/packages/app/component/next-soup/soup-view/empty-states.tsx b/js/app/packages/app/component/next-soup/soup-view/empty-states.tsxindex c4e913144d..bc56c6f3f2 100644--- a/js/app/packages/app/component/next-soup/soup-view/empty-states.tsx+++ b/js/app/packages/app/component/next-soup/soup-view/empty-states.tsx@@ -1,202 +1,200 @@+import { runCreateAction } from '@app/component/Launcher';import type { ListView } from '@app/constants/list-views';-import { useHandleFileUpload } from '@app/util/handleFileUpload';-import { useMaybeBlockId, useMaybeBlockName } from '@core/block';+import type { BlockAlias, BlockName } from '@core/block';import { McpSetupCards } from '@core/component/AI/component/McpSetupCards';-import { fileSelector } from '@core/directive/fileSelector';-import { folderSelector } from '@core/directive/folderSelector';-import { useEmailLinksStatus } from '@core/email-link';-import { isMobile } from '@core/mobile/isMobile';-import type { ViewId } from '@core/types/view';-import { handleFolderSelect } from '@core/util/upload';+import { toast } from '@core/component/Toast/Toast';+import { useEmailLinks, useEmailLinksStatus } from '@core/email-link';import Arcanum01 from '@design/arcanum-01.svg';-import Arcanum02 from '@design/arcanum-02.svg';-import Arcanum04 from '@design/arcanum-04.svg';-import Arcanum05 from '@design/arcanum-05.svg';-import Arcanum06 from '@design/arcanum-06.svg';-import Arcanum07 from '@design/arcanum-07.svg';-import Arcanum09 from '@design/arcanum-09.svg';-import { createMemo, Match, Show, Switch } from 'solid-js';+import EmptyStateDoneIcon from '@design/empty-state-done.svg';+import EmptyStateEmailIcon from '@design/empty-state-email.svg';+import EmptyStateFolderIcon from '@design/empty-state-folder.svg';+import EmptyStateInboxZeroIcon from '@design/empty-state-inbox-zero.svg';+import EmptyStateNoFilterMatchIcon from '@design/empty-state-no-filter-match.svg';+import EmptyStateNoSearchMatchIcon from '@design/empty-state-no-search-match.svg';+import { EmptyStatePanel, FilteredHiddenBanner } from '@ui';+import { Match, Switch } from 'solid-js';+import { FolderDropZone } from './FolderDropZone';import { useSoupView } from './soup-view-context';-false && fileSelector;-false && folderSelector;--const DEFAULT_EMPTY_MESSAGE = 'No items to show.';--function getRandomArcanumGraphic(- className = 'h-72 m-8 mt-32 @max-sm:mt-20 opacity-60'-) {- const arcanumComponents = [- Arcanum01,- Arcanum02,- Arcanum04,- Arcanum05,- Arcanum06,- Arcanum07,- Arcanum09,- ];- const RandomGraphic =- arcanumComponents[Math.floor(Math.random() * arcanumComponents.length)];- return <RandomGraphic class={className} />;+type FallbackContent = {+ plural: string;+ create?: { label: string; blockName: BlockName | BlockAlias };+};++const FALLBACK_CONTENT: Partial<Record<ListView, FallbackContent>> = {+ documents: {+ plural: 'documents',+ create: { label: 'Create document', blockName: 'md' },+ },+ channels: {+ plural: 'channels',+ create: { label: 'Create channel', blockName: 'channel' },+ },+ calls: { plural: 'calls' },+ search: { plural: 'items' },+};++function InboxZeroNumber(props: { class?: string }) {+ return (+ <div+ class={`flex items-center justify-center font-mono text-[9rem] font-thin leading-none text-ink-muted opacity-50 ${props.class ?? ''}`}+ >+ 0+ </div>+ );}export function EmptyState(props: {- viewId?: ViewId;listView?: ListView;search?: boolean;hasRefinementsFromBase?: boolean;onClearFilters?: () => void;}) {const emailActive = useEmailLinksStatus();+ const { connect } = useEmailLinks();+ const soup = useSoupView();++ const onConnectEmail = () => {+ connect().match(+ () => {},+ () => toast.failure('Failed to connect email')+ );+ };return (<Switch><Match when={props.search}>- <EmptyStateInner message={'No results.'} />- </Match>- <Match when={props.hasRefinementsFromBase}>- <EmptyStateInner- message="No items match your filters."- cta={- props.onClearFilters- ? { label: 'Clear filters', onClick: props.onClearFilters }- : undefined+ <EmptyStatePanel+ align="center"+ graphic={EmptyStateNoSearchMatchIcon}+ title={+ soup.searchText().trim().length > 0+ ? `No results for "${soup.searchText()}"`+ : 'No results'}/></Match>- <Match- when={- props.listView === 'agents' &&- useSoupView().activeTab() === 'automations'- }- >- <EmptyStateInner message="No automations to show." />- </Match>- <Match when={props.listView === 'agents'}>- <AgentsEmptyState />- </Match>- <Match when={props.viewId === 'noise' && !emailActive()}>- <EmptyStateInner message={'Email not connected.'} />++ <Match when={props.hasRefinementsFromBase}>+ <EmptyStatePanel+ align="center"+ graphic={EmptyStateNoFilterMatchIcon}+ title="No items matching the filters"+ >+ {props.onClearFilters && (+ <FilteredHiddenBanner onClearFilters={props.onClearFilters} />+ )}+ </EmptyStatePanel></Match>+<Matchwhen={- (props.viewId === 'noise' ||- props.viewId === 'signal' ||- props.viewId === 'email') &&- emailActive()+ (props.listView === 'inbox' || props.listView === 'mail') &&+ !emailActive()}>- <EmptyStateInner message={'Inbox zero.'} />+ <EmptyStatePanel+ graphic={EmptyStateEmailIcon}+ title="Connect your email"+ description="Bring your inbox into Macro to triage signal from noise, reply faster, and let agents work alongside your mail."+ primaryAction={{+ label: 'Connect email',+ onClick: onConnectEmail,+ }}+ /></Match>- <Match when={props.viewId === 'signal' && !emailActive()}>- <EmptyStateInner message={'Nothing to show. Email not connected.'} />++ <Match when={props.listView === 'inbox' && emailActive()}>+ <EmptyStatePanel+ align="center"+ graphic={InboxZeroNumber}+ title="Inbox zero"+ description="You're all caught up. Important items will appear here as they arrive."+ /></Match>- <Match when={props.viewId === 'email' && !emailActive()}>- <EmptyStateInner message={'Nothing to show. Email not connected.'} />++ <Match when={props.listView === 'mail' && emailActive()}>+ <EmptyStatePanel+ align="center"+ graphic={InboxZeroNumber}+ title="Inbox zero"+ description="You're all caught up. New email will appear here as it arrives."+ /></Match>- <Match when={props.viewId === 'people'}>- <EmptyStateInner message={'No messages to show.'} />++ <Match when={props.listView === 'tasks'}>+ <EmptyStatePanel+ align="center"+ graphic={EmptyStateDoneIcon}+ graphicClass="opacity-50"+ title="Nothing to do"+ description="Tasks you create or that get assigned to you will show up here."+ /></Match>- <Match when={props.viewId === 'folders'}>- <EmptyStateInner message={'No folders to show.'} showDropZone />++ <Match+ when={props.listView === 'agents' && soup.activeTab() === 'automations'}+ >+ <EmptyStatePanel+ align="center"+ graphic={EmptyStateInboxZeroIcon}+ title="No automations to show"+ primaryAction={{+ label: 'Create automation',+ onClick: () => runCreateAction('automation'),+ }}+ /></Match>- <Match when={props.viewId === 'tasks'}>- <EmptyStateInner message={'No tasks to show.'} />++ <Match when={props.listView === 'agents'}>+ <AgentsEmptyState /></Match>- <Match when={props.viewId === 'all'}>- <EmptyStateInner />++ <Match when={props.listView === 'folders'}>+ <EmptyStatePanel+ graphic={EmptyStateFolderIcon}+ title="No folders"+ description="Create a folder or drop files below to get started."+ >+ <FolderDropZone />+ </EmptyStatePanel></Match>+<Match when={true}>- <EmptyStateInner />+ {(() => {+ const fallback = (props.listView &&+ FALLBACK_CONTENT[props.listView]) ?? {+ plural: 'items',+ };+ return (+ <EmptyStatePanel+ align="center"+ graphic={EmptyStateInboxZeroIcon}+ title={`No ${fallback.plural} to show`}+ primaryAction={+ fallback.create+ ? {+ label: fallback.create.label,+ onClick: () =>+ runCreateAction(fallback.create!.blockName),+ }+ : undefined+ }+ />+ );+ })()}</Match></Switch>);}-interface EmptyStateInnerProps {- message?: string;- showDropZone?: boolean;- cta?: {- label: string;- onClick: () => void;- };-}--function EmptyStateInner(props: EmptyStateInnerProps) {- const blockName = useMaybeBlockName();- const blockId = useMaybeBlockId();- const projectId = createMemo(() => {- if (blockName === 'project' && blockId) {- return blockId;- }- return undefined;- });-- const handleFileUpload = useHandleFileUpload({ projectId: projectId() });-- return (- <div- class="size-full flex items-center justify-center p-4 text-ink-muted"- data-soup-empty-state- >- <div class="panel w-full flex flex-col items-center size-full">- {getRandomArcanumGraphic()}- <p class="text-ink-muted font-mono">- {props.message ?? DEFAULT_EMPTY_MESSAGE}- </p>- <Show when={props.cta}>- {(cta) => (- <div class="w-full flex justify-center pt-4">- <button- onMouseDown={cta().onClick}- class="py-2 px-4 rounded-md bg-accent/15 text-accent hover:bg-accent/25 transition-colors"- >- <span class="font-medium text-sm">{cta().label}</span>- </button>- </div>- )}- </Show>- <Show when={props.showDropZone && !isMobile()}>- <div class="drop-zone flex flex-col items-center justify-center w-full py-8 border border-dashed border-edge-muted bg-hover">- <p class="text-ink-muted">Drag & drop files and folders here</p>- <p class="text-ink-muted">- or{' '}- <span- use:fileSelector={{- multiple: true,- onSelect: (files) => {- handleFileUpload(files);- },- }}- class="underline"- >- Upload files- </span>{' '}- /{' '}- <span- use:folderSelector={{- onSelect: async (files) => {- await handleFolderSelect(files, handleFileUpload);- },- }}- class="underline"- >- Upload folders- </span>- </p>- <p class="text-ink-muted"></p>- </div>- </Show>- </div>- </div>- );-}-function AgentsEmptyState() {return (<div class="size-full relative overflow-hidden" data-soup-empty-state><div class="absolute inset-0 flex flex-col items-center pointer-events-none p-4">- {getRandomArcanumGraphic('h-72 m-8 mt-32 @max-sm:mt-20 opacity-5')}+ <div class="h-72 m-8 mt-32 @max-sm:mt-20 opacity-5 text-ink-muted">+ <Arcanum01 class="size-full" />+ </div></div><div class="relative size-full flex flex-col items-center overflow-y-auto p-4"><div class="w-full max-w-2xl mt-32 @max-sm:mt-20 px-4 pb-8 flex flex-col gap-4">diff --git a/js/app/packages/design/empty-state-done.svg b/js/app/packages/design/empty-state-done.svgnew file mode 100644index 0000000000..22b886f608--- /dev/null+++ b/js/app/packages/design/empty-state-done.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="100%" height="100%" fill="none" stroke="currentColor" stroke-width="0.5"><g transform="translate(14.75 14.75)"><circle cx="10.25" cy="10.25" r="10" stroke-miterlimit="10"/><polyline points="16.15 7.07 8.44 14.79 4.32 10.67" stroke-linecap="round" stroke-linejoin="round"/></g></svg>diff --git a/js/app/packages/design/empty-state-email.svg b/js/app/packages/design/empty-state-email.svgnew file mode 100644index 0000000000..f796c68f97--- /dev/null+++ b/js/app/packages/design/empty-state-email.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="100%" height="100%" fill="none" stroke="currentColor" stroke-width="0.5"><g transform="translate(0 12.1)"><g opacity="0.5"><path d="M37.54,10.53c.34.33.56.69.66,1.05" stroke-linecap="round" stroke-linejoin="round"/><path d="M37.25,13.58s-.07.05-.11.07l-19.05,11c-1.67.97-4.6.85-6.53-.27l-9.45-5.46c-.72-.42-1.2-.91-1.44-1.42" stroke-dasharray="2.39 2.39" stroke-linecap="round" stroke-linejoin="round"/><path d="M.57,16.34c.11-.36.36-.69.75-.98" stroke-linecap="round" stroke-linejoin="round"/></g><path d="M37.14,10.65l-19.05,11c-1.67.97-4.6.85-6.53-.27L2.1,15.92c-1.93-1.12-2.14-2.81-.47-3.77L20.68,1.15c1.67-.97,4.6-.85,6.53.27l9.45,5.46c1.93,1.12,2.14,2.81.47,3.77Z" stroke-linejoin="round"/><path d="M.5,13.87l17.52-1.02c2.05-.11,3.67-1.05,3.87-2.23L23.71.15" stroke-miterlimit="10"/></g></svg>diff --git a/js/app/packages/design/empty-state-folder.svg b/js/app/packages/design/empty-state-folder.svgnew file mode 100644index 0000000000..f8032c40a3--- /dev/null+++ b/js/app/packages/design/empty-state-folder.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="100%" height="100%" fill="none" stroke="currentColor" stroke-width="0.5"><g transform="translate(0 15.25)" opacity="0.5"><path d="M.25,16.25V3.25C.25,1.59,1.59.25,3.25.25h9l2.5,2.75h11.5c1.66,0,3,1.34,3,3v10.24c0,1.66-1.34,3-3,3H3.25c-1.66,0-3-1.34-3-3Z" stroke-dasharray="2.5" stroke-linecap="round" stroke-linejoin="round"/></g></svg>diff --git a/js/app/packages/design/empty-state-inbox-zero.svg b/js/app/packages/design/empty-state-inbox-zero.svgnew file mode 100644index 0000000000..823818e20d--- /dev/null+++ b/js/app/packages/design/empty-state-inbox-zero.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="100%" height="100%" fill="none" stroke="currentColor" stroke-width="0.5"><g transform="translate(5.615 13.6)" opacity="0.5"><path d="M37.14,10.65l-19.05,11c-1.67.97-4.6.85-6.53-.27L2.1,15.92c-1.93-1.12-2.14-2.81-.47-3.77L20.68,1.15c1.67-.97,4.6-.85,6.53.27l9.45,5.46c1.93,1.12,2.14,2.81.47,3.77Z" stroke-dasharray="2.48 2.48" stroke-linecap="round" stroke-linejoin="round"/></g></svg>diff --git a/js/app/packages/design/empty-state-no-filter-match.svg b/js/app/packages/design/empty-state-no-filter-match.svgnew file mode 100644index 0000000000..51cdfd4da1--- /dev/null+++ b/js/app/packages/design/empty-state-no-filter-match.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="100%" height="100%" fill="none" stroke="currentColor" stroke-width="0.5"><g transform="translate(0.145 10.44)"><path d="M48.24,16.06l-20.79,12c-1.43.83-3.94.72-5.59-.23L1.87,16.29c-1.65-.96-1.83-2.4-.4-3.23L22.26,1.06c1.43-.83,3.94-.72,5.59.23l19.99,11.54c1.65.96,1.83,2.4.4,3.23Z" stroke-dasharray="2.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/><path d="M28.14,6.08c.22.05.43.13.61.23.72.41.72,1.09,0,1.5l-15.59,9c-.72.41-1.88.41-2.6,0s-.72-1.09,0-1.5l.51-.29" stroke-miterlimit="10" opacity="0.5"/><path d="M30.74,10.58c.22.05.43.13.61.23.72.41.72,1.09,0,1.5l-10.39,6c-.72.41-1.88.41-2.6,0s-.72-1.09,0-1.5l.51-.29" stroke-miterlimit="10" opacity="0.5"/><path d="M33.34,15.08c.22.05.43.13.61.23.72.41.72,1.09,0,1.5l-5.2,3c-.72.41-1.88.41-2.6,0s-.72-1.09,0-1.5l.51-.29" stroke-miterlimit="10" opacity="0.5"/><path d="M28.75,5.81l-15.59,9c-.72.41-1.88.41-2.6,0s-.72-1.09,0-1.5l15.59-9c.72-.41,1.88-.41,2.6,0s.72,1.09,0,1.5Z" stroke-miterlimit="10"/><path d="M31.35,10.31l-10.39,6c-.72.41-1.88.41-2.6,0s-.72-1.09,0-1.5l10.39-6c.72-.41,1.88-.41,2.6,0s.72,1.09,0,1.5Z" stroke-miterlimit="10"/><path d="M33.95,14.81l-5.2,3c-.72.41-1.88.41-2.6,0s-.72-1.09,0-1.5l5.2-3c.72-.41,1.88-.41,2.6,0s.72,1.09,0,1.5Z" stroke-miterlimit="10"/></g></svg>diff --git a/js/app/packages/design/empty-state-no-search-match.svg b/js/app/packages/design/empty-state-no-search-match.svgnew file mode 100644index 0000000000..af39408c8d--- /dev/null+++ b/js/app/packages/design/empty-state-no-search-match.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="100%" height="100%"><g transform="translate(0.395 10.69)"><path fill="none" stroke="currentColor" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2.5" opacity="0.5" d="M47.99,15.81l-20.79,12c-1.43.83-3.94.72-5.59-.23L1.62,16.04c-1.65-.96-1.83-2.4-.4-3.23L22.01.81c1.43-.83,3.94-.72,5.59.23l19.99,11.54c1.65.96,1.83,2.4.4,3.23Z"/><path fill="currentColor" d="M21.34,8.09c1.87,0,3.61.42,4.92,1.17,1.22.7,1.89,1.61,1.89,2.55s-.67,1.85-1.89,2.55c-1.31.75-3.05,1.17-4.92,1.17s-3.61-.42-4.92-1.17c-1.22-.7-1.89-1.61-1.89-2.55s.67-1.85,1.89-2.55c1.31-.75,3.05-1.17,4.92-1.17M21.34,7.59c-1.87,0-3.74.41-5.17,1.24-2.85,1.65-2.85,4.32,0,5.97,1.43.82,3.3,1.24,5.17,1.24s3.74-.41,5.17-1.24c2.85-1.65,2.85-4.32,0-5.97-1.43-.82-3.3-1.24-5.17-1.24h0Z"/><line fill="none" stroke="currentColor" stroke-width="0.5" stroke-miterlimit="10" stroke-linecap="round" x1="34.03" y1="11.81" x2="28.53" y2="11.81"/><path fill="currentColor" opacity="0.5" d="M34.03,14.06h-5.4c-.04-.41-.16-.82-.39-1.2l-.43.26c.33.56.43,1.16.28,1.75-.21.8-.86,1.53-1.87,2.12-2.68,1.55-7.05,1.55-9.73,0-1.01-.58-1.66-1.31-1.87-2.11-.15-.58-.06-1.18.26-1.73l-.43-.25c-.39.67-.5,1.4-.31,2.11.25.93.97,1.76,2.1,2.41,1.41.81,3.26,1.22,5.12,1.22s3.71-.41,5.12-1.22c1.13-.66,1.86-1.49,2.11-2.42.04-.14.05-.28.07-.42h5.4c.14,0,.25-.11.25-.25s-.11-.25-.25-.25Z"/></g></svg>diff --git a/js/app/packages/ui/components/EmptyStatePanel.tsx b/js/app/packages/ui/components/EmptyStatePanel.tsxnew file mode 100644index 0000000000..df271c5086--- /dev/null+++ b/js/app/packages/ui/components/EmptyStatePanel.tsx@@ -0,0 +1,120 @@+import { type Component, For, type JSXElement, Show } from 'solid-js';+import { Dynamic } from 'solid-js/web';+import { Button } from './Button';+import { cn } from '../utils/classname';++export interface EmptyStateAction {+ label: string;+ onClick: () => void;+ hotkeyChord?: string[];+}++export interface EmptyStatePanelProps {+ graphic?: Component<{ class?: string }>;+ graphicClass?: string;+ title?: string;+ description?: JSXElement;+ primaryAction?: EmptyStateAction;+ secondaryAction?: EmptyStateAction;+ align?: 'left' | 'center';+ children?: JSXElement;+ class?: string;+}++const DEFAULT_GRAPHIC_CLASS = 'h-48 w-48 text-ink-muted';++function ChordPills(props: { keys: string[] }) {+ return (+ <span class="ml-2 inline-flex items-center gap-1.5">+ <For each={props.keys}>+ {(key, i) => (+ <>+ <Show when={i() > 0}>+ <span class="text-xxs opacity-60">then</span>+ </Show>+ <span class="rounded-sm border border-current/30 bg-current/10 px-1 py-px text-xxs leading-none uppercase">+ {key}+ </span>+ </>+ )}+ </For>+ </span>+ );+}++function ActionButton(props: {+ action: EmptyStateAction;+ variant: 'cta' | 'base';+}) {+ return (+ <Button+ variant={props.variant}+ size="md"+ onClick={props.action.onClick}+ >+ {props.action.label}+ <Show when={props.action.hotkeyChord?.length}>+ <ChordPills keys={props.action.hotkeyChord!} />+ </Show>+ </Button>+ );+}++export function EmptyStatePanel(props: EmptyStatePanelProps) {+ const isCentered = () => props.align === 'center';++ return (+ <div+ role="status"+ class={cn(+ 'flex size-full flex-col px-8',+ '@max-sm:px-4 @max-sm:text-center @max-sm:items-center',+ isCentered()+ ? 'items-center text-center'+ : 'items-center pt-24 @max-sm:pt-12',+ props.class+ )}+ >+ <Show when={isCentered()}>+ <div class="min-h-12 flex-1" aria-hidden="true" />+ </Show>+ <div+ class={cn(+ 'flex w-full max-w-xl flex-col gap-4 @max-sm:items-center',+ isCentered() ? 'items-center' : 'items-start'+ )}+ >+ <Show when={props.graphic}>+ {(graphic) => (+ <div+ aria-hidden="true"+ class={cn(DEFAULT_GRAPHIC_CLASS, props.graphicClass)}+ >+ <Dynamic component={graphic()} class="size-full" />+ </div>+ )}+ </Show>+ <Show when={props.title}>+ <h2 class="text-base font-semibold text-ink">{props.title}</h2>+ </Show>+ <Show when={props.description}>+ <div class="text-sm/6 text-ink-muted">{props.description}</div>+ </Show>+ <Show when={props.primaryAction || props.secondaryAction}>+ <div class="mt-2 flex flex-wrap gap-2">+ <Show when={props.primaryAction}>+ {(action) => <ActionButton action={action()} variant="cta" />}+ </Show>+ <Show when={props.secondaryAction}>+ {(action) => <ActionButton action={action()} variant="base" />}+ </Show>+ </div>+ </Show>+ <Show when={props.children}>{props.children}</Show>+ </div>+ <Show when={isCentered()}>+ <div class="flex-[2]" aria-hidden="true" />+ </Show>+ </div>+ );+}diff --git a/js/app/packages/ui/components/FilteredHiddenBanner.tsx b/js/app/packages/ui/components/FilteredHiddenBanner.tsxnew file mode 100644index 0000000000..ae1d0ed9e8--- /dev/null+++ b/js/app/packages/ui/components/FilteredHiddenBanner.tsx@@ -0,0 +1,37 @@+import XIcon from '@phosphor/x.svg';+import { Show } from 'solid-js';++export interface FilteredHiddenBannerProps {+ hiddenCount?: number;+ itemLabel?: string;+ onClearFilters: () => void;+}++export function FilteredHiddenBanner(props: FilteredHiddenBannerProps) {+ return (+ <div class="flex w-full max-w-md flex-wrap items-center justify-between gap-3 rounded-md border border-edge-muted bg-input/50 px-4 py-3">+ <div class="flex items-baseline gap-2 text-sm">+ <Show+ when={props.hiddenCount !== undefined}+ fallback={+ <span class="text-ink-muted">Some items are hidden by filters</span>+ }+ >+ <span class="font-semibold text-ink">+ {props.hiddenCount}{' '}+ {props.itemLabel ?? (props.hiddenCount === 1 ? 'item' : 'items')}+ </span>+ <span class="text-ink-muted">hidden by filters</span>+ </Show>+ </div>+ <button+ type="button"+ onClick={props.onClearFilters}+ class="inline-flex items-center gap-1.5 text-sm font-medium text-ink hover:text-accent transition-colors"+ >+ Clear Filters+ <XIcon class="size-3.5" />+ </button>+ </div>+ );+}diff --git a/js/app/packages/ui/index.ts b/js/app/packages/ui/index.tsindex 9bc461dc65..fa2338ce41 100644--- a/js/app/packages/ui/index.ts+++ b/js/app/packages/ui/index.ts@@ -17,6 +17,8 @@ export { Hotkey } from './components/Hotkey';export { Scroll } from './components/Scroll';export { Panel } from './components/Panel';export { Layer } from './components/Layer';+export { EmptyStatePanel } from './components/EmptyStatePanel';+export { FilteredHiddenBanner } from './components/FilteredHiddenBanner';/* types */export type { AvatarSize, AvatarProps, AvatarGroupSize, AvatarGroupProps } from './components/Avatar';@@ -26,6 +28,8 @@ export type { SendButtonProps } from './components/SendButton';export type { CheckboxProps } from './components/Checkbox';export type { ButtonProps } from './components/Button';export type { DialogProps } from './components/Dialog';+export type { EmptyStatePanelProps, EmptyStateAction } from './components/EmptyStatePanel';+export type { FilteredHiddenBannerProps } from './components/FilteredHiddenBanner';/* utils */export { cn } from './utils/classname';