@semcore/notice 3.0.0 → 3.2.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/CHANGELOG.md +28 -0
- package/lib/cjs/Notice.js +75 -97
- package/lib/cjs/Notice.js.map +1 -1
- package/lib/cjs/NoticeSmart.js +6 -6
- package/lib/cjs/NoticeSmart.js.map +1 -1
- package/lib/cjs/style/notice.shadow.css +27 -16
- package/lib/es6/Notice.js +80 -96
- package/lib/es6/Notice.js.map +1 -1
- package/lib/es6/NoticeSmart.js +6 -5
- package/lib/es6/NoticeSmart.js.map +1 -1
- package/lib/es6/style/notice.shadow.css +27 -16
- package/lib/types/index.d.ts +61 -5
- package/package.json +4 -6
- package/src/Notice.js +31 -21
- package/src/NoticeSmart.js +2 -2
- package/{lib/types/Notice.d.ts → src/index.d.ts} +27 -10
- package/src/style/notice.shadow.css +27 -16
- package/lib/types/NoticeSmart.d.ts +0 -24
- package/src/types/Notice.d.ts +0 -46
- package/src/types/NoticeSmart.d.ts +0 -24
- package/src/types/index.d.ts +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
|
|
2
|
-
import { IBoxProps } from '@semcore/flex-box';
|
|
2
|
+
import { Box, IBoxProps } from '@semcore/flex-box';
|
|
3
3
|
import { IIconProps } from '@semcore/icon';
|
|
4
4
|
|
|
5
5
|
export type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | string;
|
|
@@ -21,11 +21,6 @@ export interface INoticeProps extends IBoxProps {
|
|
|
21
21
|
* @default 200
|
|
22
22
|
*/
|
|
23
23
|
duration?: number;
|
|
24
|
-
/**
|
|
25
|
-
* Property for managing visibility of Notice
|
|
26
|
-
* @deprecated v2.0.0 {@link INoticeProps.hidden}
|
|
27
|
-
* */
|
|
28
|
-
invisible?: boolean;
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
export interface INoticeLabelProps extends IBoxProps {
|
|
@@ -36,11 +31,33 @@ export interface INoticeContext {
|
|
|
36
31
|
getLabelProps: PropGetterFn;
|
|
37
32
|
}
|
|
38
33
|
|
|
34
|
+
export interface INoticeSmartProps extends INoticeProps {
|
|
35
|
+
/**
|
|
36
|
+
* A custom element for additional information
|
|
37
|
+
*/
|
|
38
|
+
label?: React.ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Custom action element
|
|
41
|
+
*/
|
|
42
|
+
actions?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Adds a Close icon
|
|
45
|
+
*/
|
|
46
|
+
closable?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Callback on a click on the close button
|
|
49
|
+
*/
|
|
50
|
+
onClose?: (event: React.SyntheticEvent) => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
39
53
|
declare const Notice: (<T>(props: CProps<INoticeProps & T, INoticeContext>) => ReturnEl) & {
|
|
40
|
-
Label: <T>(props:
|
|
41
|
-
Actions:
|
|
42
|
-
Content:
|
|
43
|
-
CloseIcon: <T>(props:
|
|
54
|
+
Label: <T>(props: INoticeLabelProps & T) => ReturnEl;
|
|
55
|
+
Actions: typeof Box;
|
|
56
|
+
Content: typeof Box;
|
|
57
|
+
CloseIcon: <T>(props: IIconProps & T) => ReturnEl;
|
|
44
58
|
};
|
|
45
59
|
|
|
60
|
+
declare const NoticeSmart: <T>(props: CProps<INoticeSmartProps & T>) => ReturnEl;
|
|
61
|
+
|
|
62
|
+
export { NoticeSmart };
|
|
46
63
|
export default Notice;
|
|
@@ -20,34 +20,33 @@ SNotice[use='secondary'] {
|
|
|
20
20
|
|
|
21
21
|
SNotice[theme='info'] {
|
|
22
22
|
background-color: color-mod(var(--light-blue) alpha(15%));
|
|
23
|
-
}
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
&[use='secondary'] {
|
|
25
|
+
border-color: color-mod(var(--light-blue) alpha(25%));
|
|
26
|
+
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
SNotice[theme='danger'] {
|
|
30
30
|
background-color: color-mod(var(--red) alpha(10%));
|
|
31
|
-
}
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
&[use='secondary'] {
|
|
33
|
+
border-color: color-mod(var(--red) alpha(20%));
|
|
34
|
+
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
SNotice[theme='warning'] {
|
|
38
38
|
background-color: color-mod(var(--light-orange) alpha(15%));
|
|
39
|
-
}
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
&[use='secondary'] {
|
|
41
|
+
border-color: color-mod(var(--light-orange) alpha(40%));
|
|
42
|
+
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
SNotice[theme='success'] {
|
|
46
46
|
background-color: color-mod(var(--green) alpha(15%));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
border-color: color-mod(var(--green) alpha(30%));
|
|
47
|
+
&[use='secondary'] {
|
|
48
|
+
border-color: color-mod(var(--green) alpha(30%));
|
|
49
|
+
}
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
SContent {
|
|
@@ -65,6 +64,10 @@ SLabel {
|
|
|
65
64
|
display: inline-flex;
|
|
66
65
|
}
|
|
67
66
|
|
|
67
|
+
SLabel[theme='danger'] {
|
|
68
|
+
color: var(--red);
|
|
69
|
+
}
|
|
70
|
+
|
|
68
71
|
SLabel[theme='info'] {
|
|
69
72
|
color: var(--stone);
|
|
70
73
|
}
|
|
@@ -74,14 +77,22 @@ SLabel[theme='success'] {
|
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
SLabel[theme='warning'] {
|
|
77
|
-
color: var(--orange);
|
|
80
|
+
color: var(--light-orange);
|
|
78
81
|
}
|
|
79
82
|
|
|
80
|
-
SLabel[theme='
|
|
81
|
-
color: var(--
|
|
83
|
+
SLabel[theme='custom'] {
|
|
84
|
+
color: var(--color);
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
SCloseIcon {
|
|
85
88
|
flex-shrink: 0;
|
|
86
89
|
margin-left: 16px;
|
|
87
90
|
}
|
|
91
|
+
|
|
92
|
+
SNotice[theme='custom'] {
|
|
93
|
+
background-color: var(--backgroundColor);
|
|
94
|
+
|
|
95
|
+
&[use='secondary'] {
|
|
96
|
+
border-color: var(--backgroundColor);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
-
import { INoticeProps } from './Notice';
|
|
3
|
-
|
|
4
|
-
export interface INoticeSmartProps extends INoticeProps {
|
|
5
|
-
/**
|
|
6
|
-
* A custom element for additional information
|
|
7
|
-
*/
|
|
8
|
-
label?: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* Custom action element
|
|
11
|
-
*/
|
|
12
|
-
actions?: React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Adds a Close icon
|
|
15
|
-
*/
|
|
16
|
-
closable?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Callback on a click on the close button
|
|
19
|
-
*/
|
|
20
|
-
onClose?: (event: React.SyntheticEvent) => void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
declare const NoticeSmart: <T>(props: CProps<INoticeSmartProps & T>) => ReturnEl;
|
|
24
|
-
export default NoticeSmart;
|
package/src/types/Notice.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
|
|
2
|
-
import { IBoxProps } from '@semcore/flex-box';
|
|
3
|
-
import { IIconProps } from '@semcore/icon';
|
|
4
|
-
|
|
5
|
-
export type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | string;
|
|
6
|
-
export type NoticeUse = 'primary' | 'secondary';
|
|
7
|
-
|
|
8
|
-
export interface INoticeProps extends IBoxProps {
|
|
9
|
-
/** Property for managing visibility of Notice */
|
|
10
|
-
hidden?: boolean;
|
|
11
|
-
/** Notice type
|
|
12
|
-
* @default secondary
|
|
13
|
-
*/
|
|
14
|
-
use?: NoticeUse;
|
|
15
|
-
/**
|
|
16
|
-
* Notice theme
|
|
17
|
-
* @default info
|
|
18
|
-
*/
|
|
19
|
-
theme?: NoticeTheme;
|
|
20
|
-
/** Duration of animation, ms
|
|
21
|
-
* @default 200
|
|
22
|
-
*/
|
|
23
|
-
duration?: number;
|
|
24
|
-
/**
|
|
25
|
-
* Property for managing visibility of Notice
|
|
26
|
-
* @deprecated v2.0.0 {@link INoticeProps.hidden}
|
|
27
|
-
* */
|
|
28
|
-
invisible?: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface INoticeLabelProps extends IBoxProps {
|
|
32
|
-
theme?: NoticeTheme;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface INoticeContext {
|
|
36
|
-
getLabelProps: PropGetterFn;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare const Notice: (<T>(props: CProps<INoticeProps & T, INoticeContext>) => ReturnEl) & {
|
|
40
|
-
Label: <T>(props: CProps<INoticeLabelProps & T>) => ReturnEl;
|
|
41
|
-
Actions: <T>(props: CProps<IBoxProps & T>) => ReturnEl;
|
|
42
|
-
Content: <T>(props: CProps<IBoxProps & T>) => ReturnEl;
|
|
43
|
-
CloseIcon: <T>(props: CProps<IBoxProps & IIconProps>) => ReturnEl;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export default Notice;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
-
import { INoticeProps } from './Notice';
|
|
3
|
-
|
|
4
|
-
export interface INoticeSmartProps extends INoticeProps {
|
|
5
|
-
/**
|
|
6
|
-
* A custom element for additional information
|
|
7
|
-
*/
|
|
8
|
-
label?: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* Custom action element
|
|
11
|
-
*/
|
|
12
|
-
actions?: React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Adds a Close icon
|
|
15
|
-
*/
|
|
16
|
-
closable?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Callback on a click on the close button
|
|
19
|
-
*/
|
|
20
|
-
onClose?: (event: React.SyntheticEvent) => void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
declare const NoticeSmart: <T>(props: CProps<INoticeSmartProps & T>) => ReturnEl;
|
|
24
|
-
export default NoticeSmart;
|