@akinon/ui-alert 1.0.2 → 1.1.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.
@@ -0,0 +1,8 @@
1
+ export declare const AlertTypeKeys: {
2
+ readonly success: "success";
3
+ readonly infoOne: "info-one";
4
+ readonly infoTwo: "info-two";
5
+ readonly infoThree: "info-three";
6
+ readonly error: "error";
7
+ };
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlertTypeKeys = void 0;
4
+ exports.AlertTypeKeys = {
5
+ success: 'success',
6
+ infoOne: 'info-one',
7
+ infoTwo: 'info-two',
8
+ infoThree: 'info-three',
9
+ error: 'error'
10
+ };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { type IAlertProps } from './types.d';
2
+ import type { IAlertProps } from './types';
3
3
  /**
4
4
  * Alert component for Akinon UI.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAE5D;;;;;;;;GAQG;AAEH,eAAO,MAAM,KAAK,0BAA2B,WAAW,sBA4EvD,CAAC;AAEF,mBAAmB,SAAS,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 types_d_1 = require("./types.d");
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}-${types_d_1.AlertTypeKeys.success}`]: {
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}-${types_d_1.AlertTypeKeys.infoOne}`]: {
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}-${types_d_1.AlertTypeKeys.infoTwo}`]: {
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}-${types_d_1.AlertTypeKeys.infoThree}`]: {
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}-${types_d_1.AlertTypeKeys.error}`]: {
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
- [types_d_1.AlertTypeKeys.success]: 'yes',
77
- [types_d_1.AlertTypeKeys.infoOne]: 'info',
78
- [types_d_1.AlertTypeKeys.infoTwo]: 'info',
79
- [types_d_1.AlertTypeKeys.infoThree]: 'info',
80
- [types_d_1.AlertTypeKeys.error]: 'no',
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: types_d_1.AlertTypeKeys.success }, restAlertProps, { icon: React.createElement(icons_1.Icon, { size: 14, icon: ((_b = restAlertProps.icon) !== null && _b !== void 0 ? _b : iconName) }) })));
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;
@@ -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
- export const AlertTypeKeys = {
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,8 @@
1
+ export declare const AlertTypeKeys: {
2
+ readonly success: "success";
3
+ readonly infoOne: "info-one";
4
+ readonly infoTwo: "info-two";
5
+ readonly infoThree: "info-three";
6
+ readonly error: "error";
7
+ };
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export const AlertTypeKeys = {
2
+ success: 'success',
3
+ infoOne: 'info-one',
4
+ infoTwo: 'info-two',
5
+ infoThree: 'info-three',
6
+ error: 'error'
7
+ };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { type IAlertProps } from './types.d';
2
+ import type { IAlertProps } from './types';
3
3
  /**
4
4
  * Alert component for Akinon UI.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAE5D;;;;;;;;GAQG;AAEH,eAAO,MAAM,KAAK,0BAA2B,WAAW,sBA4EvD,CAAC;AAEF,mBAAmB,SAAS,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 './types.d';
17
+ import { AlertTypeKeys } from './constants';
18
18
  /**
19
19
  * Alert component for Akinon UI.
20
20
  *
@@ -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
- export const AlertTypeKeys = {
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.2",
3
+ "version": "1.1.1",
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
- "antd": "5.22.6",
13
- "@akinon/ui-theme": "1.0.2",
14
- "@akinon/icons": "1.0.1"
12
+ "@ant-design/cssinjs": "^1.24.0",
13
+ "antd": "^5.27.0",
14
+ "@akinon/icons": "1.1.0",
15
+ "@akinon/ui-theme": "1.1.1"
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.1"
22
+ "@akinon/typescript-config": "1.1.0"
22
23
  },
23
24
  "peerDependencies": {
24
- "react": ">=18",
25
- "react-dom": ">=18"
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
- "copy:files": "copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/esm && copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/cjs",
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
  }