@t007/dialog 0.0.19 → 0.0.20

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/dist/index.d.ts CHANGED
@@ -1,15 +1,36 @@
1
1
  import "@t007/utils";
2
2
  import type { FieldOptions } from "@t007/input";
3
3
 
4
+ /** Shared options for alert, confirm, and prompt dialogs. */
4
5
  export interface DialogOptions extends FieldOptions {
6
+ /** Text for the confirmation button. */
5
7
  confirmText?: string;
8
+ /** Text for the cancel button. */
6
9
  cancelText?: string;
10
+ /** Default value used by prompt dialogs. */
7
11
  value?: string;
8
12
  }
9
13
 
10
14
  // BUNDLE EXPORTS & GLOBAL DECLARATIONS
15
+
16
+ /** Show an alert dialog and resolve when the user confirms.
17
+ * @param message Message shown in the dialog body.
18
+ * @param options Optional dialog configuration.
19
+ * @returns Promise that resolves to the user choice.
20
+ */
11
21
  export function Alert(message: string, options?: DialogOptions): Promise<boolean>;
22
+ /** Show a confirm dialog and resolve with the user choice.
23
+ * @param question Question shown in the dialog body.
24
+ * @param options Optional dialog configuration.
25
+ * @returns Promise that resolves to true when confirmed.
26
+ */
12
27
  export function Confirm(question: string, options?: DialogOptions): Promise<boolean>;
28
+ /** Show a prompt dialog and resolve with the entered value.
29
+ * @param question Question shown in the dialog body.
30
+ * @param defaultValue Initial value for the prompt input.
31
+ * @param options Optional dialog configuration.
32
+ * @returns Promise that resolves to the entered string or null.
33
+ */
13
34
  export function Prompt(
14
35
  question: string,
15
36
  defaultValue?: string,
@@ -18,11 +39,13 @@ export function Prompt(
18
39
 
19
40
  declare global {
20
41
  interface T007Namespace {
42
+ /** Browser alert helper. */
21
43
  alert: typeof Alert;
44
+ /** Browser confirm helper. */
22
45
  confirm: typeof Confirm;
46
+ /** Browser prompt helper. */
23
47
  prompt: typeof Prompt;
24
48
  }
25
-
26
49
  interface Window {
27
50
  Alert?: T007Namespace["alert"];
28
51
  Confirm?: T007Namespace["confirm"];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  (() => {
3
- // ../sia-reactor/dist/chunk-5A44QFT6.js
3
+ // ../../node_modules/sia-reactor/dist/chunk-5A44QFT6.js
4
4
  function createEl(tag, props, dataset, styles, el = tag ? document?.createElement(tag) : null) {
5
5
  return assignEl(el, props, dataset, styles), el;
6
6
  }
@@ -17,7 +17,7 @@
17
17
  }
18
18
  }
19
19
 
20
- // ../sia-reactor/dist/chunk-P37ADJMM.js
20
+ // ../../node_modules/sia-reactor/dist/chunk-P37ADJMM.js
21
21
  function onAllMethods(owner, callback, skipOwn = true, nested = false) {
22
22
  let proto = owner;
23
23
  while (proto && proto !== Object.prototype) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t007/dialog",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "A lightweight, pure JS dialog system.",
5
5
  "author": "Oketade Oluwatobiloba <tobioketade007@gmail.com>",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "url": "git+https://github.com/Tobi007-del/t007-tools.git",
10
10
  "directory": "packages/dialog"
11
11
  },
12
- "homepage": "https://github.com/Tobi007-del/t007-tools/tree/main/packages/dialog#readme",
12
+ "homepage": "https://github.com/Tobi007-del/t007-tools/sia-reactormain/packages/dialog#readme",
13
13
  "bugs": {
14
14
  "url": "https://github.com/Tobi007-del/t007-tools/issues"
15
15
  },
@@ -55,6 +55,6 @@
55
55
  "accessible"
56
56
  ],
57
57
  "dependencies": {
58
- "@t007/utils": "^0.0.22"
58
+ "@t007/utils": "^0.0.23"
59
59
  }
60
60
  }