{"id":30770444,"url":"https://github.com/techwithty/action-bar","last_synced_at":"2025-09-04T23:06:53.055Z","repository":{"id":312802145,"uuid":"1048793763","full_name":"TechWithTy/action-bar","owner":"TechWithTy","description":"Global Command Palette (Action Bar) for React—provider + drop-in Web Component with UMD build. Keyboard shortcuts, search, and extensible commands for Next.js and SPAs.","archived":false,"fork":false,"pushed_at":"2025-09-02T03:36:18.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-02T05:35:08.486Z","etag":null,"topics":["action-bar","command-palette","design-system","esm","frontend","keyboard-shortcuts","library","nextjs","productivity","radix","react","search","shadcn","spa","tsup","typescript","ui","umd","web-component"],"latest_commit_sha":null,"homepage":"https://www.cybershoptech.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TechWithTy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-02T03:21:32.000Z","updated_at":"2025-09-02T03:36:20.000Z","dependencies_parsed_at":"2025-09-02T05:35:10.370Z","dependency_job_id":"b460f8b5-55ee-455d-a3d5-648b56e74d3e","html_url":"https://github.com/TechWithTy/action-bar","commit_stats":null,"previous_names":["techwithty/action-bar"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/TechWithTy/action-bar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Faction-bar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Faction-bar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Faction-bar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Faction-bar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechWithTy","download_url":"https://codeload.github.com/TechWithTy/action-bar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Faction-bar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273685604,"owners_count":25149722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action-bar","command-palette","design-system","esm","frontend","keyboard-shortcuts","library","nextjs","productivity","radix","react","search","shadcn","spa","tsup","typescript","ui","umd","web-component"],"created_at":"2025-09-04T23:05:21.538Z","updated_at":"2025-09-04T23:06:53.034Z","avatar_url":"https://github.com/TechWithTy.png","language":"TypeScript","readme":"# @deal-scale/action-bar\n\nGlobal Command Palette (Action Bar) for React apps and as a drop‑in Web Component. Ships ESM/CJS for apps and a UMD bundle for direct browser embeds. Includes providers, a standalone palette, and a small web API for imperative control.\n\n- React: use `CommandPaletteProvider` or `ActionBarRoot`\n- Web: load the UMD bundle and call `window.DealActionBarUMD.mount()`\n- Docs: see `_docs/` in this package for in-depth guides\n\n## Contents\n- Features\n- Installation (npm/pnpm)\n- Quick Start (React)\n- Quick Start (Browser UMD)\n- Standalone Provider\n- Commands and API\n- Styling / Theming\n- Build \u0026 Local Development\n- Deploying the Browser Bundle\n- Docs Index (internal)\n\n## Features\n- Global command palette with keyboard shortcuts (e.g., Cmd/Ctrl+K)\n- Searchable actions with groups, icons, and sections\n- Pluggable command sources, async suggestions, AI hooks\n- React provider for context-driven actions\n- Framework-agnostic Web Component via UMD for any site\n\n## Installation (npm/pnpm)\n```bash\npnpm add @deal-scale/action-bar\n# or\nnpm i @deal-scale/action-bar\n```\n\n## Quick Start (React)\nWrap your app with the provider and render the root.\n\n```tsx\nimport React from 'react'\nimport { ActionBarRoot, CommandPaletteProvider } from '@deal-scale/action-bar'\n\nexport default function App() {\n  return (\n    \u003cCommandPaletteProvider\n      shortcuts={[['mod', 'k']]} // Cmd/Ctrl + K\n      commands={[\n        { id: 'open-settings', label: 'Open Settings', run: () =\u003e console.log('settings') },\n        { id: 'goto-dashboard', label: 'Go to Dashboard', href: '/dashboard' },\n      ]}\n    \u003e\n      \u003cActionBarRoot /\u003e\n      {/* your app */}\n    \u003c/CommandPaletteProvider\u003e\n  )\n}\n```\n\n### Provider props (essentials)\n- `shortcuts`: array of key combos (e.g., `[ ['mod','k'] ]`)\n- `commands`: array of commands `{ id, label, run? | href?, icon?, section? }`\n- `onOpenChange? (boolean)`: open state callback\n- `suggest? (query) =\u003e Promise\u003cCommand[]\u003e`: async suggestions\n\n## Quick Start (Browser UMD)\nThe UMD build exposes a global `DealActionBarUMD`.\n\n```html\n\u003c!-- 1) Load the bundle (local or from a CDN) --\u003e\n\u003cscript src=\"/dist/umd/index.js\"\u003e\u003c/script\u003e\n\u003c!-- Example CDN (once you publish to npm): --\u003e\n\u003c!-- \u003cscript src=\"https://unpkg.com/@deal-scale/action-bar/dist/umd/index.js\"\u003e\u003c/script\u003e --\u003e\n\n\u003c!-- 2) Mount somewhere after DOM is ready --\u003e\n\u003cscript\u003e\n  const unmount = window.DealActionBarUMD.mount({\n    shortcuts: [['mod','k']],\n    commands: [\n      { id: 'open-settings', label: 'Open Settings', run: () =\u003e alert('settings') },\n      { id: 'help', label: 'Help Center', href: '/help' },\n    ],\n  })\n\n  // Later, to clean up:\n  // unmount()\n\u003c/script\u003e\n```\n\n### UMD Options\n- `shortcuts`: same as React\n- `commands`: same as React\n- `container?`: HTMLElement to render into; defaults to `document.body`\n- `theme?`: `{ className?: string }` for host wrapper\n\n## Standalone Provider (React)\nIf you only need the provider (e.g., to wire your own UI):\n```tsx\nimport { StandaloneCommandPaletteProvider } from '@deal-scale/action-bar'\n```\n\n## Commands and API\nA command is a simple object:\n```ts\nexport type Command = {\n  id: string\n  label: string\n  section?: string\n  icon?: React.ReactNode\n  href?: string // navigate\n  run?: () =\u003e void // imperative action\n}\n```\n- Use `href` for navigation or `run` for side effects.\n- Group by `section` for visual organization.\n- Provide `suggest(query)` to stream or return async commands.\n\n## Styling / Theming\nThis package ships unstyled primitives integrated with your design system. See examples in:\n- `components/command/CommandPalette.tsx`\n- `components/command/CommandInputTray.tsx`\n\nIf you use shadcn/radix, slot our components into your tokens. For a basic look-and-feel, add a host class via provider prop `theme={{ className: 'your-theme' }}` and style accordingly.\n\n## Build \u0026 Local Development\nThis package uses `tsup`.\n\nScripts in `package.json`:\n- `pnpm build` — builds ESM/CJS and UMD bundles\n- `pnpm build:lib` — ESM/CJS + types\n- `pnpm build:umd` — IIFE UMD for browsers at `dist/umd/index.js`\n\n```bash\npnpm i\npnpm build\n```\n\n## Deploying the Browser Bundle\nYou can deploy `dist/umd/index.js` on any static host or CDN.\n\n- Local hosting: copy `dist/umd/index.js` to your public directory and reference it with `\u003cscript src=\"/dist/umd/index.js\"\u003e\u003c/script\u003e`\n- CDN (after publishing to npm):\n  - unpkg: `https://unpkg.com/@deal-scale/action-bar/dist/umd/index.js`\n  - jsDelivr: `https://cdn.jsdelivr.net/npm/@deal-scale/action-bar/dist/umd/index.js`\n\nFor custom domains, serve from your site (e.g., `https://www.cybershoptech.com/assets/action-bar/index.js`) and update the script tag accordingly.\n\n## Docs Index (internal)\nThis repo includes more detailed, task-focused docs under `_docs/`:\n- `_docs/embed-npm.md` — React/Next.js app integration via npm\n- `_docs/embed-script.md` — Direct `\u003cscript\u003e` embed for any website\n- `_docs/embed-with-api-key.md` — Securing usage with an API key pattern\n- `_docs/browser-extension.md` — Notes for browser extension contexts\n\nEach doc contains copy-paste snippets and deployment tips specific to that scenario.\n\n## License\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechwithty%2Faction-bar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechwithty%2Faction-bar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechwithty%2Faction-bar/lists"}