{"_id":"@achabs/tada","_rev":"2-e4c17e442df23363ea3b4d2e99575764","name":"@achabs/tada","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@achabs/tada","version":"1.0.0","keywords":["toast","notification","alert","popup","message","snackbar"],"author":{"name":"Achabs","email":"marshallacharibia@gmail.com"},"license":"MIT","_id":"@achabs/tada@1.0.0","maintainers":[{"name":"achabs","email":"marshallacharibia@gmail.com"}],"dist":{"shasum":"bc0c893ba09cfe877bc6fc2cd4b97ec254f6cd90","tarball":"https://registry.npmjs.org/@achabs/tada/-/tada-1.0.0.tgz","fileCount":16,"integrity":"sha512-bDXq3BAP7FYKl31L0L6l2l9Wy5AoA73mEkxgY+vD9Smn6447IMvFu15r0wU5huxG5SakCxU07rdFdtkYRqYkkQ==","signatures":[{"sig":"MEQCIDJb9/8EpPI89s5EX6XupN5D8YEg6pM0kC53xm+ZkNDsAiBIx6McAaG8vDJSs7A3zQfN56boEqtHRQ1jgeDNkYuRAw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28107},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"1347e64cf6bffaef5a2c2c5a1f545d3a34fcbeae","scripts":{"build":"rollup -c","prepublishOnly":"npm run build"},"_npmUser":{"name":"achabs","email":"marshallacharibia@gmail.com"},"_npmVersion":"10.9.0","description":"A lightweight toast notification library","directories":{},"_nodeVersion":"22.9.0","_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.8.1","rollup":"^4.27.4","typescript":"^5.7.2","@types/node":"^22.10.1","rollup-plugin-postcss":"^4.0.2","@rollup/plugin-typescript":"^12.1.1"},"_npmOperationalInternal":{"tmp":"tmp/tada_1.0.0_1761651682467_0.09966631367972645","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@achabs/tada","version":"1.1.0","type":"module","description":"A lightweight, customizable toast notification library with icons, progress bars, and custom styling","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./dist/index.css":"./dist/index.css"},"scripts":{"build":"rollup -c","test":"vitest","test:ui":"vitest --ui","test:coverage":"vitest --coverage","prepublishOnly":"npm run build"},"keywords":["toast","notification","alert","popup","message","snackbar","toast-notification","notifications","progress-bar","icons","customizable","typescript","accessible","aria"],"author":{"name":"Achabs","email":"marshallacharibia@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Acharibia/tada.git"},"bugs":{"url":"https://github.com/Acharibia/tada/issues"},"homepage":"https://github.com/Acharibia/tada#readme","devDependencies":{"@rollup/plugin-typescript":"^12.1.1","@types/node":"^22.10.1","@vitest/ui":"^4.0.4","happy-dom":"^20.0.8","jsdom":"^27.0.1","rollup":"^4.27.4","rollup-plugin-postcss":"^4.0.2","tslib":"^2.8.1","typescript":"^5.7.2","vitest":"^4.0.4"},"_id":"@achabs/tada@1.1.0","gitHead":"7eaecd9a88597730443756f2912e968d76e09765","_nodeVersion":"22.9.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-sWhP38I/bTa+cDWA2O4avDqKqcfOUYBXnTKcoB/W89mVIHoEkE7Ls7JMnnyDUoRsIsgaC+0fuyb8VcnOpa3vHA==","shasum":"91ba678791788a29855ce6b69bd9a24cc9474297","tarball":"https://registry.npmjs.org/@achabs/tada/-/tada-1.1.0.tgz","fileCount":18,"unpackedSize":62579,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDijpscL+7G7nynM7CtHrNjrNk87f7YpxWDfP6GNv28AwIhANGxhUR/OihPve0FtNbyvf84v7MWuKBrcisTsNfrauOU"}]},"_npmUser":{"name":"achabs","email":"marshallacharibia@gmail.com"},"directories":{},"maintainers":[{"name":"achabs","email":"marshallacharibia@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tada_1.1.0_1761733491543_0.3681827377563427"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-28T11:41:22.328Z","modified":"2025-10-29T10:24:51.926Z","1.0.0":"2025-10-28T11:41:22.664Z","1.1.0":"2025-10-29T10:24:51.730Z"},"author":{"name":"Achabs","email":"marshallacharibia@gmail.com"},"license":"MIT","keywords":["toast","notification","alert","popup","message","snackbar","toast-notification","notifications","progress-bar","icons","customizable","typescript","accessible","aria"],"description":"A lightweight, customizable toast notification library with icons, progress bars, and custom styling","maintainers":[{"name":"achabs","email":"marshallacharibia@gmail.com"}],"readme":"# 🎉 Tada\n\n[![npm version](https://img.shields.io/npm/v/@achabs/tada.svg)](https://www.npmjs.com/package/@achabs/tada)\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@achabs/tada)](https://bundlephobia.com/package/@achabs/tada)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA lightweight, customizable toast notification library written in TypeScript.\n\n## Features\n\n- ✅ **Zero dependencies** - Lightweight and fast\n- ♿ **Accessible** - Full ARIA support and keyboard navigation\n- 🎨 **Customizable** - Custom animations, positions, colors, and styling\n- 🖼️ **Icons & Images** - Add SVG icons or avatar images to toasts\n- 📊 **Progress Bar** - Visual countdown indicator for timed toasts\n- 🎯 **Border Radius** - Customize rounded corners (pill, square, or custom)\n- 🌈 **Custom Colors** - Set your own background and text colors\n- 📦 **TypeScript** - Fully typed with excellent IDE support\n- 📱 **Responsive** - Works on all screen sizes\n- 🚀 **Performance** - Memory leak prevention and cleanup utilities\n\n## Installation\n\n```bash\nnpm install @achabs/tada\n```\n\n## Quick Start\n\n```javascript\nimport tada from \"@achabs/tada\";\nimport \"@achabs/tada/dist/index.css\"; // Don't forget to import the CSS!\n\n// Show notifications\ntada.success(\"Operation successful!\");\ntada.error(\"Something went wrong!\");\ntada.warning(\"Be careful!\");\ntada.info(\"Did you know?\");\n```\n\n## Usage\n\n### Basic Toast\n\n```javascript\ntada.show(\"Hello World!\");\n```\n\n### Toast Types\n\n```javascript\ntada.success(\"Profile updated!\");\ntada.error(\"Failed to save\");\ntada.warning(\"Session expiring soon\");\ntada.info(\"New features available\");\n```\n\n### Custom Options\n\n```javascript\ntada.show(\"Custom message\", {\n  duration: 5000, // Duration in ms (0 = no auto-close)\n  position: \"bottom-right\", // Position on screen\n  type: \"success\", // Type of toast\n  closeButton: true, // Show close button\n});\n```\n\n### Available Positions\n\n- `top-left`\n- `top-center`\n- `top-right`\n- `bottom-left`\n- `bottom-center`\n- `bottom-right`\n\n### Advanced Options\n\n```javascript\n// Limit maximum toasts shown at once\ntada.show(\"Message\", { maxToasts: 3 });\n\n// Show progress bar\ntada.show(\"Uploading...\", {\n  showProgress: true,\n  duration: 5000\n});\n\n// Add icon (SVG or HTML string)\ntada.success(\"Done!\", {\n  icon: '<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\"/></svg>'\n});\n\n// Add image\ntada.info(\"New message from John\", {\n  image: \"https://example.com/avatar.jpg\"\n});\n\n// Custom border radius\ntada.success(\"Pill shape!\", {\n  borderRadius: \"50px\"\n});\n\ntada.info(\"Square corners\", {\n  borderRadius: \"0\"\n});\n\n// Custom colors\ntada.show(\"Dark mode!\", {\n  backgroundColor: \"#1f2937\",\n  color: \"#f3f4f6\"\n});\n\ntada.success(\"Neon vibes!\", {\n  backgroundColor: \"#000\",\n  color: \"#0ff\"\n});\n\n// Custom animations\ntada.show(\"Message\", {\n  animation: {\n    enter: \"scale(0)\",\n    exit: \"scale(0)\",\n    duration: 500,\n  },\n});\n\n// Combine multiple features!\ntada.success(\"Payment received!\", {\n  icon: '<svg>...</svg>',\n  showProgress: true,\n  duration: 4000,\n  borderRadius: \"50px\",\n  backgroundColor: \"rgba(34, 197, 94, 0.95)\",\n  color: \"#fff\"\n});\n```\n\n## API Reference\n\n### ToastOptions\n\nAll toast methods accept an optional `ToastOptions` object:\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `duration` | `number` | `3000` | Duration in milliseconds (0 = no auto-close) |\n| `position` | `string` | `'top-right'` | Position on screen (see positions below) |\n| `type` | `string` | `'default'` | Toast type: `'default'`, `'success'`, `'error'`, `'warning'`, `'info'` |\n| `closeButton` | `boolean` | `true` | Show close button |\n| `maxToasts` | `number` | `0` | Maximum toasts shown at once (0 = unlimited) |\n| `showProgress` | `boolean` | `false` | Show progress bar countdown |\n| `icon` | `string` | `undefined` | SVG or HTML string for icon (left side) |\n| `image` | `string` | `undefined` | Image URL for avatar (left side, circular) |\n| `borderRadius` | `string` | `undefined` | Custom border radius (e.g., `'50px'`, `'0'`, `'8px'`) |\n| `backgroundColor` | `string` | `undefined` | Custom background color (any CSS color) |\n| `color` | `string` | `undefined` | Custom text color (any CSS color) |\n| `animation` | `object` | `undefined` | Custom animation object (see below) |\n\n#### Animation Object\n\n```typescript\n{\n  enter?: string;    // CSS transform for enter animation\n  exit?: string;     // CSS transform for exit animation\n  duration?: number; // Animation duration in ms\n}\n```\n\n### Methods\n\n#### `tada.show(message, options?)`\nShows a default toast notification.\n```javascript\nconst toast = tada.show(\"Hello World!\");\n```\n\n#### `tada.success(message, options?)`\nShows a success toast (green).\n```javascript\ntada.success(\"Profile updated!\");\n```\n\n#### `tada.error(message, options?)`\nShows an error toast (red).\n```javascript\ntada.error(\"Something went wrong!\");\n```\n\n#### `tada.warning(message, options?)`\nShows a warning toast (yellow).\n```javascript\ntada.warning(\"Session expiring soon\");\n```\n\n#### `tada.info(message, options?)`\nShows an info toast (blue).\n```javascript\ntada.info(\"New features available\");\n```\n\n#### `tada.remove(toast)`\nManually removes a specific toast.\n```javascript\nconst toast = tada.show(\"Message\");\ntada.remove(toast);\n```\n\n#### `tada.clear()`\nRemoves all active toasts.\n```javascript\ntada.clear();\n```\n\n#### `tada.destroy()`\nCleanup method that removes all toasts and containers.\n```javascript\ntada.destroy();\n```\n\n### Accessibility\n\nTada is built with accessibility in mind:\n\n- Full ARIA support (`role=\"alert\"`, `aria-live`, `aria-atomic`)\n- Keyboard navigation (Press `Escape` to dismiss)\n- Keyboard support for close buttons (`Enter` or `Space`)\n- Screen reader friendly\n- Focus management\n\n## TypeScript\n\nFully typed with TypeScript support out of the box!\n\n```typescript\nimport tada, { TadaToast, ToastOptions } from \"@achabs/tada\";\n\nconst options: ToastOptions = {\n  duration: 3000,\n  position: \"top-right\",\n};\n\ntada.success(\"Typed!\", options);\n```\n\n## Demo\n\nCheck out the [demo page](./demo/index.html) for live examples of all features!\n\n## Browser Support\n\nTada works in all modern browsers that support ES2015.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nMIT\n","readmeFilename":"README.md","homepage":"https://github.com/Acharibia/tada#readme","repository":{"type":"git","url":"git+https://github.com/Acharibia/tada.git"},"bugs":{"url":"https://github.com/Acharibia/tada/issues"}}