diff --git a/apps/sim/app/workspace/[workspaceId]/components/resource/components/action-bar/action-bar.tsx b/apps/sim/app/workspace/[workspaceId]/components/resource/components/action-bar/action-bar.tsx index 7ded34f10d0..65442f93310 100644 --- a/apps/sim/app/workspace/[workspaceId]/components/resource/components/action-bar/action-bar.tsx +++ b/apps/sim/app/workspace/[workspaceId]/components/resource/components/action-bar/action-bar.tsx @@ -2,6 +2,7 @@ import type { ComponentType } from 'react' import { + BulkActionBar, BulkActionButton, cn, DropdownMenu, @@ -91,57 +92,48 @@ export function ResourceActionBar({ className )} > -
- - {exceedsLimit - ? `${selectedCount} selected · select ${maxSelectable} or fewer` - : `${selectedCount} selected`} - -
- {onDownload && ( - - )} - {onMove && moveOptions && ( - - - - - - - - - - Move - - - {renderMoveOptions(moveOptions, onMove)} - - - )} - {onDelete && ( - - )} -
-
+ + {exceedsLimit + ? `${selectedCount} selected · select ${maxSelectable} or fewer` + : `${selectedCount} selected`} + + } + > + {onDownload && ( + + )} + {onMove && moveOptions && ( + + + + + + + + + + Move + + + {renderMoveOptions(moveOptions, onMove)} + + + )} + {onDelete && ( + + )} + ) } diff --git a/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/action-bar/action-bar.tsx b/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/action-bar/action-bar.tsx index 01dbfaead48..3bd0cab96d4 100644 --- a/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/action-bar/action-bar.tsx +++ b/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/action-bar/action-bar.tsx @@ -1,4 +1,4 @@ -import { BulkActionButton, cn, Tooltip } from '@sim/emcn' +import { BulkActionBar, BulkActionButton, cn, Tooltip } from '@sim/emcn' import { Ban, Circle, Trash } from '@sim/emcn/icons' import { domAnimation, LazyMotion, m } from 'framer-motion' import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider' @@ -53,70 +53,70 @@ export function ActionBar({ transition={{ duration: 0.2 }} className={cn('-translate-x-1/2 fixed bottom-6 left-1/2 z-[var(--z-dropdown)]', className)} > -
- - {isAllSelected ? totalCount : selectedCount} selected - {showSelectAllOption && ( - <> - {' · '} - - - )} - {isAllSelected && onClearSelectAll && ( - <> - {' · '} - - - )} - + + {isAllSelected ? totalCount : selectedCount} selected + {showSelectAllOption && ( + <> + {' · '} + + + )} + {isAllSelected && onClearSelectAll && ( + <> + {' · '} + + + )} + + } + > + {showEnableButton && ( + + + + + + + Enable + + )} -
- {showEnableButton && ( - - - - - - - Enable - - )} + {showDisableButton && ( + + + + + + + Disable + + )} - {showDisableButton && ( - - - - - - - Disable - - )} - - {onDelete && canEdit && ( - - - - - - - Delete - - )} -
-
+ {onDelete && canEdit && ( + + + + + + + Delete + + )} + ) diff --git a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-action-bar/table-action-bar.tsx b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-action-bar/table-action-bar.tsx index a3152bc2c7a..9922997c840 100644 --- a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-action-bar/table-action-bar.tsx +++ b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-action-bar/table-action-bar.tsx @@ -1,7 +1,7 @@ 'use client' import type React from 'react' -import { BulkActionButton, cn, Tooltip } from '@sim/emcn' +import { BulkActionBar, BulkActionButton, cn, Tooltip } from '@sim/emcn' import { Eye, PlayOutline, RefreshCw, Square } from '@sim/emcn/icons' import { AnimatePresence, domAnimation, LazyMotion, m } from 'framer-motion' @@ -89,47 +89,42 @@ export function TableActionBar({ className )} > -
- - {selectedCellCount === 1 + + : `Selected ${selectedCellCount} workflow cells` + } + > + {showPlay && ( + + + + )} -
- {showPlay && ( - - - - )} + {showRefresh && ( + + + + )} - {showRefresh && ( - - - - )} + {runningCount > 0 && ( + + + + )} - {runningCount > 0 && ( - - - - )} - - {onViewExecution && ( - - - - )} -
-
+ {onViewExecution && ( + + + + )} + )} diff --git a/packages/emcn/src/components/bulk-action-bar/bulk-action-bar.tsx b/packages/emcn/src/components/bulk-action-bar/bulk-action-bar.tsx new file mode 100644 index 00000000000..2b90c8cfb03 --- /dev/null +++ b/packages/emcn/src/components/bulk-action-bar/bulk-action-bar.tsx @@ -0,0 +1,31 @@ +import { forwardRef, type HTMLAttributes, type ReactNode } from 'react' +import { cn } from '../../lib/cn' + +export interface BulkActionBarProps extends HTMLAttributes { + /** Selection summary, including optional inline selection actions or limit warnings. */ + label: ReactNode + children: ReactNode +} + +/** + * Shared selection-action surface. Callers own visibility, positioning, animation + * and commands; compose actions with BulkActionButton. + * @example + */ +export const BulkActionBar = forwardRef( + ({ label, children, className, ...props }, ref) => ( +
+ {label} +
{children}
+
+ ) +) + +BulkActionBar.displayName = 'BulkActionBar' diff --git a/packages/emcn/src/components/index.ts b/packages/emcn/src/components/index.ts index 6a5eb49c1ee..e0c98c65082 100644 --- a/packages/emcn/src/components/index.ts +++ b/packages/emcn/src/components/index.ts @@ -1,6 +1,7 @@ export { Avatar, AvatarFallback, AvatarImage } from './avatar/avatar' export { Badge, type BadgeProps } from './badge/badge' export { Banner } from './banner/banner' +export { BulkActionBar, type BulkActionBarProps } from './bulk-action-bar/bulk-action-bar' export { BulkActionButton, type BulkActionButtonProps,