@yusufceng1z/ding-vue 0.0.0-stage → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yusuf Cengiz
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.
package/README.md CHANGED
@@ -1,3 +1,37 @@
1
- # Temporary Holding Version
1
+ # @yusufceng1z/ding-vue
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Toasts with real spring physics for Vue 3 and Nuxt. One toast that morphs in place. No stylesheet to import.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i @yusufceng1z/ding-vue
9
+ ```
10
+
11
+ ## Use
12
+
13
+ Render the toaster once, then call `toast` from anywhere.
14
+
15
+ ```vue
16
+ <script setup>
17
+ import { Toaster, toast } from '@yusufceng1z/ding-vue';
18
+ </script>
19
+
20
+ <template>
21
+ <Toaster position="top-center" theme="system" />
22
+ <button @click="toast.success('Saved')">Save</button>
23
+ </template>
24
+ ```
25
+
26
+ `Toaster` renders nothing in place. It mounts in `onMounted`, so it is safe to server-render. In Nuxt, put it in `app.vue` and call `toast` from client code (event handlers, `onMounted`).
27
+
28
+ Options, actions, progress, sound and accessibility are covered in the [docs](https://ding.yusufcengiz.dev/docs.html).
29
+
30
+ ## Links
31
+
32
+ - [Live demo and docs](https://ding.yusufcengiz.dev)
33
+ - [Source on GitHub](https://github.com/YusufCeng1z/ding)
34
+
35
+ ## License
36
+
37
+ [MIT](LICENSE)
package/dist/index.cjs ADDED
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Toaster: () => Toaster,
24
+ toast: () => import_ding.toast
25
+ });
26
+ module.exports = __toCommonJS(index_exports);
27
+ var import_vue = require("vue");
28
+ var import_ding = require("@yusufceng1z/ding");
29
+ var Toaster = (0, import_vue.defineComponent)({
30
+ name: "Toaster",
31
+ props: {
32
+ position: String,
33
+ theme: String,
34
+ labels: Object,
35
+ /** CSP nonce for the injected stylesheet. */
36
+ nonce: String
37
+ },
38
+ setup(props) {
39
+ let unmount;
40
+ (0, import_vue.onMounted)(() => {
41
+ unmount = (0, import_ding.mountToaster)({ position: props.position, theme: props.theme, labels: props.labels, nonce: props.nonce });
42
+ });
43
+ (0, import_vue.watch)(
44
+ () => [props.position, props.theme, props.labels?.region, props.labels?.dismiss],
45
+ ([position, theme, region, dismiss]) => import_ding.toast.configure({ position, theme, labels: { region, dismiss } })
46
+ );
47
+ (0, import_vue.onBeforeUnmount)(() => unmount?.());
48
+ return () => null;
49
+ }
50
+ });
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ Toaster,
54
+ toast
55
+ });
@@ -0,0 +1,24 @@
1
+ import * as vue from 'vue';
2
+ import { PropType } from 'vue';
3
+ import { Position, Theme, ToastLabels } from '@yusufceng1z/ding';
4
+ export { Position, Theme, ToastLabels, toast } from '@yusufceng1z/ding';
5
+
6
+ /**
7
+ * Mount once, near the root of your app. It renders nothing in place: the toasts live in a
8
+ * viewport appended to `document.body`, and mounting happens in `onMounted`, so it is a no-op on the server.
9
+ */
10
+ declare const Toaster: vue.DefineComponent<vue.ExtractPropTypes<{
11
+ position: PropType<Position>;
12
+ theme: PropType<Theme>;
13
+ labels: PropType<Partial<ToastLabels>>;
14
+ /** CSP nonce for the injected stylesheet. */
15
+ nonce: StringConstructor;
16
+ }>, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
17
+ position: PropType<Position>;
18
+ theme: PropType<Theme>;
19
+ labels: PropType<Partial<ToastLabels>>;
20
+ /** CSP nonce for the injected stylesheet. */
21
+ nonce: StringConstructor;
22
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
23
+
24
+ export { Toaster };
@@ -0,0 +1,24 @@
1
+ import * as vue from 'vue';
2
+ import { PropType } from 'vue';
3
+ import { Position, Theme, ToastLabels } from '@yusufceng1z/ding';
4
+ export { Position, Theme, ToastLabels, toast } from '@yusufceng1z/ding';
5
+
6
+ /**
7
+ * Mount once, near the root of your app. It renders nothing in place: the toasts live in a
8
+ * viewport appended to `document.body`, and mounting happens in `onMounted`, so it is a no-op on the server.
9
+ */
10
+ declare const Toaster: vue.DefineComponent<vue.ExtractPropTypes<{
11
+ position: PropType<Position>;
12
+ theme: PropType<Theme>;
13
+ labels: PropType<Partial<ToastLabels>>;
14
+ /** CSP nonce for the injected stylesheet. */
15
+ nonce: StringConstructor;
16
+ }>, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
17
+ position: PropType<Position>;
18
+ theme: PropType<Theme>;
19
+ labels: PropType<Partial<ToastLabels>>;
20
+ /** CSP nonce for the injected stylesheet. */
21
+ nonce: StringConstructor;
22
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
23
+
24
+ export { Toaster };
package/dist/index.js ADDED
@@ -0,0 +1,29 @@
1
+ // src/index.ts
2
+ import { defineComponent, onBeforeUnmount, onMounted, watch } from "vue";
3
+ import { toast, mountToaster } from "@yusufceng1z/ding";
4
+ var Toaster = defineComponent({
5
+ name: "Toaster",
6
+ props: {
7
+ position: String,
8
+ theme: String,
9
+ labels: Object,
10
+ /** CSP nonce for the injected stylesheet. */
11
+ nonce: String
12
+ },
13
+ setup(props) {
14
+ let unmount;
15
+ onMounted(() => {
16
+ unmount = mountToaster({ position: props.position, theme: props.theme, labels: props.labels, nonce: props.nonce });
17
+ });
18
+ watch(
19
+ () => [props.position, props.theme, props.labels?.region, props.labels?.dismiss],
20
+ ([position, theme, region, dismiss]) => toast.configure({ position, theme, labels: { region, dismiss } })
21
+ );
22
+ onBeforeUnmount(() => unmount?.());
23
+ return () => null;
24
+ }
25
+ });
26
+ export {
27
+ Toaster,
28
+ toast
29
+ };
package/package.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
2
  "name": "@yusufceng1z/ding-vue",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ }
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "dependencies": {
25
+ "@yusufceng1z/ding": "0.0.4"
26
+ },
27
+ "peerDependencies": {
28
+ "vue": "^3.3.0"
29
+ },
30
+ "devDependencies": {
31
+ "@vue/test-utils": "^2.4.6",
32
+ "happy-dom": "^21.0.4",
33
+ "vue": "^3.5.0",
34
+ "vitest": "^5.1.0"
35
+ },
36
+ "description": "Vue 3 renderer for Ding spring-physics toasts.",
37
+ "homepage": "https://ding.yusufcengiz.dev",
38
+ "bugs": {
39
+ "url": "https://github.com/YusufCeng1z/ding/issues"
40
+ },
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/YusufCeng1z/ding.git",
44
+ "directory": "packages/vue"
45
+ },
46
+ "keywords": [
47
+ "toast",
48
+ "notification",
49
+ "spring",
50
+ "animation",
51
+ "vue",
52
+ "nuxt"
53
+ ],
54
+ "engines": {
55
+ "node": ">=18"
56
+ },
57
+ "publishConfig": {
58
+ "access": "public"
59
+ },
60
+ "license": "MIT",
61
+ "author": "Yusuf Cengiz",
62
+ "scripts": {
63
+ "build": "tsup",
64
+ "test": "vitest run",
65
+ "typecheck": "tsc -p ."
66
+ }
6
67
  }