@abpjs/theme-shared 1.1.0 → 2.0.0
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/components/confirmation/Confirmation.d.ts +2 -0
- package/dist/components/toast/Toast.d.ts +11 -1
- package/dist/constants/styles.d.ts +6 -1
- package/dist/contexts/confirmation.context.d.ts +79 -25
- package/dist/contexts/toaster.context.d.ts +88 -19
- package/dist/index.d.ts +14 -1
- package/dist/index.js +236 -83
- package/dist/index.mjs +254 -97
- package/dist/models/confirmation.d.ts +37 -19
- package/dist/models/toaster.d.ts +56 -10
- package/package.json +3 -3
|
@@ -1,36 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Confirmation namespace containing types for confirmation dialogs.
|
|
3
3
|
* Translated from @abp/ng.theme.shared/lib/models/confirmation.ts
|
|
4
|
+
*
|
|
5
|
+
* @since 2.0.0 - Major changes:
|
|
6
|
+
* - Options no longer extends Toaster.Options
|
|
7
|
+
* - Added DialogData interface
|
|
8
|
+
* - Added Severity type
|
|
9
|
+
* - Removed deprecated cancelCopy/yesCopy
|
|
4
10
|
*/
|
|
5
11
|
import type { Config } from '@abpjs/core';
|
|
6
|
-
import { Toaster } from './toaster';
|
|
7
12
|
export declare namespace Confirmation {
|
|
8
13
|
/**
|
|
9
14
|
* Options for configuring a confirmation dialog.
|
|
10
|
-
*
|
|
15
|
+
* @since 2.0.0 - No longer extends Toaster.Options
|
|
11
16
|
*/
|
|
12
|
-
interface Options
|
|
17
|
+
interface Options {
|
|
18
|
+
/** Unique identifier for the confirmation */
|
|
19
|
+
id?: string | number;
|
|
20
|
+
/** Whether the confirmation can be closed by clicking outside or pressing escape */
|
|
21
|
+
closable?: boolean;
|
|
22
|
+
/** Parameters for localizing the message */
|
|
23
|
+
messageLocalizationParams?: string[];
|
|
24
|
+
/** Parameters for localizing the title */
|
|
25
|
+
titleLocalizationParams?: string[];
|
|
13
26
|
/** Hide the cancel button */
|
|
14
27
|
hideCancelBtn?: boolean;
|
|
15
28
|
/** Hide the yes/confirm button */
|
|
16
29
|
hideYesBtn?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Custom text for the cancel button
|
|
19
|
-
* @since 1.1.0 - Now accepts Config.LocalizationParam
|
|
20
|
-
*/
|
|
30
|
+
/** Custom text for the cancel button */
|
|
21
31
|
cancelText?: Config.LocalizationParam;
|
|
22
|
-
/**
|
|
23
|
-
* Custom text for the yes button
|
|
24
|
-
* @since 1.1.0 - Now accepts Config.LocalizationParam
|
|
25
|
-
*/
|
|
32
|
+
/** Custom text for the yes button */
|
|
26
33
|
yesText?: Config.LocalizationParam;
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated Use cancelText instead. Will be removed in v2.0.0
|
|
29
|
-
*/
|
|
30
|
-
cancelCopy?: Config.LocalizationParam;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated Use yesCopy instead. Will be removed in v2.0.0
|
|
33
|
-
*/
|
|
34
|
-
yesCopy?: Config.LocalizationParam;
|
|
35
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Dialog data structure for confirmation dialogs.
|
|
37
|
+
* @since 2.0.0
|
|
38
|
+
*/
|
|
39
|
+
interface DialogData {
|
|
40
|
+
/** The message content */
|
|
41
|
+
message: Config.LocalizationParam;
|
|
42
|
+
/** The title */
|
|
43
|
+
title?: Config.LocalizationParam;
|
|
44
|
+
/** Severity level affects the styling */
|
|
45
|
+
severity?: Severity;
|
|
46
|
+
/** Options for the confirmation */
|
|
47
|
+
options?: Partial<Options>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Severity levels for confirmation dialogs.
|
|
51
|
+
* @since 2.0.0
|
|
52
|
+
*/
|
|
53
|
+
type Severity = 'neutral' | 'success' | 'info' | 'warning' | 'error';
|
|
36
54
|
}
|
package/dist/models/toaster.d.ts
CHANGED
|
@@ -1,31 +1,56 @@
|
|
|
1
|
+
import type { Config } from '@abpjs/core';
|
|
1
2
|
/**
|
|
2
3
|
* Toaster namespace containing types and interfaces for toast notifications.
|
|
3
4
|
* Translated from @abp/ng.theme.shared/lib/models/toaster.ts
|
|
5
|
+
*
|
|
6
|
+
* @since 2.0.0 - Major changes:
|
|
7
|
+
* - `Options` renamed to `ToastOptions`
|
|
8
|
+
* - New `Toast` interface
|
|
9
|
+
* - `Severity` type changed: 'warn' → 'warning', added 'neutral'
|
|
10
|
+
* - ToasterService methods now return number (toast ID) instead of Observable
|
|
4
11
|
*/
|
|
5
12
|
export declare namespace Toaster {
|
|
6
13
|
/**
|
|
7
14
|
* Options for configuring a toast notification.
|
|
15
|
+
* @since 2.0.0 - Renamed from Options, restructured properties
|
|
8
16
|
*/
|
|
9
|
-
interface
|
|
10
|
-
/**
|
|
11
|
-
id?: string;
|
|
12
|
-
/** Whether the toast can be manually closed */
|
|
13
|
-
closable?: boolean;
|
|
14
|
-
/** Duration in milliseconds before auto-dismiss (default varies by implementation) */
|
|
17
|
+
interface ToastOptions {
|
|
18
|
+
/** Duration in milliseconds before auto-dismiss */
|
|
15
19
|
life?: number;
|
|
16
20
|
/** If true, toast won't auto-dismiss */
|
|
17
21
|
sticky?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
|
|
22
|
+
/** Whether the toast can be manually closed */
|
|
23
|
+
closable?: boolean;
|
|
24
|
+
/** Whether tapping the toast dismisses it */
|
|
25
|
+
tapToDismiss?: boolean;
|
|
20
26
|
/** Parameters for localizing the message */
|
|
21
27
|
messageLocalizationParams?: string[];
|
|
22
28
|
/** Parameters for localizing the title */
|
|
23
29
|
titleLocalizationParams?: string[];
|
|
30
|
+
/** Unique identifier for the toast */
|
|
31
|
+
id: number | string;
|
|
32
|
+
/** Container key for positioning toasts in specific containers */
|
|
33
|
+
containerKey?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Complete toast structure.
|
|
37
|
+
* @since 2.0.0
|
|
38
|
+
*/
|
|
39
|
+
interface Toast {
|
|
40
|
+
/** The message content (can be a localization key) */
|
|
41
|
+
message: Config.LocalizationParam;
|
|
42
|
+
/** The title (can be a localization key) */
|
|
43
|
+
title?: Config.LocalizationParam;
|
|
44
|
+
/** Severity level of the toast */
|
|
45
|
+
severity?: string;
|
|
46
|
+
/** Options for the toast */
|
|
47
|
+
options?: ToastOptions;
|
|
24
48
|
}
|
|
25
49
|
/**
|
|
26
50
|
* Severity levels for toast notifications.
|
|
51
|
+
* @since 2.0.0 - Changed 'warn' to 'warning', added 'neutral'
|
|
27
52
|
*/
|
|
28
|
-
type Severity = 'success' | 'info' | '
|
|
53
|
+
type Severity = 'neutral' | 'success' | 'info' | 'warning' | 'error';
|
|
29
54
|
/**
|
|
30
55
|
* Status values for toast/confirmation interactions.
|
|
31
56
|
*/
|
|
@@ -35,7 +60,28 @@ export declare namespace Toaster {
|
|
|
35
60
|
dismiss = "dismiss"
|
|
36
61
|
}
|
|
37
62
|
/**
|
|
38
|
-
*
|
|
63
|
+
* @deprecated Use ToastOptions instead. Scheduled for removal in v3.0.0
|
|
64
|
+
* Preserved for backward compatibility.
|
|
65
|
+
*/
|
|
66
|
+
interface Options {
|
|
67
|
+
/** Unique identifier for the toast */
|
|
68
|
+
id?: string;
|
|
69
|
+
/** Whether the toast can be manually closed */
|
|
70
|
+
closable?: boolean;
|
|
71
|
+
/** Duration in milliseconds before auto-dismiss (default varies by implementation) */
|
|
72
|
+
life?: number;
|
|
73
|
+
/** If true, toast won't auto-dismiss */
|
|
74
|
+
sticky?: boolean;
|
|
75
|
+
/** Custom data to attach to the toast */
|
|
76
|
+
data?: unknown;
|
|
77
|
+
/** Parameters for localizing the message */
|
|
78
|
+
messageLocalizationParams?: string[];
|
|
79
|
+
/** Parameters for localizing the title */
|
|
80
|
+
titleLocalizationParams?: string[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated Use Toast instead. Scheduled for removal in v3.0.0
|
|
84
|
+
* Preserved for backward compatibility.
|
|
39
85
|
*/
|
|
40
86
|
interface Message extends Options {
|
|
41
87
|
/** The message content (can be a localization key) */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abpjs/theme-shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "ABP Framework Theme Shared components for React - translated from @abp/ng.theme.shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"next-themes": "^0.4.6",
|
|
28
28
|
"react-hook-form": "^7.48.0",
|
|
29
29
|
"react-icons": "^5.5.0",
|
|
30
|
-
"@abpjs/core": "
|
|
30
|
+
"@abpjs/core": "2.0.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@abp/ng.theme.shared": "
|
|
33
|
+
"@abp/ng.theme.shared": "2.0.0",
|
|
34
34
|
"@vitest/coverage-v8": "^3.2.0"
|
|
35
35
|
},
|
|
36
36
|
"author": "tekthar.com",
|