@akinon/ui-alert 1.0.2 → 1.1.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/cjs/constants.d.ts +8 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +10 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +12 -12
- package/dist/cjs/types.d.ts +1 -7
- package/dist/esm/constants.d.ts +8 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +7 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/types.d.ts +1 -7
- package/package.json +10 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC"}
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;GAQG;AAEH,eAAO,MAAM,KAAK,GAAI,uBAAuB,WAAW,sBA4EvD,CAAC;AAEF,mBAAmB,SAAS,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const ui_theme_1 = require("@akinon/ui-theme");
|
|
|
17
17
|
const cssinjs_1 = require("@ant-design/cssinjs");
|
|
18
18
|
const antd_1 = require("antd");
|
|
19
19
|
const React = require("react");
|
|
20
|
-
const
|
|
20
|
+
const constants_1 = require("./constants");
|
|
21
21
|
/**
|
|
22
22
|
* Alert component for Akinon UI.
|
|
23
23
|
*
|
|
@@ -43,27 +43,27 @@ const Alert = (_a) => {
|
|
|
43
43
|
const prefixClsWithoutHash = `.${getPrefixCls()}-alert`;
|
|
44
44
|
return {
|
|
45
45
|
[prefixCls]: {
|
|
46
|
-
[`&${prefixCls}-${
|
|
46
|
+
[`&${prefixCls}-${constants_1.AlertTypeKeys.success}`]: {
|
|
47
47
|
color: alertToken.defaultColorSuccess,
|
|
48
48
|
borderColor: alertToken.defaultBorderColorSuccess,
|
|
49
49
|
backgroundColor: alertToken.defaultBgSuccess
|
|
50
50
|
},
|
|
51
|
-
[`&${prefixCls}-${
|
|
51
|
+
[`&${prefixCls}-${constants_1.AlertTypeKeys.infoOne}`]: {
|
|
52
52
|
color: alertToken.defaultColorWaiting1,
|
|
53
53
|
borderColor: alertToken.defaultBorderColorWaiting1,
|
|
54
54
|
backgroundColor: alertToken.defaultBgWaiting1
|
|
55
55
|
},
|
|
56
|
-
[`&${prefixCls}-${
|
|
56
|
+
[`&${prefixCls}-${constants_1.AlertTypeKeys.infoTwo}`]: {
|
|
57
57
|
color: alertToken.defaultColorWaiting2,
|
|
58
58
|
borderColor: alertToken.defaultBorderColorWaiting2,
|
|
59
59
|
backgroundColor: alertToken.defaultBgWaiting2
|
|
60
60
|
},
|
|
61
|
-
[`&${prefixCls}-${
|
|
61
|
+
[`&${prefixCls}-${constants_1.AlertTypeKeys.infoThree}`]: {
|
|
62
62
|
color: alertToken.defaultColorWaiting3,
|
|
63
63
|
borderColor: alertToken.defaultBorderColorWaiting3,
|
|
64
64
|
backgroundColor: alertToken.defaultBgWaiting3
|
|
65
65
|
},
|
|
66
|
-
[`&${prefixCls}-${
|
|
66
|
+
[`&${prefixCls}-${constants_1.AlertTypeKeys.error}`]: {
|
|
67
67
|
color: alertToken.defaultColorFailed,
|
|
68
68
|
borderColor: alertToken.defaultBorderColorFailed,
|
|
69
69
|
backgroundColor: alertToken.defaultBgFailed
|
|
@@ -73,14 +73,14 @@ const Alert = (_a) => {
|
|
|
73
73
|
};
|
|
74
74
|
});
|
|
75
75
|
const iconNameMap = {
|
|
76
|
-
[
|
|
77
|
-
[
|
|
78
|
-
[
|
|
79
|
-
[
|
|
80
|
-
[
|
|
76
|
+
[constants_1.AlertTypeKeys.success]: 'yes',
|
|
77
|
+
[constants_1.AlertTypeKeys.infoOne]: 'info',
|
|
78
|
+
[constants_1.AlertTypeKeys.infoTwo]: 'info',
|
|
79
|
+
[constants_1.AlertTypeKeys.infoThree]: 'info',
|
|
80
|
+
[constants_1.AlertTypeKeys.error]: 'no',
|
|
81
81
|
info: 'info'
|
|
82
82
|
};
|
|
83
83
|
const iconName = React.useMemo(() => { var _a; return iconNameMap[(_a = restAlertProps.type) !== null && _a !== void 0 ? _a : 'success']; }, [restAlertProps.type]);
|
|
84
|
-
return useStyle(React.createElement(antd_1.Alert, Object.assign({ type:
|
|
84
|
+
return useStyle(React.createElement(antd_1.Alert, Object.assign({ type: constants_1.AlertTypeKeys.success }, restAlertProps, { icon: React.createElement(icons_1.Icon, { size: 14, icon: ((_b = restAlertProps.icon) !== null && _b !== void 0 ? _b : iconName) }) })));
|
|
85
85
|
};
|
|
86
86
|
exports.Alert = Alert;
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -2,13 +2,7 @@ import { IconName } from '@akinon/icons';
|
|
|
2
2
|
import { DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE } from '@akinon/ui-theme';
|
|
3
3
|
import { AriaRole } from 'react';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
success: 'success',
|
|
7
|
-
infoOne: 'info-one',
|
|
8
|
-
infoTwo: 'info-two',
|
|
9
|
-
infoThree: 'info-three',
|
|
10
|
-
error: 'error'
|
|
11
|
-
} as const;
|
|
5
|
+
import { AlertTypeKeys } from './constants';
|
|
12
6
|
|
|
13
7
|
export type IAlertProps = {
|
|
14
8
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;GAQG;AAEH,eAAO,MAAM,KAAK,GAAI,uBAAuB,WAAW,sBA4EvD,CAAC;AAEF,mBAAmB,SAAS,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { useToken } from '@akinon/ui-theme';
|
|
|
14
14
|
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
15
15
|
import { Alert as AntAlert, ConfigProvider } from 'antd';
|
|
16
16
|
import * as React from 'react';
|
|
17
|
-
import { AlertTypeKeys } from './
|
|
17
|
+
import { AlertTypeKeys } from './constants';
|
|
18
18
|
/**
|
|
19
19
|
* Alert component for Akinon UI.
|
|
20
20
|
*
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -2,13 +2,7 @@ import { IconName } from '@akinon/icons';
|
|
|
2
2
|
import { DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE } from '@akinon/ui-theme';
|
|
3
3
|
import { AriaRole } from 'react';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
success: 'success',
|
|
7
|
-
infoOne: 'info-one',
|
|
8
|
-
infoTwo: 'info-two',
|
|
9
|
-
infoThree: 'info-three',
|
|
10
|
-
error: 'error'
|
|
11
|
-
} as const;
|
|
5
|
+
import { AlertTypeKeys } from './constants';
|
|
12
6
|
|
|
13
7
|
export type IAlertProps = {
|
|
14
8
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/ui-alert",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -9,20 +9,21 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"@akinon/
|
|
12
|
+
"@ant-design/cssinjs": "^1.24.0",
|
|
13
|
+
"antd": "^5.27.0",
|
|
14
|
+
"@akinon/ui-theme": "1.1.0",
|
|
15
|
+
"@akinon/icons": "1.1.0"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"clean-package": "2.2.0",
|
|
18
19
|
"copyfiles": "^2.4.1",
|
|
19
20
|
"rimraf": "^5.0.5",
|
|
20
21
|
"typescript": "*",
|
|
21
|
-
"@akinon/typescript-config": "1.0
|
|
22
|
+
"@akinon/typescript-config": "1.1.0"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
24
|
-
"react": "
|
|
25
|
-
"react-dom": "
|
|
25
|
+
"react": "^18 || ^19",
|
|
26
|
+
"react-dom": "^18 || ^19"
|
|
26
27
|
},
|
|
27
28
|
"clean-package": "../../../clean-package.config.json",
|
|
28
29
|
"types": "dist/esm/index.d.ts",
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
|
|
39
|
-
"build:esm": "tsc --outDir dist/esm",
|
|
40
40
|
"build:commonjs": "tsc --module commonjs --outDir dist/cjs",
|
|
41
|
-
"
|
|
41
|
+
"build:esm": "tsc --outDir dist/esm",
|
|
42
42
|
"clean": "rimraf dist/",
|
|
43
|
+
"copy:files": "copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/esm && copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/cjs",
|
|
43
44
|
"typecheck": "tsc --noEmit"
|
|
44
45
|
}
|
|
45
46
|
}
|