{"_id":"@darksnow-ui/toast","name":"@darksnow-ui/toast","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@darksnow-ui/toast","version":"1.0.0","description":"toast component for DarkSnow UI","keywords":["react","toast","component","ui","darksnow","typescript"],"author":{"name":"Anderson Rosa"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/darksnow-ui/darksnow-ui.git","directory":"components/ui/toast"},"homepage":"https://github.com/darksnow-ui/darksnow-ui#readme","bugs":{"url":"https://github.com/darksnow-ui/darksnow-ui/issues"},"type":"module","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"},"./styles.css":"./dist/styles.css"},"peerDependencies":{"react":"^19.0.0","react-dom":"^19.0.0"},"dependencies":{"clsx":"^2.1.1"},"devDependencies":{"@types/react":"^19.0.0","@types/react-dom":"^19.0.0","react":"^19.1.0","react-dom":"^19.1.0","tsup":"^8.5.0","typescript":"^5.3.3"},"scripts":{"build":"tsup","dev":"tsup --watch","clean":"rm -rf dist","typecheck":"tsc --noEmit","lint":"eslint src --ext ts,tsx","lint:fix":"eslint src --ext ts,tsx --fix"},"_id":"@darksnow-ui/toast@1.0.0","_integrity":"sha512-TvmjjD7vSpIRUkyaoaRpa+dcf5GvMpZZwcLE3d37bjcmmExuKFJP1IMAy8Bxi9qOL/MYLWTXqzRt1F/mcW8Tlg==","_resolved":"/tmp/fc4ce929a08a66dafc881bd51c12b77d/darksnow-ui-toast-1.0.0.tgz","_from":"file:darksnow-ui-toast-1.0.0.tgz","_nodeVersion":"20.19.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-TvmjjD7vSpIRUkyaoaRpa+dcf5GvMpZZwcLE3d37bjcmmExuKFJP1IMAy8Bxi9qOL/MYLWTXqzRt1F/mcW8Tlg==","shasum":"2dc8beeedb294bd2a37f10d8a76e93fe932af7f3","tarball":"https://registry.npmjs.org/@darksnow-ui/toast/-/toast-1.0.0.tgz","fileCount":8,"unpackedSize":7575,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCK9j0s4zN/3F2MArcWOjS7Is/k8aAafCUfW4viLbwKvwIgZY7r1ibJr7Bbn2KDaojzbs5Ae9v9x5mQVnzgJMPs8Wo="}]},"_npmUser":{"name":"andersondrosa","email":"andersondrosa@outlook.com"},"directories":{},"maintainers":[{"name":"andersondrosa","email":"andersondrosa@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/toast_1.0.0_1749338995319_0.8047287115907835"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-07T23:29:55.229Z","1.0.0":"2025-06-07T23:29:55.512Z","modified":"2025-06-07T23:29:55.826Z"},"maintainers":[{"name":"andersondrosa","email":"andersondrosa@outlook.com"}],"description":"toast component for DarkSnow UI","homepage":"https://github.com/darksnow-ui/darksnow-ui#readme","keywords":["react","toast","component","ui","darksnow","typescript"],"repository":{"type":"git","url":"git+https://github.com/darksnow-ui/darksnow-ui.git","directory":"components/ui/toast"},"author":{"name":"Anderson Rosa"},"bugs":{"url":"https://github.com/darksnow-ui/darksnow-ui/issues"},"license":"MIT","readme":"# Toast\n\nA succinct message that is displayed temporarily. Built on top of Radix UI Toast primitive.\n\n## Installation\n\n```bash\nnpm install @darksnow-ui/toast\n```\n\n### Peer Dependencies\n\n```bash\nnpm install react react-dom\n```\n\n## Usage\n\n```tsx\nimport { useToast } from \"@darksnow-ui/toast\"\nimport { Button } from \"@darksnow-ui/button\"\n\nexport function ToastExample() {\n  const { toast } = useToast()\n\n  return (\n    <Button\n      onClick={() => {\n        toast({\n          title: \"Scheduled: Catch up \",\n          description: \"Friday, February 10, 2023 at 5:57 PM\",\n        })\n      }}\n    >\n      Add to calendar\n    </Button>\n  )\n}\n```\n\n## Hook\n\n### useToast\n\nProvides toast functionality.\n\n```tsx\nconst { toast, dismiss } = useToast()\n\n// Show toast\ntoast({\n  title: \"Success!\",\n  description: \"Your changes have been saved.\",\n})\n\n// Dismiss toast\ndismiss(toastId)\n```\n\n## Toast Options\n\n| Option      | Type                              | Default | Description                    |\n|-------------|-----------------------------------|---------|--------------------------------|\n| title       | string                            | -       | Toast title                    |\n| description | string                            | -       | Toast description              |\n| variant     | \"default\" \\| \"destructive\"       | \"default\" | Toast variant               |\n| action      | ToastActionElement                | -       | Action button                  |\n| duration    | number                            | 5000    | Auto-dismiss duration (ms)     |\n\n## Examples\n\n### Basic Toast\n\n```tsx\ntoast({\n  title: \"Success!\",\n  description: \"Operation completed successfully.\",\n})\n```\n\n### Error Toast\n\n```tsx\ntoast({\n  variant: \"destructive\",\n  title: \"Uh oh! Something went wrong.\",\n  description: \"There was a problem with your request.\",\n})\n```\n\n### Toast with Action\n\n```tsx\ntoast({\n  title: \"Scheduled: Catch up\",\n  description: \"Friday, February 10, 2023 at 5:57 PM\",\n  action: (\n    <ToastAction altText=\"Goto schedule to undo\">Undo</ToastAction>\n  ),\n})\n```\n\n### Custom Duration\n\n```tsx\ntoast({\n  title: \"Auto-save enabled\",\n  description: \"Your work is being saved automatically.\",\n  duration: 10000, // 10 seconds\n})\n```\n\n## Setup\n\nAdd the Toaster component to your app:\n\n```tsx\nimport { Toaster } from \"@darksnow-ui/toast\"\n\nfunction App() {\n  return (\n    <div>\n      {/* Your app content */}\n      <Toaster />\n    </div>\n  )\n}\n```\n\n## Accessibility\n\n- Screen reader announcements\n- Keyboard navigation support\n- Focus management\n- Proper ARIA attributes\n\n## Styling\n\nUses DarkSnow UI design tokens for consistent theming.\n\n## Related Components\n\n- [Alert](/components/ui/alert) - Static notifications\n- [Toaster](/components/ui/toaster) - Toast container\n","readmeFilename":"README.md","_rev":"1-04493a0c4d5ea384b07b22dc43af0dcb"}