{"_id":"@bw-ui/command-palette","_rev":"4-67c75d17e7fe602155511fb7cb67dc9d","name":"@bw-ui/command-palette","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@bw-ui/command-palette","version":"1.0.0","keywords":["command-palette","cmd-k","spotlight","search","keyboard","accessibility","vanilla-js","no-dependencies","bw-ui"],"author":{"name":"Black & White UI Engineering"},"license":"MIT","_id":"@bw-ui/command-palette@1.0.0","maintainers":[{"name":"rchoudhary.dev","email":"rchoudhary.dev@gmail.com"}],"homepage":"https://github.com/bw-ui/bw-command-palette","bugs":{"url":"https://github.com/bw-ui/bw-command-palette/issues"},"dist":{"shasum":"253c71f73ce344565184a6c37a85b33e0167077c","tarball":"https://registry.npmjs.org/@bw-ui/command-palette/-/command-palette-1.0.0.tgz","fileCount":12,"integrity":"sha512-EFi9ddDHrtCBCneHIzQJ2V/MwKlH7wEKqYHfaflBlQRFIz4KwWTI9Hcl1nbxEhjFTIzBYZ0HkbStsSMgnKC9Fw==","signatures":[{"sig":"MEYCIQDhbNoJQlcIRWwiULSKR7vSF7t1u+H2557J/sHjRFCTZwIhAIi1WtEP5DB72ItSQuVm2xoXX/Nz0R6F6RrVmAm+ia4L","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242150},"main":"dist/bw-command-palette.min.js","type":"module","types":"src/index.d.ts","module":"dist/bw-command-palette.esm.min.js","exports":{".":{"types":"./src/index.d.ts","import":"./dist/bw-command-palette.esm.min.js","require":"./dist/bw-command-palette.min.js"},"./css":"./dist/bw-command-palette.min.css"},"scripts":{"dev":"node build.js --watch","build":"node build.js"},"_npmUser":{"name":"rchoudhary.dev","email":"rchoudhary.dev@gmail.com"},"repository":{"url":"git+https://github.com/bw-ui/bw-command-palette.git","type":"git"},"_npmVersion":"10.9.3","description":"Beautiful, accessible command palette for the web. Zero dependencies.","directories":{},"_nodeVersion":"22.20.0","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.20.2"},"_npmOperationalInternal":{"tmp":"tmp/command-palette_1.0.0_1764754729392_0.9413467616628428","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bw-ui/command-palette","version":"1.0.1","keywords":["command-palette","cmd-k","spotlight","search","keyboard","accessibility","vanilla-js","no-dependencies","bw-ui"],"author":{"name":"Black & White UI Engineering"},"license":"MIT","_id":"@bw-ui/command-palette@1.0.1","maintainers":[{"name":"rchoudhary.dev","email":"rchoudhary.dev@gmail.com"}],"homepage":"https://github.com/bw-ui/bw-command-palette","bugs":{"url":"https://github.com/bw-ui/bw-command-palette/issues"},"dist":{"shasum":"c92cd005c4f0578c4b9e90f28416287e34d5a905","tarball":"https://registry.npmjs.org/@bw-ui/command-palette/-/command-palette-1.0.1.tgz","fileCount":12,"integrity":"sha512-eu0o4hOA+L7IH7p52gK0lzjSVfeLNsMLKd86lSY359WTvK8H/WZs2vwUpSFqEinNlgLyYLGGQodypC1C9TV04g==","signatures":[{"sig":"MEUCIBqVyhrr5M7pr9sa8uMyxSP04RRN7ebUngH5CbKA20aKAiEA6JVCCGW5Vx1wBSWlvMHexwXybd2uyFiKkIeqmVv2fzA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242275},"main":"dist/bw-command-palette.min.js","type":"module","types":"src/index.d.ts","module":"dist/bw-command-palette.esm.min.js","exports":{".":{"types":"./src/index.d.ts","import":"./dist/bw-command-palette.esm.min.js","require":"./dist/bw-command-palette.min.js"},"./css":"./dist/bw-command-palette.min.css"},"gitHead":"b37a62b263c656cc133fe42d85396e3c8cebb74c","scripts":{"dev":"node build.js --watch","build":"node build.js"},"_npmUser":{"name":"rchoudhary.dev","email":"rchoudhary.dev@gmail.com"},"repository":{"url":"git+https://github.com/bw-ui/bw-command-palette.git","type":"git"},"_npmVersion":"10.9.3","description":"Beautiful, accessible command palette for the web. Zero dependencies.","directories":{},"_nodeVersion":"22.20.0","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.20.2"},"_npmOperationalInternal":{"tmp":"tmp/command-palette_1.0.1_1764755389560_0.9178631505247454","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bw-ui/command-palette","version":"1.0.2","keywords":["command-palette","cmd-k","spotlight","search","keyboard","accessibility","vanilla-js","no-dependencies","bw-ui"],"author":{"name":"Black & White UI Engineering"},"license":"MIT","_id":"@bw-ui/command-palette@1.0.2","maintainers":[{"name":"rchoudhary.dev","email":"rchoudhary.dev@gmail.com"}],"homepage":"https://github.com/bw-ui/bw-command-palette","bugs":{"url":"https://github.com/bw-ui/bw-command-palette/issues"},"dist":{"shasum":"3402b6843f6f0a872b0cd9d9d362b697284c05fa","tarball":"https://registry.npmjs.org/@bw-ui/command-palette/-/command-palette-1.0.2.tgz","fileCount":12,"integrity":"sha512-xbLkt7qc6j9B1NpMzcy5yWPBCnRpFz8i7Jl2O5c857IDYJB4e6r/U2Q9Up5Nbj1eDfR0FwE8j9FY1oCQ/6yyHA==","signatures":[{"sig":"MEUCIQDvJA7R4KoV26kpSJorMMFhSRTdHWfPRzVqcKnBt1wzvwIgLUDi5KlsTS7KY05ALxn64Xh8ZQ72XsdM7KJ/kDKq0o4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242339},"main":"dist/bw-command-palette.min.js","type":"module","types":"src/index.d.ts","module":"dist/bw-command-palette.esm.min.js","exports":{".":{"types":"./src/index.d.ts","import":"./dist/bw-command-palette.esm.min.js","require":"./dist/bw-command-palette.min.js"},"./css":"./dist/bw-command-palette.min.css"},"gitHead":"b37a62b263c656cc133fe42d85396e3c8cebb74c","scripts":{"dev":"node build.js --watch","build":"node build.js"},"_npmUser":{"name":"rchoudhary.dev","email":"rchoudhary.dev@gmail.com"},"repository":{"url":"git+https://github.com/bw-ui/bw-command-palette.git","type":"git"},"_npmVersion":"10.9.3","description":"Beautiful, accessible command palette for the web. Zero dependencies.","directories":{},"_nodeVersion":"22.20.0","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.20.2"},"_npmOperationalInternal":{"tmp":"tmp/command-palette_1.0.2_1764755459427_0.15507693662373323","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@bw-ui/command-palette","version":"1.0.3","description":"Beautiful, accessible command palette for the web. Zero dependencies.","type":"module","main":"dist/bw-command-palette.min.js","module":"dist/bw-command-palette.esm.min.js","types":"src/index.d.ts","exports":{".":{"import":"./dist/bw-command-palette.esm.min.js","require":"./dist/bw-command-palette.min.js","types":"./src/index.d.ts"},"./css":"./dist/bw-command-palette.min.css"},"scripts":{"build":"node build.js","dev":"node build.js --watch"},"keywords":["command-palette","cmd-k","spotlight","search","keyboard","accessibility","vanilla-js","no-dependencies","bw-ui"],"author":{"name":"Black & White UI Engineering"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bw-ui/bw-command-palette.git"},"bugs":{"url":"https://github.com/bw-ui/bw-command-palette/issues"},"homepage":"https://github.com/bw-ui/bw-command-palette","devDependencies":{"esbuild":"^0.20.2"},"_id":"@bw-ui/command-palette@1.0.3","gitHead":"eaa413557cbc2753b09975a1e3199b9f87638cd1","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-i3GvHh4c0NOk+oq121v4lKzxzBT73ZCXx0yr5JowhDqLKoP2hDUDeVrKMRmlCfH4+ECXFHZ7MHRQFkcWFG0Yqw==","shasum":"ffdcf47043e1d6d2b8c6e1baffe08fdf9c069265","tarball":"https://registry.npmjs.org/@bw-ui/command-palette/-/command-palette-1.0.3.tgz","fileCount":6,"unpackedSize":55881,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDFG4zINxhIIYhBMkGjrSqzFrnb/3fm97xpzSU5v2zwMAiEAylPZbn8T87EtO2FZpvocD0F59qK3+WbxAYVxLED4nGs="}]},"_npmUser":{"name":"rchoudhary.dev","email":"rchoudhary.dev@gmail.com"},"directories":{},"maintainers":[{"name":"rchoudhary.dev","email":"rchoudhary.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/command-palette_1.0.3_1764769980943_0.4696609233764444"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-03T09:38:49.303Z","modified":"2025-12-03T13:53:01.312Z","1.0.0":"2025-12-03T09:38:49.587Z","1.0.1":"2025-12-03T09:49:49.761Z","1.0.2":"2025-12-03T09:50:59.583Z","1.0.3":"2025-12-03T13:53:01.114Z"},"bugs":{"url":"https://github.com/bw-ui/bw-command-palette/issues"},"author":{"name":"Black & White UI Engineering"},"license":"MIT","homepage":"https://github.com/bw-ui/bw-command-palette","keywords":["command-palette","cmd-k","spotlight","search","keyboard","accessibility","vanilla-js","no-dependencies","bw-ui"],"repository":{"type":"git","url":"git+https://github.com/bw-ui/bw-command-palette.git"},"description":"Beautiful, accessible command palette for the web. Zero dependencies.","maintainers":[{"name":"rchoudhary.dev","email":"rchoudhary.dev@gmail.com"}],"readme":"# @bw-ui/command-palette\r\n\r\nBeautiful, accessible command palette for the web. Zero dependencies.\r\n\r\n![npm version](https://img.shields.io/npm/v/@bw-ui/command-palette)\r\n![bundle size](https://img.shields.io/bundlephobia/minzip/@bw-ui/command-palette)\r\n![license](https://img.shields.io/npm/l/@bw-ui/command-palette)\r\n\r\n[Live Demo](https://bw-ui.github.io/bw-command-palette/) • [Documentation](https://github.com/bw-ui/bw-command-palette) • [npm](https://www.npmjs.com/package/@bw-ui/command-palette)\r\n\r\n## Features\r\n\r\n- ⚡ **Lightweight** — ~6KB gzipped, zero dependencies\r\n- 🔍 **Fuzzy Search** — Smart matching with scoring and highlighting\r\n- ⌨️ **Keyboard First** — Full navigation with ↑↓ Enter Escape\r\n- 📱 **Responsive** — Works beautifully on mobile\r\n- 🎨 **Themeable** — Light, dark, or system preference\r\n- ♿ **Accessible** — Full ARIA support, focus trap, screen reader announcements\r\n- 🔄 **Nested Commands** — Drill-down submenus with breadcrumb navigation\r\n- ⏱️ **Async Support** — Load commands dynamically\r\n- 📜 **Recent History** — Remembers frequently used commands\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @bw-ui/command-palette\r\n```\r\n\r\n## Quick Start\r\n\r\n```js\r\nimport { BWCommandPalette } from '@bw-ui/command-palette';\r\nimport '@bw-ui/command-palette/css';\r\n\r\nconst cmd = new BWCommandPalette({\r\n  trigger: 'mod+k',\r\n  commands: [\r\n    {\r\n      id: 'new-file',\r\n      label: 'New File',\r\n      icon: '📄',\r\n      shortcut: 'mod+n',\r\n      action: () => createFile(),\r\n    },\r\n    {\r\n      id: 'settings',\r\n      label: 'Settings',\r\n      icon: '⚙️',\r\n      children: [\r\n        { id: 'theme', label: 'Theme', action: () => openTheme() },\r\n        { id: 'account', label: 'Account', action: () => openAccount() },\r\n      ],\r\n    },\r\n  ],\r\n});\r\n```\r\n\r\n## CDN Usage\r\n\r\n```html\r\n<link\r\n  rel=\"stylesheet\"\r\n  href=\"https://unpkg.com/@bw-ui/command-palette/dist/bw-command-palette.min.css\"\r\n/>\r\n<script src=\"https://unpkg.com/@bw-ui/command-palette/dist/bw-command-palette.min.js\"></script>\r\n\r\n<script>\r\n  const cmd = new BWCommandPalette({\r\n    trigger: 'mod+k',\r\n    commands: [\r\n      { id: 'home', label: 'Go Home', action: () => (location.href = '/') },\r\n    ],\r\n  });\r\n</script>\r\n```\r\n\r\n## API\r\n\r\n### Options\r\n\r\n| Option                | Type                            | Default                | Description                       |\r\n| --------------------- | ------------------------------- | ---------------------- | --------------------------------- |\r\n| `trigger`             | `string \\| false`               | `'mod+k'`              | Hotkey to open (false to disable) |\r\n| `commands`            | `Command[] \\| Function`         | `[]`                   | Commands array or async provider  |\r\n| `placeholder`         | `string`                        | `'Search commands...'` | Input placeholder                 |\r\n| `emptyMessage`        | `string`                        | `'No commands found'`  | Empty state message               |\r\n| `closeOnSelect`       | `boolean`                       | `true`                 | Close after selecting command     |\r\n| `closeOnClickOutside` | `boolean`                       | `true`                 | Close on backdrop click           |\r\n| `maxResults`          | `number`                        | `50`                   | Maximum results to show           |\r\n| `debounceMs`          | `number`                        | `150`                  | Search debounce delay             |\r\n| `rememberRecent`      | `boolean`                       | `true`                 | Remember recent commands          |\r\n| `maxRecent`           | `number`                        | `5`                    | Max recent commands to remember   |\r\n| `theme`               | `'light' \\| 'dark' \\| 'system'` | `'system'`             | Color theme                       |\r\n| `width`               | `string`                        | `'640px'`              | Dialog width                      |\r\n| `maxHeight`           | `string`                        | `'420px'`              | Max dialog height                 |\r\n| `zIndex`              | `number`                        | `9999`                 | CSS z-index                       |\r\n\r\n### Command Object\r\n\r\n```js\r\n{\r\n  id: 'unique-id',           // Required: unique identifier\r\n  label: 'Command Name',     // Required: display text\r\n  icon: '📄',                // Optional: emoji, HTML, or element\r\n  shortcut: 'mod+n',         // Optional: display-only shortcut hint\r\n  keywords: ['create'],      // Optional: additional search terms\r\n  group: 'File',             // Optional: group header\r\n  description: 'Details',    // Optional: secondary text\r\n  disabled: false,           // Optional: disable selection\r\n  hidden: false,             // Optional: hide from results\r\n  children: [],              // Optional: nested commands\r\n  action: (cmd) => {},       // Optional: callback on select\r\n}\r\n```\r\n\r\n### Methods\r\n\r\n```js\r\ncmd.open();              // Open palette\r\ncmd.close();             // Close palette\r\ncmd.toggle();            // Toggle open/close\r\n\r\ncmd.setCommands([...]);  // Replace all commands\r\ncmd.addCommand({...});   // Add a command\r\ncmd.removeCommand('id'); // Remove by ID\r\n\r\ncmd.on('open', () => {});\r\ncmd.on('close', () => {});\r\ncmd.on('select', (command) => {});\r\ncmd.on('query', (query) => {});\r\n\r\ncmd.destroy();           // Cleanup\r\n```\r\n\r\n### Dynamic Commands\r\n\r\n```js\r\nconst cmd = new BWCommandPalette({\r\n  commands: async (query) => {\r\n    const results = await fetch(`/api/search?q=${query}`);\r\n    return results.map((item) => ({\r\n      id: item.id,\r\n      label: item.name,\r\n      action: () => navigate(item.url),\r\n    }));\r\n  },\r\n});\r\n```\r\n\r\n### Nested Commands\r\n\r\n```js\r\nconst cmd = new BWCommandPalette({\r\n  commands: [\r\n    {\r\n      id: 'settings',\r\n      label: 'Settings',\r\n      icon: '⚙️',\r\n      children: [\r\n        {\r\n          id: 'appearance',\r\n          label: 'Appearance',\r\n          children: [\r\n            { id: 'light', label: 'Light', action: () => setTheme('light') },\r\n            { id: 'dark', label: 'Dark', action: () => setTheme('dark') },\r\n          ],\r\n        },\r\n      ],\r\n    },\r\n  ],\r\n});\r\n```\r\n\r\n## Styling\r\n\r\nCustomize with CSS variables:\r\n\r\n```css\r\n.bw-cmd-root {\r\n  --bw-cmd-bg: #ffffff;\r\n  --bw-cmd-text: #1f2937;\r\n  --bw-cmd-accent: #3b82f6;\r\n  --bw-cmd-border: #e5e7eb;\r\n  --bw-cmd-radius: 16px;\r\n}\r\n```\r\n\r\n## Browser Support\r\n\r\nChrome 80+, Firefox 75+, Safari 14+, Edge 80+\r\n\r\n## License\r\n\r\nMIT © Black & White UI Engineering\r\n\r\n---\r\n\r\n**Black & White UI** — Engineered with Precision\r\n","readmeFilename":"README.md"}