{"_id":"@alekstar79/flip-combo","_rev":"3-b4259da516e91520ae6f9165942e7254","name":"@alekstar79/flip-combo","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@alekstar79/flip-combo","version":"1.0.0","keywords":["calculator","calendar","flipper","typescript","vanilla","framework-agnostic","vue","react"],"author":{"name":"Aleksey Tarasenko","email":"alekstar79@yandex.ru"},"license":"MIT","_id":"@alekstar79/flip-combo@1.0.0","maintainers":[{"name":"alekstar79","email":"alekstar79@yandex.ru"}],"homepage":"https://github.com/alekstar79/flip-combo#readme","bugs":{"url":"https://github.com/alekstar79/flip-combo/issues"},"dist":{"shasum":"1d4a09486b7db69bfa65242799090d224f487233","tarball":"https://registry.npmjs.org/@alekstar79/flip-combo/-/flip-combo-1.0.0.tgz","fileCount":47,"integrity":"sha512-24ccgjJ6UC86pAnnImbernxFPAeK+oc98kpYxK9k8GYUWKA41UeG8HY1yR3R6BE1DB/gOQGgUHRh5ubYmFAOqA==","signatures":[{"sig":"MEYCIQDpmDNAoSBDqEeBg0FwEotuLtr08wSXku4pfbZOBIwsKAIhAPPZ0CCK//WY8d5q2C+QbcO7Oor/VJnmHxYIx57jx0FZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103593},"type":"module","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./calc":{"types":"./dist/calc/index.d.ts","import":"./dist/calc/index.js"},"./host":{"types":"./dist/host/index.d.ts","import":"./dist/host/index.js"},"./utils":{"types":"./dist/utils/index.d.ts","import":"./dist/utils/index.js"},"./flipper":{"types":"./dist/flipper/index.d.ts","import":"./dist/flipper/index.js"},"./calendar":{"types":"./dist/calendar/index.d.ts","import":"./dist/calendar/index.js"},"./style.css":"./dist/style.css","./package.json":"./package.json"},"gitHead":"613bf74f99e5b0181623940557db24fc7e704fd6","private":false,"scripts":{"dev":"vite","test":"vitest run","dev:calc":"vite --open /examples/calc/","build:lib":"vite build --config vite.lib.config.ts","dev:combo":"vite --open /examples/combo/","typecheck":"tsc --noEmit","build:demo":"tsc --noEmit && vite build","test:watch":"vitest","build:pages":"cross-env-shell GH_PAGES=true \"tsc --noEmit && vite build\"","dev:calendar":"vite --open /examples/calendar/","preview:demo":"vite preview --outDir demo-dist","preview:pages":"cross-env-shell GH_PAGES=true vite preview --outDir demo-dist","prepublishOnly":"npm run typecheck && npm run test && npm run build:lib"},"_npmUser":{"name":"alekstar79","email":"alekstar79@yandex.ru"},"repository":{"url":"git+https://github.com/alekstar79/flip-combo.git","type":"git"},"_npmVersion":"10.9.9","description":"Vanilla TypeScript calculator + calendar + 3D flipper. Framework-agnostic, zero dependencies.","directories":{},"sideEffects":["**/*.css","**/*.scss"],"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"devDependencies":{"vite":"^8.3.0","vitest":"^5.0.0","cross-env":"^10.1.0","typescript":"^5.7.2","@types/node":"^22.20.2","sass-embedded":"^1.83.0","vite-plugin-dts":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/flip-combo_1.0.0_1789134183168_0.8827296398186657","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@alekstar79/flip-combo","version":"1.0.1","keywords":["calculator","calendar","flipper","typescript","vanilla","framework-agnostic","vue","react"],"author":{"name":"Aleksey Tarasenko","email":"alekstar79@yandex.ru"},"license":"MIT","_id":"@alekstar79/flip-combo@1.0.1","maintainers":[{"name":"alekstar79","email":"alekstar79@yandex.ru"}],"homepage":"https://github.com/alekstar79/flip-combo#readme","bugs":{"url":"https://github.com/alekstar79/flip-combo/issues"},"dist":{"shasum":"0cc00cc1625c152be3aa68ac430188ea13868035","tarball":"https://registry.npmjs.org/@alekstar79/flip-combo/-/flip-combo-1.0.1.tgz","fileCount":47,"integrity":"sha512-oklWwo/20y3sYAoZO7aw34JYAaFTZ9ACJCtv/y5kOOaqQn9G7CiQhz0s3nDNPSS0Pvd0+zfMTGR4T4PrARWedg==","signatures":[{"sig":"MEUCIQDdWc7avX9fX85lSbWrVRhTeUureRF4OHOdQ83ozHOZ9AIgd0mLmB6pkMDzBQpzW6zO+ho8QfqOXfCKhLgjfz3F6nE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCYE1TcDyUdmGhPz3C5gmg6JU46EDpThP+nM89dgLkTpwIgTGCH+Dou/2v1mhcl+sswc+sjrTAQPpC7J2zVk0fzxiU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103651},"type":"module","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./calc":{"types":"./dist/calc/index.d.ts","import":"./dist/calc/index.js"},"./host":{"types":"./dist/host/index.d.ts","import":"./dist/host/index.js"},"./utils":{"types":"./dist/utils/index.d.ts","import":"./dist/utils/index.js"},"./flipper":{"types":"./dist/flipper/index.d.ts","import":"./dist/flipper/index.js"},"./calendar":{"types":"./dist/calendar/index.d.ts","import":"./dist/calendar/index.js"},"./style.css":"./dist/style.css","./package.json":"./package.json"},"gitHead":"d18a82c674049ff3c3410915c4bcc1e5cb4a5288","private":false,"scripts":{"dev":"vite","test":"vitest run","dev:calc":"vite --open /examples/calc/","build:lib":"vite build --config vite.lib.config.ts","dev:combo":"vite --open /examples/combo/","typecheck":"tsc --noEmit","build:demo":"tsc --noEmit && vite build","test:watch":"vitest","build:pages":"cross-env-shell GH_PAGES=true \"tsc --noEmit && vite build\"","dev:calendar":"vite --open /examples/calendar/","preview:demo":"vite preview --outDir demo-dist","preview:pages":"cross-env-shell GH_PAGES=true vite preview --outDir demo-dist","prepublishOnly":"npm run typecheck && npm run test && npm run build:lib"},"_npmUser":{"name":"alekstar79","email":"alekstar79@yandex.ru"},"repository":{"url":"git+https://github.com/alekstar79/flip-combo.git","type":"git"},"_npmVersion":"10.9.9","description":"Vanilla TypeScript calculator + calendar + 3D flipper. Framework-agnostic, zero dependencies.","directories":{},"sideEffects":["**/*.css","**/*.scss"],"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"devDependencies":{"vite":"^8.3.0","vitest":"^5.0.0","cross-env":"^10.1.0","typescript":"^5.7.2","@types/node":"^22.20.2","sass-embedded":"^1.83.0","vite-plugin-dts":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/flip-combo_1.0.1_1789135106341_0.8772154826296685","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"_id":"@alekstar79/flip-combo@1.0.2","bugs":{"url":"https://github.com/alekstar79/flip-combo/issues"},"dist":{"shasum":"b4b432c52ca149fc9a63938ab8e1a78b1d8ea7e2","tarball":"https://registry.npmjs.org/@alekstar79/flip-combo/-/flip-combo-1.0.2.tgz","fileCount":47,"integrity":"sha512-twLe2TcY8klPxr5bqPD4M21t+CPaK+z7/n4tPu4pMR9OV5xa+PVykmSqAAu1+brgatFF+pbaubmzdxt4ZLZ0WQ==","signatures":[{"sig":"MEUCIQDUlYeJ1Zrc9mG7/THjVq456NruU44+TMzO3LlqcnhXrAIgX+tH6/LbBXDBDEF9meL29bz8a7G+njsja3copNhX25U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDSJbAkZK7/Rz7hADNj8a4wuPttpuUkJKhh9Y8yf6MlbQIgTTtZdr3z2ulRpGnRA4zwJMr03mRl0K4ZPN2L3mIo9R8="}],"unpackedSize":103699},"name":"@alekstar79/flip-combo","type":"module","author":{"name":"Aleksey Tarasenko","email":"alekstar79@yandex.ru"},"engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./calc":{"types":"./dist/calc/index.d.ts","import":"./dist/calc/index.js"},"./host":{"types":"./dist/host/index.d.ts","import":"./dist/host/index.js"},"./utils":{"types":"./dist/utils/index.d.ts","import":"./dist/utils/index.js"},"./flipper":{"types":"./dist/flipper/index.d.ts","import":"./dist/flipper/index.js"},"./calendar":{"types":"./dist/calendar/index.d.ts","import":"./dist/calendar/index.js"},"./style.css":"./dist/style.css","./package.json":"./package.json"},"gitHead":"14ce908ad2fb9ac2b09e861ef10793ca5e13acbc","license":"MIT","private":false,"scripts":{"dev":"vite","test":"vitest run","dev:calc":"vite --open /examples/calc/","build:lib":"vite build --config vite.lib.config.ts","dev:combo":"vite --open /examples/combo/","typecheck":"tsc --noEmit","build:demo":"tsc --noEmit && vite build","test:watch":"vitest","build:pages":"cross-env-shell GH_PAGES=true \"tsc --noEmit && vite build\"","dev:calendar":"vite --open /examples/calendar/","preview:demo":"vite preview --outDir demo-dist","preview:pages":"cross-env-shell GH_PAGES=true vite preview --outDir demo-dist","prepublishOnly":"npm run typecheck && npm run test && npm run build:lib"},"version":"1.0.2","_npmUser":{"name":"alekstar79","email":"alekstar79@yandex.ru"},"homepage":"https://github.com/alekstar79/flip-combo#readme","keywords":["calculator","calendar","flipper","typescript","vanilla","framework-agnostic","vue","react"],"repository":{"url":"git+https://github.com/alekstar79/flip-combo.git","type":"git"},"_npmVersion":"10.9.9","description":"Vanilla TypeScript calculator + calendar + 3D flipper. Framework-agnostic, zero dependencies.","directories":{},"maintainers":[{"name":"alekstar79","email":"alekstar79@yandex.ru"}],"sideEffects":["**/*.css","**/*.scss"],"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"devDependencies":{"vite":"^8.3.0","vitest":"^5.0.0","cross-env":"^10.1.0","typescript":"^5.7.2","@types/node":"^22.20.2","sass-embedded":"^1.83.0","vite-plugin-dts":"^5.1.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/flip-combo_1.0.2_1789217873934_0.9392472478460885"}}},"time":{"created":"2026-09-11T13:43:02.932Z","modified":"2026-09-12T12:57:54.184Z","1.0.0":"2026-09-11T13:43:03.381Z","1.0.1":"2026-09-11T13:58:26.432Z","1.0.2":"2026-09-12T12:57:54.005Z"},"bugs":{"url":"https://github.com/alekstar79/flip-combo/issues"},"author":{"name":"Aleksey Tarasenko","email":"alekstar79@yandex.ru"},"license":"MIT","homepage":"https://github.com/alekstar79/flip-combo#readme","keywords":["calculator","calendar","flipper","typescript","vanilla","framework-agnostic","vue","react"],"repository":{"url":"git+https://github.com/alekstar79/flip-combo.git","type":"git"},"description":"Vanilla TypeScript calculator + calendar + 3D flipper. Framework-agnostic, zero dependencies.","maintainers":[{"name":"alekstar79","email":"alekstar79@yandex.ru"}],"readme":"# Vanilla TypeScript calculator + calendar + 3D flipper.\n\n[![Vite](https://img.shields.io/github/package-json/dependency-version/alekstar79/flip-combo/dev/vite?logo=vite&logoColor=white&label=Vite)](https://github.com/alekstar79/flip-combo)\n[![TypeScript](https://img.shields.io/github/package-json/dependency-version/alekstar79/flip-combo/dev/typescript?logo=typescript&logoColor=white&label=TypeScript)](https://github.com/alekstar79/flip-combo)\n[![Vitest](https://img.shields.io/github/package-json/dependency-version/alekstar79/flip-combo/dev/vitest?logo=vitest&logoColor=white&label=Vitest)](https://github.com/alekstar79/flip-combo)\n[![Sass](https://img.shields.io/github/package-json/dependency-version/alekstar79/flip-combo/dev/sass-embedded?logo=sass&logoColor=white&label=Sass)](https://github.com/alekstar79/flip-combo)\n[![npm](https://img.shields.io/npm/v/@alekstar79/flip-combo?logo=npm&logoColor=white&label=npm)](https://www.npmjs.com/package/@alekstar79/flip-combo)\n\n![flip-combo](./flip-combo.png)\n\n[**Live Demo**](https://alekstar79.github.io/flip-combo)\n\n- **No frameworks.** No Vue, React, or Angular — pure DOM.\n- **No dependencies.** Zero runtime dependencies.\n- **Strict TypeScript.** `strict: true`, fully typed API.\n- **Easy integration.** Vue 2/3, React, Svelte, vanilla — through\n  a single `HostEnvironment` contract (4 adapters).\n\n## Installation\n\n```bash\nnpm install @alekstar79/flip-combo\n```\n\n## Quick start\n\n### Combo (Flipper + calc + calendar)\n\n```ts\nimport {\n  createFlipper,\n  createCalc,\n  createCalendar,\n} from \"@alekstar79/flip-combo\";\nimport \"@alekstar79/flip-combo/style.css\";\n\nconst flipper = createFlipper({\n  createFront: (opts) =>\n    createCalc({\n      onOff: opts.onOff,\n      onFlip: opts.onFlip,\n    }),\n  createBack: (opts) =>\n    createCalendar({\n      locale: opts.locale === \"en\" ? \"en\" : \"ru\",\n      onOff: opts.onOff,\n      onFlip: opts.onFlip,\n    }),\n  backgroundColor: \"#82b1ff\",\n});\n\nflipper.mount(document.getElementById(\"app\")!);\n```\n\n### Calculator only\n\n```ts\nimport { createCalc } from \"@alekstar79/flip-combo/calc\";\nimport \"@alekstar79/flip-combo/style.css\";\n\nconst calc = createCalc();\ncalc.mount(document.getElementById(\"calc-host\")!);\n```\n\n### Draggable panel\n\n```ts\nimport { createCalc } from \"@alekstar79/flip-combo/calc\";\nimport \"@alekstar79/flip-combo/style.css\";\n\nconst calc = createCalc({\n  draggable: true,\n  storageKey: \"my-app:calc\",\n});\n\ncalc.mount(document.body);\n```\n\nThe panel appears in the center of the window and can be dragged with the mouse;\nthe position is saved to `localStorage` with a 300 ms debounce.\nIt is restored after a reload.\n\n### Calendar only\n\n```ts\nimport { createCalendar } from \"@alekstar79/flip-combo/calendar\";\nimport \"@alekstar79/flip-combo/style.css\";\n\nconst calendar = createCalendar({\n  locale: \"ru\",\n  draggable: true,\n});\n\ncalendar.mount(document.body);\n```\n\n## What's inside\n\n| Module                            | Export                                            | Purpose              |\n| --------------------------------- | ------------------------------------------------- | -------------------- |\n| `@alekstar79/flip-combo`          | `createFlipper`, `createCalc`, `createCalendar`   | Everything           |\n| `@alekstar79/flip-combo/calc`     | `createCalc`                                      | Calculator only      |\n| `@alekstar79/flip-combo/calendar` | `createCalendar`                                  | Calendar only        |\n| `@alekstar79/flip-combo/flipper`  | `createFlipper`                                   | 3D container only    |\n| `@alekstar79/flip-combo/host`     | `createDefaultHost`                               | Environment adapters |\n| `@alekstar79/flip-combo/utils`    | `clamp`, `paintWithOpacity`, `makeDraggable`, ... | Utilities            |\n\n## Framework integration\n\nSee [INTEGRATION.md](./INTEGRATION.md) — ready-made examples for:\n\n- Vanilla TypeScript\n- Vue 2 (Options API)\n- Vue 3 (Composition API)\n- React (hooks)\n- React + Redux / Zustand\n- SSR / Next.js / Nuxt\n\n## API\n\n### `createFlipper(props)`\n\n| Parameter         | Type                         | Default                        | Description                     |\n| ----------------- | ---------------------------- | ------------------------------ | ------------------------------- |\n| `createFront`     | `(opts) => FlipPanel`        | —                              | Front panel factory             |\n| `createBack`      | `(opts) => FlipPanel`        | —                              | Back panel factory              |\n| `host`            | `HostEnvironment`            | `createDefaultHost()`          | Environment adapters            |\n| `backgroundColor` | `string`                     | `host.theme.backgroundColor()` | Panel background color          |\n| `locale`          | `string`                     | `host.locale.current()`        | Initial locale                  |\n| `initialOpacity`  | `number`                     | `0.7`                          | Initial opacity (0.5..1)        |\n| `presentation`    | `boolean`                    | `false`                        | No drag or position persistence |\n| `initialEntity`   | `'calculator' \\| 'calendar'` | `'calculator'`                 | Visible panel                   |\n| `onOff`           | `() => void`                 | —                              | Callback when `⏻` is pressed    |\n\n### `FlipperInstance` methods\n\n| Method                      | Description                               |\n| --------------------------- | ----------------------------------------- |\n| `mount(container)`          | Mounts into a container                   |\n| `unmount()`                 | Removes listeners and DOM                 |\n| `flip()`                    | Switches the panel                        |\n| `setLocale(locale)`         | Changes the locale                        |\n| `setBackgroundColor(color)` | Changes the background color              |\n| `setOpacity(value)`         | Changes opacity (0.5..1)                  |\n| `getState()`                | `{ rotated, left, top, opacity, entity }` |\n\n### `createCalc(props)`\n\n| Parameter    | Type             | Default             | Description               |\n| ------------ | ---------------- | ------------------- | ------------------------- |\n| `draggable`  | `boolean`        | `false`             | Enable dragging           |\n| `storageKey` | `string`         | `'flip-combo:calc'` | localStorage position key |\n| `onOff`      | `() => void`     | —                   | Callback on `⏻` press     |\n| `onFlip`     | `() => void`     | —                   | Callback on `⇄` press     |\n| `onCopy`     | `(text) => void` | —                   | Callback after copying    |\n\n### `createCalendar(props)`\n\n| Parameter     | Type           | Default                 | Description                     |\n| ------------- | -------------- | ----------------------- | ------------------------------- |\n| `locale`      | `'ru' \\| 'en'` | `'ru'`                  | Locale                          |\n| `initialDate` | `Date`         | `new Date()`            | Date used to build the calendar |\n| `draggable`   | `boolean`      | `false`                 | Enable dragging                 |\n| `storageKey`  | `string`       | `'flip-combo:calendar'` | localStorage key                |\n| `onOff`       | `() => void`   | —                       | Callback on `⏻` press           |\n| `onFlip`      | `() => void`   | —                       | Callback on `⇄` press           |\n\n## State management\n\n```ts\n// Locale (passed to Calendar through host or explicitly)\nflipper.setLocale(\"en\");\n\n// Background color (in hex format)\nflipper.setBackgroundColor(\"#ffffff\");\n\n// Opacity (0.5..1)\nflipper.setOpacity(0.85);\n\n// Current state\nflipper.getState();\n// { rotated, left, top, opacity, entity }\n```\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}