{"_id":"@2372233634gm/toast-notify","name":"@2372233634gm/toast-notify","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@2372233634gm/toast-notify","version":"1.0.0","description":"A simple toast notification library","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build","test":"echo \"No tests specified\" && exit 0","start":"tsc --watch"},"keywords":["toast","notification","alert","popup"],"author":{"name":"2372233634gm"},"license":"MIT","devDependencies":{"typescript":"^4.9.5"},"repository":{"type":"git","url":"git+https://github.com/appleHcwang/toast-notify.git"},"homepage":"https://github.com/appleHcwang/toast-notify","bugs":{"url":"https://github.com/appleHcwang/toast-notify/issues"},"publishConfig":{"access":"public"},"gitHead":"06f0ceada03a7be877b770402831abe832740998","_id":"@2372233634gm/toast-notify@1.0.0","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-wYpBLjGI9c6hyiLMictGcxcIeLSDkE1FAAQ17+aoNRKSLwaOkb9T0m73qEV/cCCOdusJQ5KnowF1Qheh5gBCgg==","shasum":"0e003d19d91ab18c0d8ce77843d6133868ddd127","tarball":"https://registry.npmjs.org/@2372233634gm/toast-notify/-/toast-notify-1.0.0.tgz","fileCount":4,"unpackedSize":13921,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCVEWA9me6zVwo2Arc6Vl6+ujgyR/EYYoIg3Qy5R2Q3pgIhAM1wjxMkVvbRt+H+C5RsWQrGZCYEAcJZZ4Q+GbEcwONT"}]},"_npmUser":{"name":"2372233634gm","email":"2372233634gm@gmail.com","actor":{"name":"2372233634gm","email":"2372233634gm@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"2372233634gm","email":"2372233634gm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/toast-notify_1.0.0_1750941019415_0.9121174417216482"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-26T12:30:19.320Z","1.0.0":"2025-06-26T12:30:19.578Z","modified":"2025-06-26T12:30:19.861Z"},"maintainers":[{"name":"2372233634gm","email":"2372233634gm@gmail.com"}],"description":"A simple toast notification library","homepage":"https://github.com/appleHcwang/toast-notify","keywords":["toast","notification","alert","popup"],"repository":{"type":"git","url":"git+https://github.com/appleHcwang/toast-notify.git"},"author":{"name":"2372233634gm"},"bugs":{"url":"https://github.com/appleHcwang/toast-notify/issues"},"license":"MIT","readme":"# Toast Notify\n\nA lightweight, customizable toast notification library for web applications.\n\n## Installation\n\n```bash\nnpm install @2372233634gm/toast-notify\n```\n\nor\n\n```bash\nyarn add @2372233634gm/toast-notify\n```\n\n## Usage\n\n### Basic Usage\n\n```javascript\nimport { Toast } from '@2372233634gm/toast-notify';\n\n// Show different types of notifications\nToast.success('Operation completed successfully!');\nToast.error('An error occurred!');\nToast.warning('Warning: This action cannot be undone.');\nToast.info('Server maintenance scheduled for tonight.');\n\n// Or use the generic show method\nToast.show('Custom message', 'info');\n```\n\n### Customization\n\n```javascript\n// Set global default options\nToast.setDefaultOptions({\n  duration: 5000,\n  position: 'top-center',\n  showCloseButton: true\n});\n\n// Customize individual toast\nToast.success('Custom toast', {\n  duration: 10000, // 10 seconds\n  position: 'bottom-right',\n  showCloseButton: true,\n  className: 'my-custom-toast',\n  style: {\n    fontSize: '16px',\n    borderLeft: '4px solid #4caf50'\n  },\n  onClick: () => {\n    console.log('Toast clicked');\n  },\n  onClose: () => {\n    console.log('Toast closed');\n  }\n});\n```\n\n## API\n\n### Toast Types\n\n- `success`: Green toast for successful operations\n- `error`: Red toast for errors\n- `warning`: Orange toast for warnings\n- `info`: Blue toast for information (default)\n\n### Methods\n\n- `Toast.show(message, type, options)`: Show a toast with the specified type\n- `Toast.success(message, options)`: Show a success toast\n- `Toast.error(message, options)`: Show an error toast\n- `Toast.warning(message, options)`: Show a warning toast\n- `Toast.info(message, options)`: Show an info toast\n- `Toast.setDefaultOptions(options)`: Set global default options for all toasts\n\n### Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `duration` | number | 3000 | Duration in milliseconds (0 for no auto-close) |\n| `position` | string | 'top-right' | Position of the toast on the screen |\n| `showCloseButton` | boolean | true | Whether to show the close button |\n| `className` | string | undefined | Additional CSS class name |\n| `style` | object | undefined | Custom inline styles |\n| `onClick` | function | undefined | Callback when toast is clicked |\n| `onClose` | function | undefined | Callback when toast is closed |\n\n### Positions\n\n- `top-left`\n- `top-center`\n- `top-right` (default)\n- `bottom-left`\n- `bottom-center`\n- `bottom-right`\n\n## License\n\nMIT ","readmeFilename":"README.md","_rev":"1-e860051e6242758d11cf2d3d3cb96a32"}