@akinon/ui-notification 0.5.0 → 1.0.1
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/cjs/index.d.ts +14 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +16 -3
- package/dist/cjs/types.d.ts +31 -9
- package/dist/esm/index.d.ts +14 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +14 -1
- package/dist/esm/types.d.ts +31 -9
- package/package.json +5 -5
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import type { openNotificationParamsType } from './types';
|
|
3
4
|
export type * from './types';
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* The Notification component is designed to display brief messages to the user as feedback, alerts, or status updates.
|
|
8
|
+
*
|
|
9
|
+
* - **Flexible Types**: Supports various types of notifications such as `success`, `info`, and `error` for clear visual distinction.
|
|
10
|
+
* - **Customizable Placement**: Allows notifications to appear in different positions on the screen, such as `topRight`, `bottomLeft`, or `top`.
|
|
11
|
+
* - **Rich Icon Support**: Includes the ability to add meaningful icons like `info-outlined` or `warning_tri` to enhance clarity.
|
|
12
|
+
* - **Dynamic Messaging**: Displays messages dynamically through provided properties, making it adaptable for a variety of use cases.
|
|
13
|
+
*
|
|
14
|
+
* This component ensures user engagement by providing timely and relevant information in an accessible manner.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare const Notifications: React.FC<openNotificationParamsType>;
|
|
5
18
|
export { notification } from 'antd';
|
|
6
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAIrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAGV,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAEjB,mBAAmB,SAAS,CAAC;AAE7B;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAClC,0BAA0B,CAoB3B,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.notification = exports.
|
|
3
|
+
exports.notification = exports.Notifications = void 0;
|
|
4
4
|
require("./index.css");
|
|
5
5
|
const icons_1 = require("@akinon/icons");
|
|
6
6
|
const antd_1 = require("antd");
|
|
7
7
|
const React = require("react");
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* The Notification component is designed to display brief messages to the user as feedback, alerts, or status updates.
|
|
11
|
+
*
|
|
12
|
+
* - **Flexible Types**: Supports various types of notifications such as `success`, `info`, and `error` for clear visual distinction.
|
|
13
|
+
* - **Customizable Placement**: Allows notifications to appear in different positions on the screen, such as `topRight`, `bottomLeft`, or `top`.
|
|
14
|
+
* - **Rich Icon Support**: Includes the ability to add meaningful icons like `info-outlined` or `warning_tri` to enhance clarity.
|
|
15
|
+
* - **Dynamic Messaging**: Displays messages dynamically through provided properties, making it adaptable for a variety of use cases.
|
|
16
|
+
*
|
|
17
|
+
* This component ensures user engagement by providing timely and relevant information in an accessible manner.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
const Notifications = openNotificationParams => {
|
|
9
21
|
const { message, type } = openNotificationParams;
|
|
10
22
|
const ICON_NAME = {
|
|
11
23
|
success: 'katalogkontrol',
|
|
@@ -18,7 +30,8 @@ const openNotification = (openNotificationParams) => {
|
|
|
18
30
|
placement: 'top',
|
|
19
31
|
icon: React.createElement(icons_1.Icon, { icon: ICON_NAME[type] })
|
|
20
32
|
});
|
|
33
|
+
return null;
|
|
21
34
|
};
|
|
22
|
-
exports.
|
|
35
|
+
exports.Notifications = Notifications;
|
|
23
36
|
var antd_2 = require("antd");
|
|
24
37
|
Object.defineProperty(exports, "notification", { enumerable: true, get: function () { return antd_2.notification; } });
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -1,22 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for opening a notification.
|
|
3
|
+
*/
|
|
1
4
|
export type openNotificationParamsType = {
|
|
5
|
+
/**
|
|
6
|
+
* The message content of the notification.
|
|
7
|
+
*/
|
|
2
8
|
message: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The type of notification box to be displayed. It determines the style and icon.
|
|
12
|
+
*/
|
|
3
13
|
type: notificationBoxType;
|
|
4
14
|
};
|
|
5
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Supported types of notification boxes.
|
|
18
|
+
*/
|
|
6
19
|
export type notificationBoxType = 'success' | 'info' | 'error';
|
|
7
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Supported icons for notifications.
|
|
23
|
+
*/
|
|
8
24
|
export type notificationIconType =
|
|
9
|
-
| 'katalogkontrol'
|
|
10
|
-
| 'info-outlined'
|
|
11
|
-
| 'warning_tri';
|
|
25
|
+
| 'katalogkontrol' // Represents a catalog control icon.
|
|
26
|
+
| 'info-outlined' // Represents an informational icon.
|
|
27
|
+
| 'warning_tri'; // Represents a warning triangle icon.
|
|
12
28
|
|
|
29
|
+
/**
|
|
30
|
+
* The possible placements for a notification on the screen.
|
|
31
|
+
*/
|
|
13
32
|
export type NotificationPlacement = (typeof NotificationPlacements)[number];
|
|
14
33
|
|
|
34
|
+
/**
|
|
35
|
+
* A list of valid placements for notifications.
|
|
36
|
+
*/
|
|
15
37
|
declare const NotificationPlacements: readonly [
|
|
16
|
-
'top',
|
|
17
|
-
'topLeft',
|
|
18
|
-
'topRight',
|
|
19
|
-
'bottom',
|
|
20
|
-
'bottomLeft',
|
|
21
|
-
'bottomRight'
|
|
38
|
+
'top', // Notification appears at the top-center of the screen.
|
|
39
|
+
'topLeft', // Notification appears at the top-left corner of the screen.
|
|
40
|
+
'topRight', // Notification appears at the top-right corner of the screen.
|
|
41
|
+
'bottom', // Notification appears at the bottom-center of the screen.
|
|
42
|
+
'bottomLeft', // Notification appears at the bottom-left corner of the screen.
|
|
43
|
+
'bottomRight' // Notification appears at the bottom-right corner of the screen.
|
|
22
44
|
];
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import type { openNotificationParamsType } from './types';
|
|
3
4
|
export type * from './types';
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* The Notification component is designed to display brief messages to the user as feedback, alerts, or status updates.
|
|
8
|
+
*
|
|
9
|
+
* - **Flexible Types**: Supports various types of notifications such as `success`, `info`, and `error` for clear visual distinction.
|
|
10
|
+
* - **Customizable Placement**: Allows notifications to appear in different positions on the screen, such as `topRight`, `bottomLeft`, or `top`.
|
|
11
|
+
* - **Rich Icon Support**: Includes the ability to add meaningful icons like `info-outlined` or `warning_tri` to enhance clarity.
|
|
12
|
+
* - **Dynamic Messaging**: Displays messages dynamically through provided properties, making it adaptable for a variety of use cases.
|
|
13
|
+
*
|
|
14
|
+
* This component ensures user engagement by providing timely and relevant information in an accessible manner.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare const Notifications: React.FC<openNotificationParamsType>;
|
|
5
18
|
export { notification } from 'antd';
|
|
6
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAIrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAGV,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAEjB,mBAAmB,SAAS,CAAC;AAE7B;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAClC,0BAA0B,CAoB3B,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,7 +2,19 @@ import './index.css';
|
|
|
2
2
|
import { Icon } from '@akinon/icons';
|
|
3
3
|
import { notification } from 'antd';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* The Notification component is designed to display brief messages to the user as feedback, alerts, or status updates.
|
|
8
|
+
*
|
|
9
|
+
* - **Flexible Types**: Supports various types of notifications such as `success`, `info`, and `error` for clear visual distinction.
|
|
10
|
+
* - **Customizable Placement**: Allows notifications to appear in different positions on the screen, such as `topRight`, `bottomLeft`, or `top`.
|
|
11
|
+
* - **Rich Icon Support**: Includes the ability to add meaningful icons like `info-outlined` or `warning_tri` to enhance clarity.
|
|
12
|
+
* - **Dynamic Messaging**: Displays messages dynamically through provided properties, making it adaptable for a variety of use cases.
|
|
13
|
+
*
|
|
14
|
+
* This component ensures user engagement by providing timely and relevant information in an accessible manner.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export const Notifications = openNotificationParams => {
|
|
6
18
|
const { message, type } = openNotificationParams;
|
|
7
19
|
const ICON_NAME = {
|
|
8
20
|
success: 'katalogkontrol',
|
|
@@ -15,5 +27,6 @@ export const openNotification = (openNotificationParams) => {
|
|
|
15
27
|
placement: 'top',
|
|
16
28
|
icon: React.createElement(Icon, { icon: ICON_NAME[type] })
|
|
17
29
|
});
|
|
30
|
+
return null;
|
|
18
31
|
};
|
|
19
32
|
export { notification } from 'antd';
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,22 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for opening a notification.
|
|
3
|
+
*/
|
|
1
4
|
export type openNotificationParamsType = {
|
|
5
|
+
/**
|
|
6
|
+
* The message content of the notification.
|
|
7
|
+
*/
|
|
2
8
|
message: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The type of notification box to be displayed. It determines the style and icon.
|
|
12
|
+
*/
|
|
3
13
|
type: notificationBoxType;
|
|
4
14
|
};
|
|
5
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Supported types of notification boxes.
|
|
18
|
+
*/
|
|
6
19
|
export type notificationBoxType = 'success' | 'info' | 'error';
|
|
7
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Supported icons for notifications.
|
|
23
|
+
*/
|
|
8
24
|
export type notificationIconType =
|
|
9
|
-
| 'katalogkontrol'
|
|
10
|
-
| 'info-outlined'
|
|
11
|
-
| 'warning_tri';
|
|
25
|
+
| 'katalogkontrol' // Represents a catalog control icon.
|
|
26
|
+
| 'info-outlined' // Represents an informational icon.
|
|
27
|
+
| 'warning_tri'; // Represents a warning triangle icon.
|
|
12
28
|
|
|
29
|
+
/**
|
|
30
|
+
* The possible placements for a notification on the screen.
|
|
31
|
+
*/
|
|
13
32
|
export type NotificationPlacement = (typeof NotificationPlacements)[number];
|
|
14
33
|
|
|
34
|
+
/**
|
|
35
|
+
* A list of valid placements for notifications.
|
|
36
|
+
*/
|
|
15
37
|
declare const NotificationPlacements: readonly [
|
|
16
|
-
'top',
|
|
17
|
-
'topLeft',
|
|
18
|
-
'topRight',
|
|
19
|
-
'bottom',
|
|
20
|
-
'bottomLeft',
|
|
21
|
-
'bottomRight'
|
|
38
|
+
'top', // Notification appears at the top-center of the screen.
|
|
39
|
+
'topLeft', // Notification appears at the top-left corner of the screen.
|
|
40
|
+
'topRight', // Notification appears at the top-right corner of the screen.
|
|
41
|
+
'bottom', // Notification appears at the bottom-center of the screen.
|
|
42
|
+
'bottomLeft', // Notification appears at the bottom-left corner of the screen.
|
|
43
|
+
'bottomRight' // Notification appears at the bottom-right corner of the screen.
|
|
22
44
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/ui-notification",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"antd": "5.
|
|
13
|
-
"@akinon/icons": "0.
|
|
12
|
+
"antd": "5.22.6",
|
|
13
|
+
"@akinon/icons": "1.0.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"clean-package": "2.2.0",
|
|
17
17
|
"copyfiles": "^2.4.1",
|
|
18
18
|
"rimraf": "^5.0.5",
|
|
19
|
-
"typescript": "
|
|
20
|
-
"@akinon/typescript-config": "0.
|
|
19
|
+
"typescript": "*",
|
|
20
|
+
"@akinon/typescript-config": "1.0.1"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=18",
|