{"_id":"@anil-labs/select-core","name":"@anil-labs/select-core","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@anil-labs/select-core","version":"0.1.0","description":"Framework-agnostic core for @anil-labs/select — the headless select/combobox state machine, option normalization, filtering and tree helpers, plus the shared stylesheet.","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./styles.css":{"types":"./styles.css.d.ts","default":"./dist/styles.css"},"./scss":"./src/styles/index.scss","./scss/*":"./src/styles/*","./package.json":"./package.json"},"sideEffects":["**/*.css","**/*.scss"],"keywords":["select","combobox","multiselect","tags","autocomplete","tree-select","headless","framework-agnostic","typescript","a11y"],"engines":{"node":">=20"},"license":"MIT","author":"Er. Anil Kumar Thakur <anilkumarthakur60@gmail.com>","repository":{"type":"git","url":"git+https://github.com/anilkumarthakur60/select.git","directory":"packages/core"},"homepage":"https://github.com/anilkumarthakur60/select/tree/main/packages/core#readme","bugs":"https://github.com/anilkumarthakur60/select/issues","publishConfig":{"access":"public"},"devDependencies":{"@vitest/coverage-v8":"^4.1.5","sass":"^1.99.0","tsup":"^8.5.1","typescript":"~6.0.0","vitest":"^4.1.5","@types/node":"^24.12.2","jsdom":"^29.0.2"},"scripts":{"clean":"rm -rf dist coverage","build":"tsup && pnpm run build:css","build:css":"sass --no-source-map --load-path=src/styles src/styles/index.scss dist/styles.css","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint ."},"_nodeVersion":"24.18.0","_id":"@anil-labs/select-core@0.1.0","dist":{"integrity":"sha512-DvSw/UEHMvE3I3xg8KdxilY3tZc7adKugIqoz2Tzd5OqXtPOKnKli8DW8i5GCT65U+Vs3kKsxPdmpK6Zc9kkZA==","shasum":"5e1fc9279d6dd7e1a066a1226c3773322b084f6b","tarball":"https://registry.npmjs.org/@anil-labs/select-core/-/select-core-0.1.0.tgz","fileCount":24,"unpackedSize":119222,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCAqfLBTdEgSraD1fRYoEDho8bIRvOxCePSatYWg5MdLwIhANNVFxa5QGW7dgM7rTcKT+dGIzL6PquILuqqK04nc5/l"}]},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"directories":{},"maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/select-core_0.1.0_1784650666167_0.6146586295744498"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-21T16:17:46.026Z","0.1.0":"2026-07-21T16:17:46.300Z","modified":"2026-07-21T16:17:46.532Z"},"maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"description":"Framework-agnostic core for @anil-labs/select — the headless select/combobox state machine, option normalization, filtering and tree helpers, plus the shared stylesheet.","homepage":"https://github.com/anilkumarthakur60/select/tree/main/packages/core#readme","keywords":["select","combobox","multiselect","tags","autocomplete","tree-select","headless","framework-agnostic","typescript","a11y"],"repository":{"type":"git","url":"git+https://github.com/anilkumarthakur60/select.git","directory":"packages/core"},"author":"Er. Anil Kumar Thakur <anilkumarthakur60@gmail.com>","bugs":"https://github.com/anilkumarthakur60/select/issues","license":"MIT","readme":"# @anil-labs/select-core\n\nFramework-agnostic state machine, option normalisation and styles behind\n[`@anil-labs/select`](https://github.com/anilkumarthakur60/select). No\nframework dependency — this is the package every adapter is built on.\n\nReach for it directly when you are writing your own adapter, or driving a select\nfrom a framework that has no published adapter yet.\n\n## Install\n\n```sh\nnpm install @anil-labs/select-core\n```\n\n## Usage\n\n```ts\nimport { createSelectMachine } from '@anil-labs/select-core'\n\nconst machine = createSelectMachine({\n  options: ['apple', 'banana', 'cherry'],\n  mode: 'single',\n  onChange: (value) => console.log(value),\n})\n\nconst unsubscribe = machine.subscribe(() => render())\n\nmachine.open()\nmachine.setActiveIndex(1)\nmachine.selectActive()\n```\n\nThe machine owns all behaviour — open/close, keyboard navigation, filtering,\nsingle/multiple/tags modes, and the ARIA attribute bags. An adapter's job is\nonly to bind those bags to the host framework's DOM and re-render on notify.\n\n### Prop bags\n\n`getRootProps()`, `getControlProps()`, `getInputProps()`, `getMenuProps()` and\n`getOptionProps(index)` each return a plain object of attributes and handlers.\nEvent keys use Vue-JSX-style camelCase (`onMousedown`); adapters for frameworks\nthat expect a different casing translate them (see `toSolidProps` /\n`toSvelteProps`).\n\n## Styles\n\nThe stylesheet ships here, not in the adapters, so a single copy is shared:\n\n```ts\nimport '@anil-labs/select-core/styles.css'\n```\n\nSource Sass is exported too, if you want to override variables before\ncompiling:\n\n```scss\n@use '@anil-labs/select-core/scss/index' with (\n  $vselect-border-radius: 8px\n);\n```\n\n## Also exported\n\n`normalize`, `normalizeTree`, `walkTree`, `filterTree`, `flattenTree`,\n`defaultFilter`, `escapeRegex`, `valuesEqual`, `toggleValue`, `readAccessor`,\n`getAncestorIds`, `getLeafValues`, plus the full type surface.\n\n## Adapters\n\n| Package                                                                                               | Framework      |\n| ----------------------------------------------------------------------------------------------------- | -------------- |\n| [`@anil-labs/select-vue`](https://github.com/anilkumarthakur60/select/tree/main/packages/vue)         | Vue 3 / Nuxt   |\n| [`@anil-labs/select-react`](https://github.com/anilkumarthakur60/select/tree/main/packages/react)     | React          |\n| [`@anil-labs/select-svelte`](https://github.com/anilkumarthakur60/select/tree/main/packages/svelte)   | Svelte 5       |\n| [`@anil-labs/select-solid`](https://github.com/anilkumarthakur60/select/tree/main/packages/solid)     | Solid          |\n| [`@anil-labs/select-element`](https://github.com/anilkumarthakur60/select/tree/main/packages/element) | Web Components |\n\n## License\n\nMIT © [Er. Anil Kumar Thakur](https://github.com/anilkumarthakur60)\n","readmeFilename":"","_rev":"1-46f396bc75263c5edea6eb8fd2d0d639"}