├── .editorconfig ├── .eslintrc.cjs ├── .github ├── FUNDING.yml ├── dependabot.yml ├── pull_request_template.md └── workflows │ └── publish.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── index.html ├── package-lock.json ├── package.json ├── postcss.config.cjs ├── public └── favicon.ico ├── src ├── App.vue ├── app-components │ ├── AppInput.vue │ ├── AppSelect.vue │ ├── AppStatusDisplay.vue │ ├── AppTextarea.vue │ ├── AppThemeToggle.vue │ └── AppToggle.vue ├── assets │ ├── container.scss │ ├── themes │ │ ├── common.scss │ │ ├── dark.scss │ │ └── light.scss │ └── toast.scss ├── components │ ├── Node.ts │ ├── ProgressBar.vue │ ├── ToastContainer.vue │ ├── VtIcon.vue │ ├── VtToast.vue │ └── VtTransition.vue ├── composables │ ├── createVtTheme.ts │ ├── useDraggable.ts │ ├── useSettings.ts │ ├── useToast.ts │ └── useVtEvents.ts ├── index.ts ├── main.ts ├── plugin.ts ├── shims │ └── vue.d.ts ├── type.ts └── utils.ts ├── tailwind.config.js ├── tsconfig.build.json ├── tsconfig.json └── vite.config.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | max_line_length = 120 8 | end_of_line = lf 9 | indent_style = space 10 | indent_size = 4 11 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: [ 7 | 'eslint:recommended', 8 | 'plugin:@typescript-eslint/recommended', 9 | 'plugin:@typescript-eslint/recommended-requiring-type-checking', 10 | 'plugin:vue/vue3-recommended', 11 | '@vue/typescript/recommended', 12 | ], 13 | plugins: [ 14 | 'vue', 15 | '@stylistic/ts' 16 | ], 17 | ignorePatterns: [ 18 | 'node_modules', 19 | '*.js' 20 | ], 21 | parserOptions: { 22 | ecmaVersion: 2020, 23 | parser: '@typescript-eslint/parser', 24 | sourceType: 'module', 25 | project: './tsconfig.json', 26 | tsconfigRootDir: __dirname, 27 | extraFileExtensions: ['.vue'], 28 | }, 29 | rules: { 30 | // https://eslint.org/docs/rules/ 31 | 'no-console': 'warn', 32 | 'no-debugger': 'warn', 33 | 'semi': 'off', 34 | 'indent': 'off', 35 | 'no-unused-expressions': 'off', 36 | 'space-before-function-paren': ['warn', { 37 | 'anonymous': 'never', 38 | 'named': 'never', 39 | 'asyncArrow': 'always' 40 | }], 41 | 'no-trailing-spaces': 'warn', 42 | 'no-any': 'off', 43 | 'no-prototype-builtins': 'off', 44 | 'no-unused-vars': 'off', 45 | 'prefer-rest-params': 'warn', 46 | 'no-extra-parens': 'off', 47 | 'quotes': 'off', 48 | 'func-call-spacing': 'off', 49 | 'comma-spacing': 'off', 50 | 'keyword-spacing': 'off', 51 | 'object-curly-spacing': ['warn', 'always'], 52 | 'comma-dangle': ['warn', 'never'], 53 | 'max-len': ['warn', 120], 54 | 'eqeqeq': 'error', 55 | 56 | // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules 57 | '@stylistic/ts/indent': ['warn', 4], 58 | '@stylistic/ts/semi': 'error', 59 | '@typescript-eslint/no-unused-expressions': ['error', { 60 | allowTernary: true, 61 | allowShortCircuit: true 62 | }], 63 | '@stylistic/ts/quotes': ['warn', 'single'], 64 | '@stylistic/ts/no-extra-parens': 'error', 65 | '@typescript-eslint/no-unused-vars': 'warn', 66 | '@typescript-eslint/no-useless-constructor': 'warn', 67 | '@typescript-eslint/no-explicit-any': 'off', 68 | '@typescript-eslint/ban-ts-comment': 'off', 69 | '@typescript-eslint/no-unsafe-return': 'off', 70 | '@typescript-eslint/no-unsafe-assignment': 'off', 71 | '@typescript-eslint/explicit-module-boundary-types': ['error', { 72 | allowArgumentsExplicitlyTypedAsAny: true, 73 | allowedNames: ['setup'] 74 | }], 75 | '@typescript-eslint/prefer-nullish-coalescing': 'warn', 76 | '@typescript-eslint/prefer-optional-chain': 'warn', 77 | '@typescript-eslint/prefer-ts-expect-error': 'warn', 78 | '@typescript-eslint/promise-function-async': 'error', 79 | '@stylistic/ts/func-call-spacing': ['error', 'never'], 80 | '@stylistic/ts/comma-spacing': 'warn', 81 | '@stylistic/ts/keyword-spacing': 'warn', 82 | // '@typescript-eslint/consistent-indexed-object-style': ['error', 'record'], // waiting on dependency updates 83 | // '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }], 84 | '@stylistic/ts/member-delimiter-style': 'warn', 85 | '@stylistic/ts/type-annotation-spacing': 'warn', 86 | '@typescript-eslint/naming-convention': ['error', 87 | { 88 | selector: 'default', 89 | format: ['camelCase'] 90 | }, 91 | { 92 | selector: 'import', 93 | format: null 94 | }, 95 | { 96 | selector: 'objectLiteralProperty', 97 | format: ['camelCase', 'PascalCase'] 98 | }, 99 | { 100 | selector: 'typeLike', 101 | format: ['PascalCase'] 102 | }, 103 | { 104 | selector: 'parameter', 105 | format: null, 106 | filter: { 107 | regex: '^_.*', 108 | match: true 109 | } 110 | } 111 | ], 112 | '@typescript-eslint/no-non-null-assertion': 'off', 113 | 114 | // https://eslint.vuejs.org/rules/ 115 | // if unsure and eslint doesn't cover it please refer to https://v3.vuejs.org/style-guide/ 116 | 'vue/html-indent': ['warn', 4], 117 | 'vue/component-name-in-template-casing': ['warn', 'PascalCase'], 118 | 'vue/match-component-file-name': ['off', { // until we have storybook working 119 | extensions: ['jsx', 'vue', 'tsx'] 120 | }], 121 | 'vue/new-line-between-multi-line-property': 'warn', 122 | 'vue/max-attributes-per-line': [ 123 | 'warn', { 124 | 'singleline': 3, 125 | 'multiline': 1 126 | } 127 | ], 128 | 'vue/first-attribute-linebreak': ['warn', { 129 | 'singleline': 'ignore', 130 | 'multiline': 'beside' 131 | }], 132 | 'vue/no-boolean-default': ['error', 'default-false'], 133 | 'vue/no-duplicate-attr-inheritance': 'error', 134 | 'vue/no-empty-component-block': 'warn', 135 | 'vue/no-multiple-objects-in-class': 'error', 136 | 'vue/no-potential-component-option-typo': ['error', { 137 | presets: ['vue', 'vue-router'] 138 | }], 139 | 'vue/no-reserved-component-names': ['error', { 140 | 'disallowVueBuiltInComponents': true, 141 | 'disallowVue3BuiltInComponents': true 142 | }], 143 | 'vue/no-template-target-blank': 'error', 144 | 'vue/no-unsupported-features': ['error', { 145 | 'version': '^3.0.0' 146 | }], 147 | 'vue/no-useless-mustaches': 'warn', 148 | 'vue/no-useless-v-bind': 'error', 149 | 'vue/padding-line-between-blocks': 'warn', 150 | 'vue/require-name-property': 'error', 151 | 'vue/v-for-delimiter-style': 'error', 152 | 'vue/v-on-event-hyphenation': 'error', 153 | 'vue/v-on-function-call': ['error', 'never', { 154 | 'ignoreIncludesComment': true 155 | }], 156 | 'vue/eqeqeq': 'error', 157 | 'vue/no-extra-parens': 'warn', 158 | 'vue/html-closing-bracket-newline': ['warn', { 159 | 'multiline': 'never' 160 | }], 161 | 'vue/no-v-html': 'off', 162 | 'vue/require-default-prop': 'off', 163 | 'vue/no-v-text-v-html-on-component': 'off' 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: nandi95 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | 4 | - package-ecosystem: npm 5 | directory: '/' 6 | target-branch: release/0.x 7 | schedule: 8 | interval: monthly 9 | time: '00:00' 10 | open-pull-requests-limit: 10 11 | commit-message: 12 | prefix: fix 13 | prefix-development: chore 14 | include: scope 15 | 16 | 17 | - package-ecosystem: github-actions 18 | directory: '/' 19 | target-branch: release/0.x 20 | schedule: 21 | interval: monthly 22 | time: '00:00' 23 | open-pull-requests-limit: 10 24 | commit-message: 25 | prefix: fix 26 | prefix-development: chore 27 | include: scope 28 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | ### 🔗 Linked issue 9 | 10 | 11 | 12 | ### ❓ Type of change 13 | 14 | 15 | 16 | - [ ] 🧹 Updates to the build process or auxiliary tools and libraries 17 | - [ ] 📖 Documentation (updates to the documentation or readme) 18 | - [ ] 🐞 Bug fix (a non-breaking change that fixes an issue) 19 | - [ ] 🚀 Enhancement (improving an existing functionality like performance) 20 | - [ ] ✨ New feature (a non-breaking change that adds functionality) 21 | - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change) 22 | 23 | ### 📚 Description 24 | 25 | 26 | 27 | 28 | 29 | ### 📝 Checklist 30 | 31 | 32 | 33 | 34 | 35 | - [ ] I have linked an issue or discussion. 36 | - [ ] I have updated the documentation accordingly. 37 | 38 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish Package to npmjs 2 | on: 3 | release: 4 | types: [published] 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | permissions: 9 | contents: read 10 | id-token: write 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: actions/setup-node@v4 14 | with: 15 | node-version: 'lts/*' 16 | registry-url: 'https://registry.npmjs.org' 17 | - run: npm ci 18 | - run: npm run build:lib 19 | - run: npm publish --provenance --access public 20 | env: 21 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | *.local 4 | .idea 5 | 6 | # distribution files 7 | dist 8 | vue-toastify-* 9 | 10 | # Local Netlify folder 11 | .netlify 12 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | **v2.1.0** *15/03/2025* 2 | 3 | Chore: 4 | - Add a missing build step 5 | - Convert toast container to setup for better type inference 6 | 7 | Fix: 8 | - fix typings internal to the package/demo 9 | - fix toast sizing issue on chrome 10 | - fix logic for getting title - respect defaultTitle setting 11 | - added `enableHtmlInterpretation` flag enabling v-html input for the body and icon (xss risk) 12 | - fix text legibility issue on theme generator 13 | - fix centering issue on small screens 14 | 15 | Feature: 16 | - Add JSX support for body and icon 17 | - updated dependencies 18 | - added some a11y attributes 19 | - allow overwriting built in methods with `customNotifications` 20 | 21 | **v2.0.1** *11/09/2024* 22 | 23 | Chore: 24 | - Add a missing build step 25 | 26 | **v2.0.0** *10/09/2024* 27 | 28 | Performance: 29 | - ***BREAKING***: removed include of all styles by default. You now have to import the base styles **AND** the theme you want to use. 30 | - Add `will-change` for transitioning toasts too. 31 | - Added separate exports for composables. 32 | 33 | Fix: 34 | - Fixed toast might stay on screen if the duration is very low. 35 | 36 | Chore: 37 | - Fixed eslint issues. 38 | - Updated dependencies. 39 | - Updated demo app styling. 40 | - Documented nuxt usage. 41 | 42 | **v2.0.0-alpha** *13/04/2023* 43 | 44 | Refactor: 45 | - Rewritten codebase using v3 of Vue, and its composition api. 46 | - Removed support for passing in router to the plugin. (Developer can just use the callback option) 47 | - Added pauseOnFocusLoss option to pause the timer when the window loses focus. 48 | - Added dynamic theme creation 49 | 50 | **v1.8.1** *25/11/2021* 51 | 52 | Fix: 53 | - Resolved xss vulnerability stemming from an url option not being encoded (#26). 54 | 55 | *** 56 | 57 | **v1.8.0** *05/05/2020* 58 | 59 | Feature: 60 | - Added a new event for when the notification is being dragged. 61 | - Drag event payloads now also include the position of the notification. 62 | - Added toastify to the vue as a static method for easier handling in vuex. 63 | 64 | *** 65 | 66 | **v1.7.0** *28/03/2020* 67 | 68 | Feature: 69 | - Added vue router support to the `url` setting. 70 | - `getSettings()` can now return a single setting's value, given the key. 71 | 72 | Fix: 73 | - `changeToast` now returns `false` as expected when the toast isn't found. 74 | 75 | *** 76 | 77 | *v1.6.1* *11/03/2020* 78 | 79 | Fix: 80 | - Drag behavior fixed to the toast not only the parent element. 81 | - Added will change optimisation to dragging. 82 | 83 | *** 84 | 85 | **v1.6.0** *10/03/2020* 86 | 87 | Feature: 88 | - Added one type at a time option. 89 | - Added max number of notifications on screen option. 90 | - Added `getSettings()` function. (This is more verbose than `setSettings({})`) 91 | 92 | Fix: 93 | - Concatenated queue with toasts on `getToast` and added return value on not found. 94 | - Fixed positioning of the toast on singular dismiss 95 | - Fixed `stopLoader` when passed an array of ids 96 | 97 | *** 98 | 99 | *v1.5.2* *20/01/2020* 100 | 101 | Fix: 102 | - Fixed width issue with long content on leave transition. 103 | 104 | *** 105 | 106 | *v1.5.1* *20/01/2020* 107 | 108 | Fix: 109 | - Added extra check for icon selection. 110 | 111 | *** 112 | 113 | **v1.5.0** *19/01/2020* 114 | 115 | Fix: 116 | - Added the return statement to the custom notification methods 117 | - Fixed the setSettings when using with falsy value. 118 | - Added logic to delay the notification move on removal 119 | - Fixed transition positions 120 | - Added more style namespaces and a whitelist pattern 121 | 122 | Feature: 123 | - Added draggable option to dismiss toast by dragging. 124 | - Added function to listen for events emitted by the notifications. 125 | 126 | *** 127 | 128 | **v1.4.0** *03/01/2020* 129 | 130 | Fix: 131 | - Removed bodyMaxWidth from props and added to the styles 132 | - Updated adding feature to return id instead of currently showing toasts if it is in singular mode. 133 | - Removed prototype builtins. 134 | - Added missing checks for notification coming from server. 135 | - Added packages for testing. 136 | - Styling adjustment for the notification content 137 | 138 | Feature: 139 | - Added sass functions for easier theme creation 140 | - Added option for accepting icons in object format 141 | 142 | *** 143 | 144 | *v1.3.1* *27/12/2019* 145 | 146 | Fix: 147 | - Removed polyfills from bundle 148 | 149 | *** 150 | 151 | **v1.3.0** *27/12/2019* 152 | 153 | Fix: 154 | - Container now ignores clicks thanks to `pointer-events: none;` 155 | - Better responsiveness added to the toasts 156 | - Fixed notification timeout close logic 157 | - General refactor for maintainability 158 | - The status' title attribute will no longer get capitalised (Sorry I didn't see major bump version justified) 159 | 160 | Feature: 161 | - Moved transition into group transition for using the FLIP technique 162 | - Added notification display ordering option 163 | - Plugin now accepts custom transitions 164 | 165 | *** 166 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 nandi95 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##

🔥Vue Toastify🔥

2 |

Simple and dependency-free notification plugin.

3 | 4 | ## Installation 5 | 6 | ```bash 7 | npm i vue-toastify 8 | ``` 9 | 10 | ```ts 11 | import { createApp } from 'vue'; 12 | import plugin from 'vue-toastify'; 13 | // base styles 14 | import 'vue-toastify/index.css'; 15 | // theme styles 16 | import 'vue-toastify/themes/dark.css'; 17 | import type { Settings } from 'vue-toastify'; 18 | 19 | const app = createApp({ }); 20 | app.use(plugin, { }); 21 | app.mount('#app'); 22 | ``` 23 | 24 | [Usage with Nuxt](#usage-with-nuxt) 25 | 26 | ## Options: 27 | - [ToastOptions](src/type.ts#L195) - settings per toast 28 | - [Settings](src/type.ts#L113) - global settings (default settings [here](src/composables/useSettings.ts#L7)) 29 | - [ToastPluginAPI](src/composables/useToast.ts#L13) - methods available on the `useToast()` composable 30 | - [Events](src/composables/useVtEvents.ts#L6) - events emitted by the plugin 31 | 32 | ## Migration Information 33 | 34 | In the future `enableHtmlInterpretation` setting will default to `false`. If you rely on that behavior, make sure to enable it in the settings. If you don't want user input treated as html, make sure to set it to `false`. 35 | 36 | ## Custom styling 37 | Styles include a `'dark'`(default) and a `'light'` theme. If you would like to create your own styles you may use the following helpers: 38 | 39 | ```ts 40 | import { createVtTheme, getCssRules } from 'vue-toastify'; 41 | 42 | // this will create a stylesheet if doesn't exists and insert it into the head 43 | createVtTheme('myThemeName', '#8f6b42'); 44 | // then you can set the theme of the status or the global settings 45 | // alternatively, you can get an array of css rules using getCssRules 46 | getCssRules('myThemeName', '#8f6b42').forEach(rule => {...}); 47 | // this will give you a good starting point to customise the theme 48 | ``` 49 | 50 | ## Custom notifications 51 | You may create some methods on the `useToast()` so it will shortcut any repetition you may have in your app. To register them add a `customNotifications` key to the settings when registering the plugin. 52 | 53 | ```ts 54 | app.use(plugin, { 55 | customNotifications: { 56 | authenticationError: { 57 | body: 'Authentication error', 58 | // ... rest of the toast options here 59 | } 60 | } 61 | }); 62 | // then later you can use it as 63 | useToast().authenticationError(); 64 | ``` 65 | 66 | ## Ambient declaration for custom notifications 67 | 68 | ```ts 69 | import type { ToastPluginAPI, CustomMethods } from 'vue-toastify'; 70 | 71 | declare module 'vue-toastify' { 72 | interface MyMethods extends CustomMethods { 73 | authenticationError(): string; 74 | } 75 | 76 | function useToast(): ToastPluginAPI & MyMethods; 77 | } 78 | ``` 79 | 80 | ## Events 81 | The plugin emits events that you can listen to which allows for using callbacks at different points in the toast's lifecycle. 82 | 83 | ```ts 84 | import { useVtEvents, useToast } from 'vue-toastify'; 85 | 86 | const toast = useToast().success({ body: 'Hello world', canTimeout: true }); 87 | 88 | useVtEvents().once('vtPaused', payload => { 89 | if (payload.id === toast.id) { 90 | // do something 91 | } 92 | }) 93 | ``` 94 | 95 | ### Usage with Nuxt 96 | The recommended way to install is by creating a plugin. As notifications are expected to be responses to user actions, we can lazy load the plugin to reduce the initial bundle size. 97 | 98 | Be sure 99 | to familiarise yourself with the [Nuxt plugin documentation](https://nuxt.com/docs/guide/directory-structure/plugins). 100 | 101 | ```ts 102 | // plugins/toast.client.ts 103 | // .client will only run the plugin on the client side. 104 | import type { Settings } from 'vue-toastify'; 105 | 106 | export default defineNuxtPlugin({ 107 | name: 'toast', 108 | // can load the same time as the rest of the plugins 109 | parallel: true, 110 | setup: nuxt => { 111 | // this will lazy load the plugin therefore won't be included in the entry point 112 | void import('vue-toastify').then(exports => { 113 | nuxt.vueApp.use(exports.default, { 114 | pauseOnHover: true, 115 | theme: 'light', 116 | position: 'top-right' 117 | }); 118 | }); 119 | } 120 | }); 121 | 122 | ``` 123 | Then specify the auto-imported preset in your configuration. 124 | ```ts 125 | // nuxt.config.ts 126 | export default defineNuxtConfig({ 127 | css: [ 128 | // required base themes 129 | 'vue-toastify/index.css', 130 | // include the theme you want to use 131 | 'vue-toastify/themes/light.css' 132 | // or generate one of your own as described in the custom styling section 133 | ], 134 | imports: { 135 | // this will include the composables that the plugin provides 136 | // which is negligable in size compared to the plugin itself 137 | presets: [ 138 | { 139 | from: 'vue-toastify', 140 | imports: [ 141 | // include only the composables you need auto-imported 142 | 'useToast', 143 | // 'useVtEvents', 144 | // 'useVtSettings' 145 | ] 146 | } 147 | ] 148 | }, 149 | }) 150 | ``` 151 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vue Toastify 8 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-toastify", 3 | "version": "2.1.0", 4 | "license": "MIT", 5 | "type": "module", 6 | "author": "Nandor Kraszlan", 7 | "scripts": { 8 | "dev": "vite", 9 | "build:demo": "vite build", 10 | "serve": "vite preview", 11 | "lint": "eslint . --fix --ext .ts,.vue,.tsx", 12 | "build:lib": "vite build --mode=library && tsc -p tsconfig.build.json" 13 | }, 14 | "module": "dist/index.mjs", 15 | "main": "dist/index.cjs", 16 | "exports": { 17 | ".": { 18 | "types": "./dist/types/src/index.d.ts", 19 | "import": "./dist/index.mjs", 20 | "require": "./dist/index.cjs" 21 | }, 22 | "./useToast": { 23 | "types": "./dist/types/src/composables/useToast.d.ts", 24 | "import": "./dist/useToast.mjs", 25 | "require": "./dist/useToast.cjs" 26 | }, 27 | "./useVtEvents": { 28 | "types": "./dist/types/src/composables/useVtEvents.d.ts", 29 | "import": "./dist/useVtEvents.mjs", 30 | "require": "./dist/useVtEvents.cjs" 31 | }, 32 | "./useVtSetting": { 33 | "types": "./dist/types/src/composables/useSetting.d.ts", 34 | "import": "./dist/useVtEvents.mjs", 35 | "require": "./dist/useVtEvents.cjs" 36 | }, 37 | "./index.css": "./dist/index.css", 38 | "./themes/dark.css": "./dist/themes/dark.css", 39 | "./themes/light.css": "./dist/themes/light.css" 40 | }, 41 | "types": "dist/types/src/index.d.ts", 42 | "files": [ 43 | "dist" 44 | ], 45 | "repository": { 46 | "type": "git", 47 | "url": "git+https://github.com/nandi95/vue-toastify.git" 48 | }, 49 | "dependencies": { 50 | "vue": "^3.0.11" 51 | }, 52 | "devDependencies": { 53 | "@rollup/plugin-commonjs": "^28.0.3", 54 | "@rollup/plugin-typescript": "^12.1.2", 55 | "@stylistic/eslint-plugin-ts": "^2.8.0", 56 | "@tailwindcss/forms": "^0.5.3", 57 | "@typescript-eslint/eslint-plugin": "^8.5.0", 58 | "@typescript-eslint/parser": "^8.5.0", 59 | "@vitejs/plugin-vue": "^5.1.3", 60 | "@vue/compiler-sfc": "^3.0.5", 61 | "@vue/eslint-config-typescript": "^13.0.0", 62 | "autoprefixer": "^10.2.5", 63 | "daisyui": "^4.12.10", 64 | "eslint": "^8.24.0", 65 | "eslint-plugin-import": "^2.22.1", 66 | "eslint-plugin-vue": "^9.5.1", 67 | "postcss": "^8.2.8", 68 | "rollup": "^4.21.2", 69 | "rollup-plugin-vue": "^6.0.0", 70 | "sass": "^1.78.0", 71 | "tailwindcss": "^3.1.8", 72 | "typescript": "^5.0.2", 73 | "vite": "^6.2.2", 74 | "vite-plugin-static-copy": "^2.3.0", 75 | "vue-router": "^4.1.6" 76 | }, 77 | "keywords": [ 78 | "vue", 79 | "toast", 80 | "notification", 81 | "vue3", 82 | "alert", 83 | "vue-toastify", 84 | "vue-toast", 85 | "snackbar", 86 | "toast-notification", 87 | "notice", 88 | "toastify", 89 | "toast-component", 90 | "toast-plugin", 91 | "toastify-component", 92 | "vue-notification" 93 | ] 94 | } 95 | -------------------------------------------------------------------------------- /postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nandi95/vue-toastify/18c8daf2992c6b8f88f1a45a9f1f533573e562cf/public/favicon.ico -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 137 | 138 | 342 | 343 | 368 | -------------------------------------------------------------------------------- /src/app-components/AppInput.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 68 | -------------------------------------------------------------------------------- /src/app-components/AppSelect.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 76 | -------------------------------------------------------------------------------- /src/app-components/AppStatusDisplay.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 44 | -------------------------------------------------------------------------------- /src/app-components/AppTextarea.vue: -------------------------------------------------------------------------------- 1 |