@akinon/ui-alert 0.4.0 → 0.5.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.
@@ -0,0 +1,109 @@
1
+ import { AlertStatus } from './';
2
+
3
+ export type AlertProps = Omit<
4
+ AntAlertProps,
5
+ | 'prefixCls'
6
+ | 'style'
7
+ | 'styles'
8
+ | 'closeIcon'
9
+ | 'onMouseEnter'
10
+ | 'onMouseLeave'
11
+ | 'onClick'
12
+ | 'id'
13
+ | 'role'
14
+ > & {
15
+ /**
16
+ * The status of the alert.
17
+ */
18
+ status?: AlertStatus;
19
+ };
20
+
21
+ interface AntAlertProps {
22
+ /** Type of Alert styles */
23
+ type?: 'success' | 'info' | 'warning' | 'error';
24
+ /** Whether Alert can be closed */
25
+ closable?: ClosableType;
26
+ /** Content of Alert */
27
+ message?: React.ReactNode;
28
+ /** Additional content of Alert */
29
+ description?: React.ReactNode;
30
+ /** Callback when close Alert */
31
+ onClose?: React.MouseEventHandler<HTMLButtonElement>;
32
+ /** Trigger when animation ending of Alert */
33
+ afterClose?: () => void;
34
+ /** Whether to show icon */
35
+ showIcon?: boolean;
36
+ /** https://www.w3.org/TR/2014/REC-html5-20141028/dom.html#aria-role-attribute */
37
+ role?: string;
38
+ style?: React.CSSProperties;
39
+ prefixCls?: string;
40
+ /**
41
+ * The additional css class
42
+ */
43
+ className?: string;
44
+ /**
45
+ * ClassName on the root element
46
+ */
47
+ rootClassName?: string;
48
+ /**
49
+ * Whether to show as banner
50
+ */
51
+ banner?: boolean;
52
+ /**
53
+ * Custom icon, effective when showIcon is true
54
+ */
55
+ icon?: React.ReactNode;
56
+ /**
57
+ * Custom close icon
58
+ */
59
+ closeIcon?: React.ReactNode;
60
+ /**
61
+ * The action of Alert
62
+ */
63
+ action?: React.ReactNode;
64
+ onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
65
+ onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
66
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
67
+ id?: string;
68
+ }
69
+
70
+ type BaseClosableType = {
71
+ closeIcon?: React.ReactNode;
72
+ } & React.AriaAttributes;
73
+
74
+ type ClosableType = boolean | BaseClosableType;
75
+
76
+ interface ErrorBoundaryProps {
77
+ message?: React.ReactNode;
78
+ description?: React.ReactNode;
79
+ children?: React.ReactNode;
80
+ id?: string;
81
+ }
82
+
83
+ interface ErrorBoundaryStates {
84
+ error?: Error | null;
85
+ info?: {
86
+ componentStack?: string;
87
+ };
88
+ }
89
+
90
+ declare class ErrorBoundary extends React.Component<
91
+ ErrorBoundaryProps,
92
+ ErrorBoundaryStates
93
+ > {
94
+ state: {
95
+ error: undefined;
96
+ info: {
97
+ componentStack: string;
98
+ };
99
+ };
100
+ componentDidCatch(error: Error | null, info: object): void;
101
+ render():
102
+ | string
103
+ | number
104
+ | boolean
105
+ | Iterable<React.ReactNode>
106
+ | React.JSX.Element
107
+ | null
108
+ | undefined;
109
+ }
@@ -0,0 +1,109 @@
1
+ import { AlertStatus } from './';
2
+
3
+ export type AlertProps = Omit<
4
+ AntAlertProps,
5
+ | 'prefixCls'
6
+ | 'style'
7
+ | 'styles'
8
+ | 'closeIcon'
9
+ | 'onMouseEnter'
10
+ | 'onMouseLeave'
11
+ | 'onClick'
12
+ | 'id'
13
+ | 'role'
14
+ > & {
15
+ /**
16
+ * The status of the alert.
17
+ */
18
+ status?: AlertStatus;
19
+ };
20
+
21
+ interface AntAlertProps {
22
+ /** Type of Alert styles */
23
+ type?: 'success' | 'info' | 'warning' | 'error';
24
+ /** Whether Alert can be closed */
25
+ closable?: ClosableType;
26
+ /** Content of Alert */
27
+ message?: React.ReactNode;
28
+ /** Additional content of Alert */
29
+ description?: React.ReactNode;
30
+ /** Callback when close Alert */
31
+ onClose?: React.MouseEventHandler<HTMLButtonElement>;
32
+ /** Trigger when animation ending of Alert */
33
+ afterClose?: () => void;
34
+ /** Whether to show icon */
35
+ showIcon?: boolean;
36
+ /** https://www.w3.org/TR/2014/REC-html5-20141028/dom.html#aria-role-attribute */
37
+ role?: string;
38
+ style?: React.CSSProperties;
39
+ prefixCls?: string;
40
+ /**
41
+ * The additional css class
42
+ */
43
+ className?: string;
44
+ /**
45
+ * ClassName on the root element
46
+ */
47
+ rootClassName?: string;
48
+ /**
49
+ * Whether to show as banner
50
+ */
51
+ banner?: boolean;
52
+ /**
53
+ * Custom icon, effective when showIcon is true
54
+ */
55
+ icon?: React.ReactNode;
56
+ /**
57
+ * Custom close icon
58
+ */
59
+ closeIcon?: React.ReactNode;
60
+ /**
61
+ * The action of Alert
62
+ */
63
+ action?: React.ReactNode;
64
+ onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
65
+ onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
66
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
67
+ id?: string;
68
+ }
69
+
70
+ type BaseClosableType = {
71
+ closeIcon?: React.ReactNode;
72
+ } & React.AriaAttributes;
73
+
74
+ type ClosableType = boolean | BaseClosableType;
75
+
76
+ interface ErrorBoundaryProps {
77
+ message?: React.ReactNode;
78
+ description?: React.ReactNode;
79
+ children?: React.ReactNode;
80
+ id?: string;
81
+ }
82
+
83
+ interface ErrorBoundaryStates {
84
+ error?: Error | null;
85
+ info?: {
86
+ componentStack?: string;
87
+ };
88
+ }
89
+
90
+ declare class ErrorBoundary extends React.Component<
91
+ ErrorBoundaryProps,
92
+ ErrorBoundaryStates
93
+ > {
94
+ state: {
95
+ error: undefined;
96
+ info: {
97
+ componentStack: string;
98
+ };
99
+ };
100
+ componentDidCatch(error: Error | null, info: object): void;
101
+ render():
102
+ | string
103
+ | number
104
+ | boolean
105
+ | Iterable<React.ReactNode>
106
+ | React.JSX.Element
107
+ | null
108
+ | undefined;
109
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/ui-alert",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",
@@ -10,14 +10,14 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "antd": "5.17.0",
13
- "@akinon/ui-theme": "0.6.0"
13
+ "@akinon/ui-theme": "0.7.0"
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
19
  "typescript": "^5.2.2",
20
- "@akinon/typescript-config": "0.3.0"
20
+ "@akinon/typescript-config": "0.4.0"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": ">=18",
@@ -37,7 +37,7 @@
37
37
  "build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
38
38
  "build:esm": "tsc --outDir dist/esm",
39
39
  "build:commonjs": "tsc --module commonjs --outDir dist/cjs",
40
- "copy:files": "copyfiles -u 1 src/**/*.css dist/esm && copyfiles -u 1 src/**/*.css dist/cjs",
40
+ "copy:files": "copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/esm && copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/cjs",
41
41
  "clean": "rimraf dist/",
42
42
  "typecheck": "tsc --noEmit"
43
43
  }