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.

feat(style): improve empty state styling (#3665)

Aidan Holloway-Bidwellb8d988911744
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.tsx
index bc56c6f3f2..59df39e01e 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
@@ -5,25 +5,28 @@ import { McpSetupCards } from '@core/component/AI/component/McpSetupCards';
import { toast } from '@core/component/Toast/Toast';
import { useEmailLinks, useEmailLinksStatus } from '@core/email-link';
import Arcanum01 from '@design/arcanum-01.svg';
-import EmptyStateDoneIcon from '@design/empty-state-done.svg';
+import EmptyStateDocIcon from '@design/empty-state-doc.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 EmptyStateTasksIcon from '@design/empty-state-tasks.svg';
import { EmptyStatePanel, FilteredHiddenBanner } from '@ui';
-import { Match, Switch } from 'solid-js';
+import { type Component, Match, Switch } from 'solid-js';
import { FolderDropZone } from './FolderDropZone';
import { useSoupView } from './soup-view-context';
type FallbackContent = {
plural: string;
+ graphic?: Component<{ class?: string }>;
create?: { label: string; blockName: BlockName | BlockAlias };
};
const FALLBACK_CONTENT: Partial<Record<ListView, FallbackContent>> = {
documents: {
plural: 'documents',
+ graphic: EmptyStateDocIcon,
create: { label: 'Create document', blockName: 'md' },
},
channels: {
@@ -48,6 +51,7 @@ export function EmptyState(props: {
listView?: ListView;
search?: boolean;
hasRefinementsFromBase?: boolean;
+ hasHiddenItems?: boolean;
onClearFilters?: () => void;
}) {
const emailActive = useEmailLinksStatus();
@@ -82,7 +86,10 @@ export function EmptyState(props: {
title="No items matching the filters"
>
{props.onClearFilters && (
- <FilteredHiddenBanner onClearFilters={props.onClearFilters} />
+ <FilteredHiddenBanner
+ hasHiddenItems={props.hasHiddenItems}
+ onClearFilters={props.onClearFilters}
+ />
)}
</EmptyStatePanel>
</Match>
@@ -125,8 +132,7 @@ export function EmptyState(props: {
<Match when={props.listView === 'tasks'}>
<EmptyStatePanel
align="center"
- graphic={EmptyStateDoneIcon}
- graphicClass="opacity-50"
+ graphic={EmptyStateTasksIcon}
title="Nothing to do"
description="Tasks you create or that get assigned to you will show up here."
/>
@@ -169,7 +175,7 @@ export function EmptyState(props: {
return (
<EmptyStatePanel
align="center"
- graphic={EmptyStateInboxZeroIcon}
+ graphic={fallback.graphic ?? EmptyStateInboxZeroIcon}
title={`No ${fallback.plural} to show`}
primaryAction={
fallback.create
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
index 71022924fb..0b65f290fc 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
@@ -70,8 +70,14 @@ const TAB_ONLY_FILTERS = new Set([
* and a function to reset filters to the current tab's default state.
*/
export function useFilterRefinements() {
- const { soup, queryFilters, assigneeFilter, setAssigneeFilter, activeTab } =
- useSoupView();
+ const {
+ soup,
+ items,
+ queryFilters,
+ assigneeFilter,
+ setAssigneeFilter,
+ activeTab,
+ } = useSoupView();
const filterData = () => queryFilters.state;
const panel = useSplitPanelOrThrow();
const user = useUserContext();
@@ -746,6 +752,71 @@ export function useFilterRefinements() {
assignees: assigneeFilter(),
});
+ /**
+ * Does at least one item pass the BASE preset's client predicates? Used to
+ * decide whether the empty-state banner should claim items are hidden.
+ * Short-circuits at the first match.
+ *
+ * Note: items() is already server-filtered by current query filters, so if
+ * the user has tightened the server query this may return false even when
+ * items exist. `hasHiddenItems` below compensates by being sticky.
+ */
+ const baseHasItems = createMemo(() => {
+ const preset = currentPreset();
+ if (!preset) return false;
+ const baseAnd = preset.clientFilters.and ?? [];
+ const baseOr = preset.clientFilters.or ?? [];
+ if (baseAnd.length === 0 && baseOr.length === 0) return items().length > 0;
+
+ const ctx = getFilterContext();
+ for (const entity of items()) {
+ let andOk = true;
+ for (const id of baseAnd) {
+ const cfg = soup.predicates.getConfig(id);
+ if (cfg && !cfg.predicate(entity, ctx)) {
+ andOk = false;
+ break;
+ }
+ }
+ if (!andOk) continue;
+ if (baseOr.length > 0) {
+ let orOk = false;
+ for (const id of baseOr) {
+ const cfg = soup.predicates.getConfig(id);
+ if (cfg?.predicate(entity, ctx)) {
+ orOk = true;
+ break;
+ }
+ }
+ if (!orOk) continue;
+ }
+ return true;
+ }
+ return false;
+ });
+
+ /**
+ * Sticky-true while refinements are active so the banner doesn't flicker
+ * off when a server refetch transiently zeroes out items(). Resets on
+ * view/tab change, and snaps to the live state whenever refinements clear.
+ *
+ * Imperfect by design: if the user mounts with refinements already active
+ * and the server returns zero items, this stays false. Getting a true
+ * answer would need a separate base-preset query.
+ */
+ const hasHiddenItems = createMemo<{ key: string; value: boolean }>((prev) => {
+ const key = `${currentView() ?? ''}|${activeTab() ?? ''}`;
+ const refinementsActive = hasActiveRefinements();
+ const itemsExist = baseHasItems();
+
+ if (prev?.key !== key || !refinementsActive) {
+ return { key, value: itemsExist };
+ }
+ return { key, value: prev.value || itemsExist };
+ });
+
+ const hasHiddenItemsValue = () => hasHiddenItems().value;
+
const getFilterQuery = (optionId: string) => {
const filter = soup.predicates.getConfig(optionId);
if (!filter?.query) return undefined;
@@ -791,6 +862,7 @@ export function useFilterRefinements() {
return {
hasActiveRefinements,
+ hasHiddenItems: hasHiddenItemsValue,
resetToTabDefaults,
currentView,
consolidatedFiltersList,
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view-context.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view-context.tsx
index 6c7a8b0bf3..46fa0d62ac 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view-context.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view-context.tsx
@@ -77,6 +77,7 @@ interface SoupViewContextValues {
searchPaused: Accessor<boolean>;
setSearchPaused: Setter<boolean>;
featuredIds: Accessor<string[]>;
+ items: Accessor<SoupEntity[]>;
rows: Accessor<SoupRow[]>;
isSearchServiceLoading: Accessor<boolean>;
isLocalSearchSettling: Accessor<boolean>;
@@ -592,6 +593,7 @@ export const SoupViewContextProvider: FlowComponent<
}
},
},
+ items,
rows,
searchText: search.searchText,
setSearchText: search.setSearchText,
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index 8a65f266f0..1d23576f35 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -600,7 +600,8 @@ export const SoupViewList = (props: SoupViewListProps) => {
activeTab,
setActiveTab,
} = useSoupView();
- const { hasActiveRefinements, resetToTabDefaults } = useFilterRefinements();
+ const { hasActiveRefinements, hasHiddenItems, resetToTabDefaults } =
+ useFilterRefinements();
const { isKeypressActive } = useIsKeyPressActive();
@@ -1073,6 +1074,7 @@ export const SoupViewList = (props: SoupViewListProps) => {
listView={currentView()}
search={!!searchText()}
hasRefinementsFromBase={hasActiveRefinements()}
+ hasHiddenItems={hasHiddenItems()}
onClearFilters={resetToTabDefaults}
/>
</Match>
diff --git a/js/app/packages/design/empty-state-doc.svg b/js/app/packages/design/empty-state-doc.svg
new file mode 100644
index 0000000000..47484727bc
--- /dev/null
+++ b/js/app/packages/design/empty-state-doc.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.865 12.35)"><g opacity="0.5"><path d="M37.29,10.28c.34.33.56.69.66,1.05" stroke-linecap="round" stroke-linejoin="round"/><path d="M37,13.33s-.07.05-.11.07l-19.05,11c-1.67.97-4.6.85-6.53-.27L1.85,18.67c-.72-.42-1.2-.91-1.44-1.42" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2.39 2.39"/><path d="M.32,16.09c.11-.36.36-.69.75-.98" stroke-linecap="round" stroke-linejoin="round"/></g><path d="M36.89,10.4l-19.05,11c-1.67.97-4.6.85-6.53-.27L1.85,15.67c-1.93-1.12-2.14-2.81-.47-3.77L20.43.9c1.67-.97,4.6-.85,6.53.27l9.45,5.46c1.93,1.12,2.14,2.81.47,3.77Z" stroke-linejoin="round"/><line x1="7.16" y1="13.74" x2="22.75" y2="4.74" stroke-miterlimit="10" stroke-linecap="round"/><line x1="10.62" y1="15.74" x2="26.21" y2="6.74" stroke-miterlimit="10" stroke-linecap="round"/><line x1="14.08" y1="17.74" x2="24.48" y2="11.74" stroke-miterlimit="10" stroke-linecap="round"/></g></svg>
diff --git a/js/app/packages/design/empty-state-email.svg b/js/app/packages/design/empty-state-email.svg
index f796c68f97..09374552f2 100644
--- a/js/app/packages/design/empty-state-email.svg
+++ b/js/app/packages/design/empty-state-email.svg
@@ -1 +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>
+<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.5" stroke-miterlimit="10"/></g></svg>
diff --git a/js/app/packages/design/empty-state-tasks.svg b/js/app/packages/design/empty-state-tasks.svg
new file mode 100644
index 0000000000..49da048a53
--- /dev/null
+++ b/js/app/packages/design/empty-state-tasks.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 8.46)"><path d="M42.16,7.41L12.65,24.45c-1.15.66-3.16.58-4.49-.19h0c-1.33-.77-1.47-1.93-.32-2.59L37.35,4.63c1.15-.66,3.16-.58,4.49.19h0c1.33.77,1.47,1.93.32,2.59Z" stroke-linecap="round" stroke-linejoin="round"/><path fill="currentColor" stroke="none" fill-rule="evenodd" d="M8.76,21.83c1-.57,2.61-.57,3.61,0s1,1.51,0,2.08-2.61.57-3.61,0-1-1.51,0-2.08ZM10.93,21.92c.1,0,.2.02.27.07s.11.1.11.16v1.25c0,.06-.04.11-.11.16s-.17.06-.27.07h-1.08c-.21,0-.38-.1-.38-.22,0-.12.18-.22.38-.22h.7s0-1.03,0-1.03c0-.12.18-.22.38-.22Z"/><path d="M40.23,5.74c.44.26.44.67,0,.93s-1.16.26-1.6,0-.44-.67,0-.93,1.16-.26,1.6,0Z" stroke-linecap="round" stroke-linejoin="round"/><path d="M37.03,7.6c.44.26.44.67,0,.93s-1.16.26-1.6,0-.44-.67,0-.93,1.16-.26,1.6,0Z" stroke-linecap="round" stroke-linejoin="round"/><path d="M33.82,9.45c.44.26.44.67,0,.93s-1.16.26-1.6,0-.44-.67,0-.93,1.16-.26,1.6,0Z" stroke-linecap="round" stroke-linejoin="round"/><path d="M35.34,3.48L5.84,20.51c-1.15.66-3.16.58-4.49-.19h0c-1.33-.77-1.47-1.93-.32-2.59L30.53.7c1.15-.66,3.16-.58,4.49.19h0c1.33.77,1.47,1.93.32,2.59Z" stroke-linecap="round" stroke-linejoin="round"/><path fill="currentColor" stroke="none" fill-rule="evenodd" d="M1.95,17.9c1-.57,2.61-.57,3.61,0s1,1.51,0,2.08-2.61.57-3.61,0-1-1.51,0-2.08ZM4.11,17.99c.1,0,.2.02.27.07s.11.1.11.16v1.25c0,.06-.04.11-.11.16s-.17.06-.27.07h-1.08c-.21,0-.38-.1-.38-.22,0-.12.18-.22.38-.22h.7s0-1.03,0-1.03c0-.12.18-.22.38-.22Z"/><path d="M33.42,1.81c.44.26.44.67,0,.93s-1.16.26-1.6,0-.44-.67,0-.93,1.16-.26,1.6,0Z" stroke-linecap="round" stroke-linejoin="round"/><path d="M30.21,3.66c.44.26.44.67,0,.93s-1.16.26-1.6,0-.44-.67,0-.93,1.16-.26,1.6,0Z" stroke-linecap="round" stroke-linejoin="round"/><path d="M27,5.51c.44.26.44.67,0,.93s-1.16.26-1.6,0-.44-.67,0-.93,1.16-.26,1.6,0Z" stroke-linecap="round" stroke-linejoin="round"/><path d="M48.97,11.34l-29.51,17.04c-1.15.66-3.16.58-4.49-.19h0c-1.33-.77-1.47-1.93-.32-2.59l29.51-17.04c1.15-.66,3.16-.58,4.49.19h0c1.33.77,1.47,1.93.32,2.59Z" stroke-linecap="round" stroke-linejoin="round"/><path fill="currentColor" stroke="none" fill-rule="evenodd" d="M15.58,25.76c1-.57,2.61-.57,3.61,0s1,1.51,0,2.08-2.61.57-3.61,0-1-1.51,0-2.08ZM17.74,25.85c.1,0,.2.02.27.07s.11.1.11.16v1.25c0,.06-.04.11-.11.16s-.17.06-.27.07h-1.08c-.21,0-.38-.1-.38-.22,0-.12.18-.22.38-.22h.7s0-1.03,0-1.03c0-.12.18-.22.38-.22Z"/><path d="M47.05,9.68c.44.26.44.67,0,.93s-1.16.26-1.6,0-.44-.67,0-.93,1.16-.26,1.6,0Z" stroke-linecap="round" stroke-linejoin="round"/><path d="M43.84,11.53c.44.26.44.67,0,.93s-1.16.26-1.6,0-.44-.67,0-.93,1.16-.26,1.6,0Z" stroke-linecap="round" stroke-linejoin="round"/><path d="M40.63,13.38c.44.26.44.67,0,.93s-1.16.26-1.6,0-.44-.67,0-.93,1.16-.26,1.6,0Z" stroke-linecap="round" stroke-linejoin="round"/><path d="M42.75,9.66c.37.63.19,1.3-.59,1.75L12.65,28.45c-1.15.66-3.16.58-4.49-.19h0c-1-.58-1.33-1.37-.94-2.01" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2.5" opacity="0.5"/><path d="M35.91,5.68c.4.64.23,1.33-.57,1.79L5.84,24.51c-1.15.66-3.16.58-4.49-.19h0c-1-.58-1.33-1.37-.94-2.01" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2.5" opacity="0.5"/><path d="M49.42,13.39c.55.68.41,1.46-.45,1.96l-29.51,17.04c-1.15.66-3.16.58-4.49-.19h0c-1-.58-1.33-1.37-.94-2.01" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2.5" opacity="0.5"/></g></svg>
diff --git a/js/app/packages/ui/components/EmptyStatePanel.tsx b/js/app/packages/ui/components/EmptyStatePanel.tsx
index df271c5086..3c2e6af4fe 100644
--- a/js/app/packages/ui/components/EmptyStatePanel.tsx
+++ b/js/app/packages/ui/components/EmptyStatePanel.tsx
@@ -1,12 +1,11 @@
-import { type Component, For, type JSXElement, Show } from 'solid-js';
+import { type Component, type JSXElement, Show } from 'solid-js';
import { Dynamic } from 'solid-js/web';
-import { Button } from './Button';
import { cn } from '../utils/classname';
+import { Button } from './Button';
export interface EmptyStateAction {
label: string;
onClick: () => void;
- hotkeyChord?: string[];
}
export interface EmptyStatePanelProps {
@@ -15,7 +14,6 @@ export interface EmptyStatePanelProps {
title?: string;
description?: JSXElement;
primaryAction?: EmptyStateAction;
- secondaryAction?: EmptyStateAction;
align?: 'left' | 'center';
children?: JSXElement;
class?: string;
@@ -23,43 +21,6 @@ export interface EmptyStatePanelProps {
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';
@@ -88,7 +49,7 @@ export function EmptyStatePanel(props: EmptyStatePanelProps) {
{(graphic) => (
<div
aria-hidden="true"
- class={cn(DEFAULT_GRAPHIC_CLASS, props.graphicClass)}
+ class={cn(DEFAULT_GRAPHIC_CLASS, '-mb-8', props.graphicClass)}
>
<Dynamic component={graphic()} class="size-full" />
</div>
@@ -100,15 +61,17 @@ export function EmptyStatePanel(props: EmptyStatePanelProps) {
<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 when={props.primaryAction}>
+ {(action) => (
+ <Button
+ variant="cta"
+ size="md"
+ class="mt-2"
+ onClick={action().onClick}
+ >
+ {action().label}
+ </Button>
+ )}
</Show>
<Show when={props.children}>{props.children}</Show>
</div>
diff --git a/js/app/packages/ui/components/FilteredHiddenBanner.tsx b/js/app/packages/ui/components/FilteredHiddenBanner.tsx
index ae1d0ed9e8..4706fb0127 100644
--- a/js/app/packages/ui/components/FilteredHiddenBanner.tsx
+++ b/js/app/packages/ui/components/FilteredHiddenBanner.tsx
@@ -1,29 +1,31 @@
import XIcon from '@phosphor/x.svg';
import { Show } from 'solid-js';
+import { cn } from '../utils/classname';
export interface FilteredHiddenBannerProps {
- hiddenCount?: number;
- itemLabel?: string;
+ /**
+ * Whether to surface the "Some items are hidden by filters" message.
+ * When false the banner collapses to fit just the Clear Filters button.
+ * When undefined, defaults to showing the message.
+ */
+ hasHiddenItems?: boolean;
onClearFilters: () => void;
}
export function FilteredHiddenBanner(props: FilteredHiddenBannerProps) {
+ const showMessage = () => props.hasHiddenItems !== false;
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>
+ <div
+ class={cn(
+ 'flex flex-wrap items-center gap-3 rounded-md border border-edge-muted bg-input/50 px-4 py-3',
+ showMessage() ? 'w-full max-w-md justify-between' : 'w-fit'
+ )}
+ >
+ <Show when={showMessage()}>
+ <span class="text-sm text-ink-muted">
+ Some items are hidden by filters
+ </span>
+ </Show>
<button
type="button"
onClick={props.onClearFilters}