import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { BulkSelectionProvider, useBulkSelection } from './bulk-selection-context.js';
const DEMO_IDS = ['item-1', 'item-2', 'item-3', 'item-4', 'item-5'];
/**
 * Demo component that exercises the BulkSelectionProvider context.
 * This is not a real UI component -- it exists purely to demonstrate
 * and test the context behavior in Storybook.
 */
function BulkSelectionDemo() {
    const { selectedIds, toggleSelection, selectAll, clearSelection, isSelected } = useBulkSelection();
    const allIds = DEMO_IDS;
    return (_jsxs("div", { className: "space-y-4 p-4", "data-testid": "bulk-selection-demo", children: [_jsxs("div", { className: "text-sm font-medium", children: ["Selected: ", selectedIds.size, " / ", allIds.length] }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { className: "hover:bg-accent rounded border px-3 py-1 text-sm", onClick: () => selectAll(allIds), "data-testid": "select-all-btn", children: "Select All" }), _jsx("button", { className: "hover:bg-accent rounded border px-3 py-1 text-sm", onClick: clearSelection, "data-testid": "clear-btn", children: "Clear" })] }), _jsx("ul", { className: "space-y-1", children: allIds.map((id) => (_jsx("li", { children: _jsxs("button", { className: `w-full rounded px-3 py-1.5 text-left text-sm transition-colors ${isSelected(id) ? 'bg-primary/10 text-primary' : 'hover:bg-accent'}`, onClick: () => toggleSelection(id), "data-testid": `toggle-${id}`, children: [id, " ", isSelected(id) ? '(selected)' : ''] }) }, id))) })] }));
}
function WrappedDemo() {
    return (_jsx(BulkSelectionProvider, { children: _jsx(BulkSelectionDemo, {}) }));
}
const meta = {
    title: 'PM/BulkOperations/BulkSelectionContext',
    component: WrappedDemo,
    parameters: {
        layout: 'padded',
    },
    tags: ['autodocs'],
};
export default meta;
export const Default = {};
