@semcore/notice 3.2.5 → 3.2.6

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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [3.2.6] - 2022-04-28
6
+
7
+ ### Changed
8
+
9
+ - Version patch update due to children dependencies update (`@semcore/icon` [2.20.0 ~> 2.21.0]).
10
+
5
11
  ## [3.2.5] - 2022-04-03
6
12
 
7
13
  ### Changed
@@ -0,0 +1,63 @@
1
+ import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
2
+ import { Box, 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
+
26
+ export interface INoticeLabelProps extends IBoxProps {
27
+ theme?: NoticeTheme;
28
+ }
29
+
30
+ export interface INoticeContext {
31
+ getLabelProps: PropGetterFn;
32
+ }
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
+
53
+ declare const Notice: (<T>(props: CProps<INoticeProps & T, INoticeContext>) => ReturnEl) & {
54
+ Label: <T>(props: INoticeLabelProps & T) => ReturnEl;
55
+ Actions: typeof Box;
56
+ Content: typeof Box;
57
+ CloseIcon: <T>(props: IIconProps & T) => ReturnEl;
58
+ };
59
+
60
+ declare const NoticeSmart: <T>(props: CProps<INoticeSmartProps & T>) => ReturnEl;
61
+
62
+ export { NoticeSmart };
63
+ export default Notice;
@@ -0,0 +1,63 @@
1
+ import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
2
+ import { Box, 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
+
26
+ export interface INoticeLabelProps extends IBoxProps {
27
+ theme?: NoticeTheme;
28
+ }
29
+
30
+ export interface INoticeContext {
31
+ getLabelProps: PropGetterFn;
32
+ }
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
+
53
+ declare const Notice: (<T>(props: CProps<INoticeProps & T, INoticeContext>) => ReturnEl) & {
54
+ Label: <T>(props: INoticeLabelProps & T) => ReturnEl;
55
+ Actions: typeof Box;
56
+ Content: typeof Box;
57
+ CloseIcon: <T>(props: IIconProps & T) => ReturnEl;
58
+ };
59
+
60
+ declare const NoticeSmart: <T>(props: CProps<INoticeSmartProps & T>) => ReturnEl;
61
+
62
+ export { NoticeSmart };
63
+ export default Notice;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/notice",
3
3
  "description": "SEMRush Notice Component",
4
- "version": "3.2.5",
4
+ "version": "3.2.6",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -29,5 +29,8 @@
29
29
  "type": "git",
30
30
  "url": "https://github.com/semrush/intergalactic.git",
31
31
  "directory": "semcore/notice"
32
+ },
33
+ "devDependencies": {
34
+ "@semcore/jest-preset-ui": "1.0.0"
32
35
  }
33
36
  }