{
  "component": {
    "id": "bulk-action-bar",
    "name": "Bulk action bar",
    "tier": "pro",
    "exampleId": "bulk-action-bar",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/bulk-action-bar-demo.tsx",
    "exportName": "BulkActionBarDemo",
    "sha256": "3bcaecafe506d563c6df9ab78ace79fce326dcbf0d65ac9ad9aef50fe5db75a8",
    "helperImports": [],
    "directComponentImports": [
      "bulk-action-bar"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/bulk-action-bar",
    "registryUrl": "https://tidalui.com/r/pro/bulk-action-bar.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/bulk-action-bar",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/bulk-action-bar",
      "registryUrl": "https://tidalui.com/r/pro/bulk-action-bar.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/bulk-action-bar.tsx",
    "exports": [
      "TidalBulkAction",
      "TidalBulkActionBar"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/bulk-action-bar.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "bulk-action-bar"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/bulk-action-bar.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/bulk-action-bar.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/bulk-action-bar-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useLayoutEffect, useRef, useState } from \"react\";\n\nimport { TidalBulkActionBar, type TidalBulkAction } from \"./components/ui/bulk-action-bar\";\n\nimport \"./components/ui/bulk-action-bar.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .bulk-demo,\\n.tidal-scope .bulk-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .bulk-demo {\\n  width: 100%;\\n  min-width: 0;\\n  color: var(--t-ink);\\n  container: bulk-demo / inline-size;\\n  font-family: Inter, ui-sans-serif, system-ui, sans-serif;\\n}\\n\\n.tidal-scope .bulk-demo-frame {\\n  display: grid;\\n  min-width: 0;\\n  gap: 10px;\\n  padding: clamp(8px, 2.8cqi, 28px);\\n}\\n\\n.tidal-scope .bulk-demo-header,\\n.tidal-scope .bulk-demo-footer {\\n  display: flex;\\n  min-width: 0;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 16px;\\n}\\n\\n.tidal-scope .bulk-demo-header {\\n  padding: 8px 2px 11px;\\n}\\n\\n.tidal-scope .bulk-demo-header > div {\\n  min-width: 0;\\n}\\n\\n.tidal-scope .bulk-demo-header span {\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  font-weight: 720;\\n  letter-spacing: 0.09em;\\n  line-height: 1.4;\\n  text-transform: uppercase;\\n}\\n\\n.tidal-scope .bulk-demo-header h2 {\\n  margin: 5px 0 0;\\n  font-size: clamp(26px, 5cqi, 46px);\\n  font-weight: 570;\\n  letter-spacing: -0.055em;\\n  line-height: 0.96;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .bulk-demo-header button {\\n  min-width: 92px;\\n  min-height: 44px;\\n  flex: none;\\n  padding: 8px 14px;\\n  border: 1px solid var(--t-ink);\\n  border-radius: 10px;\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n  font: inherit;\\n  font-size: 11px;\\n  font-weight: 700;\\n  cursor: pointer;\\n  transition:\\n    background 160ms,\\n    color 160ms,\\n    transform 140ms var(--t-ease-out);\\n}\\n\\n.tidal-scope .bulk-demo-header button:hover {\\n  background: var(--t-surface);\\n  color: var(--t-ink);\\n}\\n\\n.tidal-scope .bulk-demo-header button:active {\\n  transform: scale(0.97);\\n}\\n\\n.tidal-scope .bulk-demo-header button:focus-visible,\\n.tidal-scope .bulk-demo-table-region:focus-visible,\\n.tidal-scope .bulk-demo-table-region input:focus-visible + .bulk-demo-check {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n.tidal-scope .bulk-demo-table-region {\\n  min-width: 0;\\n  overflow-x: auto;\\n  border: 1px solid var(--t-border);\\n  border-radius: 18px;\\n  background: var(--t-surface);\\n  scrollbar-width: thin;\\n}\\n\\n.tidal-scope .bulk-demo table {\\n  width: 100%;\\n  min-width: 660px;\\n  border-collapse: collapse;\\n  text-align: start;\\n}\\n\\n.tidal-scope .bulk-demo th,\\n.tidal-scope .bulk-demo td {\\n  min-width: 0;\\n  padding: 11px 14px;\\n  border-bottom: 1px solid var(--t-border);\\n  font-size: 11px;\\n  line-height: 1.4;\\n  text-align: start;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .bulk-demo thead th {\\n  height: 42px;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  font-weight: 720;\\n  letter-spacing: 0.08em;\\n  text-transform: uppercase;\\n}\\n\\n.tidal-scope .bulk-demo thead th:first-child,\\n.tidal-scope .bulk-demo tbody td:first-child {\\n  width: 66px;\\n  padding-inline: 11px;\\n  text-align: center;\\n}\\n\\n.tidal-scope .bulk-demo tbody tr {\\n  animation: bulk-demo-row-in 420ms var(--t-ease-out) both;\\n  animation-delay: calc(min(var(--bulk-demo-index), 5) * 55ms + 90ms);\\n  transition: background 180ms;\\n}\\n\\n.tidal-scope .bulk-demo tbody tr:last-child > * {\\n  border-bottom: 0;\\n}\\n\\n.tidal-scope .bulk-demo tbody tr[data-selected] {\\n  background: var(--t-subtle);\\n}\\n\\n.tidal-scope .bulk-demo tbody th {\\n  min-width: 190px;\\n  font-weight: 500;\\n}\\n\\n.tidal-scope .bulk-demo tbody th > span,\\n.tidal-scope .bulk-demo tbody th > strong {\\n  display: block;\\n}\\n\\n.tidal-scope .bulk-demo tbody th > span {\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  font-variant-numeric: tabular-nums;\\n  letter-spacing: 0.05em;\\n}\\n\\n.tidal-scope .bulk-demo tbody th > strong {\\n  margin-top: 3px;\\n  font-size: 11px;\\n}\\n\\n.tidal-scope .bulk-demo tbody td > span[data-status] {\\n  display: inline-flex;\\n  min-height: 24px;\\n  align-items: center;\\n  padding: 3px 8px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 999px;\\n  background: var(--t-surface);\\n  font-size: 11px;\\n  font-weight: 690;\\n  white-space: nowrap;\\n}\\n\\n.tidal-scope .bulk-demo tbody td > span[data-status=\\\"Ready\\\"] {\\n  border-color: var(--t-ink);\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n}\\n\\n.tidal-scope .bulk-demo tbody label {\\n  position: relative;\\n  display: inline-grid;\\n  width: 44px;\\n  height: 44px;\\n  place-items: center;\\n  cursor: pointer;\\n}\\n\\n.tidal-scope .bulk-demo tbody input {\\n  position: absolute;\\n  width: 1px;\\n  height: 1px;\\n  opacity: 0;\\n}\\n\\n.tidal-scope .bulk-demo-check {\\n  display: grid;\\n  width: 18px;\\n  height: 18px;\\n  place-items: center;\\n  border: 1px solid var(--t-border);\\n  border-radius: 5px;\\n  background: var(--t-surface);\\n  transition:\\n    border-color 160ms,\\n    background 160ms,\\n    transform 140ms var(--t-ease-out);\\n}\\n\\n.tidal-scope .bulk-demo-check::after {\\n  width: 7px;\\n  height: 4px;\\n  border-width: 0 0 1.5px 1.5px;\\n  border-style: solid;\\n  border-color: var(--t-surface);\\n  content: \\\"\\\";\\n  opacity: 0;\\n  transform: translateY(-1px) rotate(-45deg);\\n}\\n\\n.tidal-scope .bulk-demo tbody input:checked + .bulk-demo-check {\\n  border-color: var(--t-ink);\\n  background: var(--t-ink);\\n}\\n\\n.tidal-scope .bulk-demo tbody input:checked + .bulk-demo-check::after {\\n  opacity: 1;\\n}\\n\\n.tidal-scope .bulk-demo tbody label:active .bulk-demo-check {\\n  transform: scale(0.9);\\n}\\n\\n.tidal-scope .bulk-demo-sr-only {\\n  position: absolute;\\n  width: 1px;\\n  height: 1px;\\n  padding: 0;\\n  margin: -1px;\\n  overflow: hidden;\\n  clip: rect(0, 0, 0, 0);\\n  white-space: nowrap;\\n  border: 0;\\n}\\n\\n.tidal-scope .bulk-demo-footer {\\n  flex-wrap: wrap;\\n  padding: 3px 2px 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .bulk-demo-footer output {\\n  color: var(--t-ink);\\n  font-weight: 680;\\n}\\n\\n@container bulk-demo (max-width: 520px) {\\n  .tidal-scope .bulk-demo-frame {\\n    padding: 6px;\\n  }\\n\\n  .tidal-scope .bulk-demo-header {\\n    align-items: flex-end;\\n    gap: 10px;\\n  }\\n\\n  .tidal-scope .bulk-demo-header h2 {\\n    font-size: 28px;\\n  }\\n\\n  .tidal-scope .bulk-demo-header button {\\n    min-width: 0;\\n    max-width: 42%;\\n    font-size: 16px;\\n    overflow-wrap: anywhere;\\n  }\\n\\n  .tidal-scope .bulk-demo table {\\n    min-width: 620px;\\n  }\\n}\\n\\n@media (hover: none) and (pointer: coarse) {\\n  .tidal-scope .bulk-demo-header button {\\n    font-size: 16px;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .tidal-scope .bulk-demo tbody tr,\\n  .tidal-scope .bulk-demo-header button,\\n  .tidal-scope .bulk-demo-check {\\n    animation: none;\\n    transition: none;\\n  }\\n\\n  .tidal-scope .bulk-demo-header button:active,\\n  .tidal-scope .bulk-demo tbody label:active .bulk-demo-check {\\n    transform: none;\\n  }\\n}\\n\\n@keyframes bulk-demo-row-in {\\n  from {\\n    opacity: 0;\\n    transform: translateY(6px);\\n  }\\n  to {\\n    opacity: 1;\\n    transform: none;\\n  }\\n}\";\n\nconst INITIAL_RELEASES = [\n  {\n    id: \"REL-214\",\n    title: \"Workspace navigation\",\n    owner: \"Mina Cole\",\n    status: \"Needs review\",\n    updated: \"Today, 09:40\",\n  },\n  {\n    id: \"REL-209\",\n    title: \"Usage summary\",\n    owner: \"Jon Bell\",\n    status: \"Draft\",\n    updated: \"Yesterday, 16:15\",\n  },\n  {\n    id: \"REL-203\",\n    title: \"Invoice preview\",\n    owner: \"Inez Park\",\n    status: \"Ready\",\n    updated: \"Oct 12, 11:08\",\n  },\n  {\n    id: \"REL-198\",\n    title: \"Search refinements\",\n    owner: \"Ari Moss\",\n    status: \"Needs review\",\n    updated: \"Oct 11, 14:22\",\n  },\n] as const;\n\ntype ReleaseStatus = \"Draft\" | \"Needs review\" | \"Ready\";\n\ntype ReleaseRecord = Omit<(typeof INITIAL_RELEASES)[number], \"status\"> & {\n  status: ReleaseStatus;\n};\n\nfunction ReadyIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n      <path\n        d=\"m3.5 8.2 2.8 2.7 6.2-6\"\n        stroke=\"currentColor\"\n        strokeWidth=\"1.5\"\n      />\n    </svg>\n  );\n}\n\nfunction ReviewIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n      <path\n        d=\"M8 2.5 13 5v3.8c0 2.2-1.6 3.8-5 4.7-3.4-.9-5-2.5-5-4.7V5l5-2.5Z\"\n        stroke=\"currentColor\"\n        strokeWidth=\"1.3\"\n      />\n      <path d=\"M8 5.3v3.4M8 11h.01\" stroke=\"currentColor\" strokeWidth=\"1.3\" />\n    </svg>\n  );\n}\n\nexport function BulkActionBarDemo() {\n  const [releases, setReleases] =\n    useState<readonly ReleaseRecord[]>(INITIAL_RELEASES);\n  const [selectedIds, setSelectedIds] = useState<ReadonlySet<string>>(\n    () => new Set([INITIAL_RELEASES[0].id, INITIAL_RELEASES[1].id]),\n  );\n  const [message, setMessage] = useState(\"Two sample releases selected.\");\n  const [actionAnnouncement, setActionAnnouncement] = useState(\"\");\n  const [tableOverflows, setTableOverflows] = useState(false);\n  const selectAllRef = useRef<HTMLButtonElement>(null);\n  const tableRegionRef = useRef<HTMLDivElement>(null);\n  const tableRef = useRef<HTMLTableElement>(null);\n  const restoreSelectAllFocus = useRef(false);\n\n  useLayoutEffect(() => {\n    if (!restoreSelectAllFocus.current || selectedIds.size !== 0) return;\n    restoreSelectAllFocus.current = false;\n    selectAllRef.current?.focus({ preventScroll: true });\n  }, [selectedIds]);\n\n  useLayoutEffect(() => {\n    const region = tableRegionRef.current;\n    const table = tableRef.current;\n    if (!region || !table) return;\n    let active = true;\n    const updateOverflow = () => {\n      if (!active) return;\n      setTableOverflows(region.scrollWidth > region.clientWidth + 1);\n    };\n    updateOverflow();\n    if (typeof ResizeObserver === \"undefined\") {\n      return () => {\n        active = false;\n      };\n    }\n    const observer = new ResizeObserver(updateOverflow);\n    observer.observe(region);\n    observer.observe(table);\n    return () => {\n      active = false;\n      observer.disconnect();\n    };\n  }, []);\n\n  function setSelectedStatus(status: ReleaseStatus) {\n    const count = selectedIds.size;\n    setReleases((current) =>\n      current.map((release) =>\n        selectedIds.has(release.id) ? { ...release, status } : release,\n      ),\n    );\n    const nextMessage = `${count} sample ${count === 1 ? \"release\" : \"releases\"} marked ${status.toLowerCase()}.`;\n    setMessage(nextMessage);\n    setActionAnnouncement(nextMessage);\n  }\n\n  const actions: readonly TidalBulkAction[] = [\n    {\n      id: \"ready\",\n      label: \"Mark ready\",\n      icon: <ReadyIcon />,\n      emphasis: \"strong\",\n      onAction: () => setSelectedStatus(\"Ready\"),\n    },\n    {\n      id: \"review\",\n      label: \"Needs review\",\n      icon: <ReviewIcon />,\n      onAction: () => setSelectedStatus(\"Needs review\"),\n    },\n  ];\n\n  return (\n    <section className=\"bulk-demo\" aria-label=\"Release queue preview\">\n      <div className=\"bulk-demo-frame\">\n        <header className=\"bulk-demo-header\">\n          <div>\n            <span>October cycle</span>\n            <h2>Release queue</h2>\n          </div>\n          <button\n            ref={selectAllRef}\n            type=\"button\"\n            onClick={() => {\n              setSelectedIds(new Set(releases.map((release) => release.id)));\n              setMessage(`All ${releases.length} sample releases selected.`);\n            }}\n          >\n            Select all\n          </button>\n        </header>\n\n        <div\n          ref={tableRegionRef}\n          className=\"bulk-demo-table-region\"\n          role=\"region\"\n          aria-label=\"Sample releases\"\n          tabIndex={tableOverflows ? 0 : undefined}\n          data-overflow={tableOverflows || undefined}\n          data-qa=\"bulk-demo-scroll-region\"\n        >\n          <table ref={tableRef}>\n            <thead>\n              <tr>\n                <th scope=\"col\">Select</th>\n                <th scope=\"col\">Release</th>\n                <th scope=\"col\">Owner</th>\n                <th scope=\"col\">Status</th>\n                <th scope=\"col\">Updated</th>\n              </tr>\n            </thead>\n            <tbody>\n              {releases.map((release, index) => {\n                const checked = selectedIds.has(release.id);\n                return (\n                  <tr\n                    key={release.id}\n                    data-selected={checked || undefined}\n                    style={\n                      {\n                        \"--bulk-demo-index\": index,\n                      } as React.CSSProperties\n                    }\n                  >\n                    <td>\n                      <label>\n                        <input\n                          type=\"checkbox\"\n                          checked={checked}\n                          onChange={(event) => {\n                            const next = new Set(selectedIds);\n                            if (event.currentTarget.checked)\n                              next.add(release.id);\n                            else next.delete(release.id);\n                            setSelectedIds(next);\n                            setMessage(\n                              `${next.size} sample ${next.size === 1 ? \"release\" : \"releases\"} selected.`,\n                            );\n                          }}\n                        />\n                        <span className=\"bulk-demo-check\" aria-hidden=\"true\" />\n                        <span className=\"bulk-demo-sr-only\">\n                          Select {release.title}\n                        </span>\n                      </label>\n                    </td>\n                    <th scope=\"row\">\n                      <span>{release.id}</span>\n                      <strong>{release.title}</strong>\n                    </th>\n                    <td>{release.owner}</td>\n                    <td>\n                      <span data-status={release.status}>{release.status}</span>\n                    </td>\n                    <td>{release.updated}</td>\n                  </tr>\n                );\n              })}\n            </tbody>\n          </table>\n        </div>\n\n        <TidalBulkActionBar\n          label=\"Actions for selected releases\"\n          selectedCount={selectedIds.size}\n          selectionLabel={(count) =>\n            count === 1 ? \"1 release selected\" : `${count} releases selected`\n          }\n          meta=\"Apply a status to the current selection\"\n          actions={actions}\n          clearLabel=\"Clear\"\n          clearAccessibleLabel=\"Clear selected releases\"\n          onClear={() => {\n            restoreSelectAllFocus.current = true;\n            setSelectedIds(new Set());\n            setMessage(\"Selection cleared.\");\n          }}\n        />\n\n        <footer className=\"bulk-demo-footer\">\n          <output>{message}</output>\n          <span>Fictional releases for this local sample.</span>\n          <span className=\"bulk-demo-sr-only\" role=\"status\">\n            {actionAnnouncement}\n          </span>\n        </footer>\n      </div>\n    </section>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <BulkActionBarDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/bulk-action-bar.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [],
  "events": [
    {
      "name": "onChange",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onClear",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onClick",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Existing demo label or ARIA prop",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Preserve browser focus order and visible focus.",
    "errorAnnouncement": "No error announcement path is present in this demo; the consumer owns validation messaging.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "No error fixture is exposed by the existing demo; inject a consumer-owned failure state before production use.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
