@synerise/ds-alert 0.3.20 → 0.3.24
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +79 -0
- package/README.md +49 -1
- package/dist/BroadcastBar/BroadcastBar.d.ts +4 -0
- package/dist/BroadcastBar/BroadcastBar.js +72 -0
- package/dist/BroadcastBar/BroadcastBar.styles.d.ts +48 -0
- package/dist/BroadcastBar/BroadcastBar.styles.js +117 -0
- package/dist/BroadcastBar/BroadcastBar.types.d.ts +15 -0
- package/dist/BroadcastBar/BroadcastBar.types.js +0 -0
- package/dist/IconAlert/IconAlert.d.ts +4 -0
- package/dist/IconAlert/IconAlert.js +42 -0
- package/dist/IconAlert/IconAlert.styles.d.ts +9 -0
- package/dist/IconAlert/IconAlert.styles.js +53 -0
- package/dist/IconAlert/IconAlert.types.d.ts +11 -0
- package/dist/IconAlert/IconAlert.types.js +0 -0
- package/dist/Toast/Toast.d.ts +4 -0
- package/dist/Toast/Toast.js +88 -0
- package/dist/Toast/Toast.styles.d.ts +69 -0
- package/dist/Toast/Toast.styles.js +181 -0
- package/dist/Toast/Toast.types.d.ts +24 -0
- package/dist/Toast/Toast.types.js +0 -0
- package/package.json +10 -7
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,85 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [0.3.24](https://github.com/Synerise/synerise-design/compare/@synerise/ds-alert@0.3.22...@synerise/ds-alert@0.3.24) (2021-10-26)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **alert:** fix button and padding ([0152d97](https://github.com/Synerise/synerise-design/commit/0152d973610af603ed7e59ab6c66de4f1d064a9f))
|
12
|
+
* **alert:** fix button and padding ([f4f8ab4](https://github.com/Synerise/synerise-design/commit/f4f8ab48b937338e989af2e68cd9e1f01e31b3e4))
|
13
|
+
* **alert:** fix component ([210baa2](https://github.com/Synerise/synerise-design/commit/210baa238e131bf4b2ca430e451479ea25c88f9b))
|
14
|
+
* **alert:** fix component ([fb7b928](https://github.com/Synerise/synerise-design/commit/fb7b92844fe958cddc10bbe01fa1e3f3378471d6))
|
15
|
+
* **alert:** fix padding of textDescription ([0689a5c](https://github.com/Synerise/synerise-design/commit/0689a5c2bd270ef193778605fa2943261663e5f4))
|
16
|
+
* **alert:** fix padding of textDescription ([bdce3ed](https://github.com/Synerise/synerise-design/commit/bdce3ed176e0775836cd37a3e31438cf9e9aeef8))
|
17
|
+
* **alert:** fix prop ([37cf9e2](https://github.com/Synerise/synerise-design/commit/37cf9e20fc6a859ae2a2f8fe3dc1abb9b83d584f))
|
18
|
+
* **alert:** fix prop ([8cd3a2a](https://github.com/Synerise/synerise-design/commit/8cd3a2a9a34f47be88f54f0ba01d09952947a459))
|
19
|
+
* **alert:** fix props ([ab9b3f1](https://github.com/Synerise/synerise-design/commit/ab9b3f1350d4349cd86c6fcb0eca2a2b4fdb92de))
|
20
|
+
* **alert:** fix props ([d262657](https://github.com/Synerise/synerise-design/commit/d262657b8f66ef31cdc0b9abde6b6321048b050a))
|
21
|
+
* **alert:** fix styles and add props ([0d829d2](https://github.com/Synerise/synerise-design/commit/0d829d26111780ee006cd26c3c5dc76962ae8c99))
|
22
|
+
* **alert:** fix styles and add props ([b555b8a](https://github.com/Synerise/synerise-design/commit/b555b8af547c632fca82d8024514561f20636dd6))
|
23
|
+
* **alert:** fix styles of toast ([65c8a2b](https://github.com/Synerise/synerise-design/commit/65c8a2b963ec671e365967dffa364922f4b95d79))
|
24
|
+
* **alert:** fix styles of toast ([c76c197](https://github.com/Synerise/synerise-design/commit/c76c197c79bcb1fc69b08f65cb69096521a4c440))
|
25
|
+
* **alert:** new component broadcast-bar ([0525d34](https://github.com/Synerise/synerise-design/commit/0525d345c2aefc097db832b8fd2693dca3902ea5))
|
26
|
+
* **alert:** new component Toast ([f1ed36b](https://github.com/Synerise/synerise-design/commit/f1ed36b88d98ef81e487eb6b8418ea6bb4be6a3d))
|
27
|
+
* **alert:** new component Toast ([665f9dc](https://github.com/Synerise/synerise-design/commit/665f9dcc2ea5812ef7ef3a5fa4fafd6590c78ecb))
|
28
|
+
* **alert:** update documentation ([3fa6258](https://github.com/Synerise/synerise-design/commit/3fa62584962af09ae0593ed7853043946b749618))
|
29
|
+
* **alert:** update documentation ([0aaff46](https://github.com/Synerise/synerise-design/commit/0aaff46cc8f7c5043648920dd788c579e63ea0d0))
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
## [0.3.23](https://github.com/Synerise/synerise-design/compare/@synerise/ds-alert@0.3.22...@synerise/ds-alert@0.3.23) (2021-10-19)
|
36
|
+
|
37
|
+
|
38
|
+
### Bug Fixes
|
39
|
+
|
40
|
+
* **alert:** fix button and padding ([0152d97](https://github.com/Synerise/synerise-design/commit/0152d973610af603ed7e59ab6c66de4f1d064a9f))
|
41
|
+
* **alert:** fix button and padding ([f4f8ab4](https://github.com/Synerise/synerise-design/commit/f4f8ab48b937338e989af2e68cd9e1f01e31b3e4))
|
42
|
+
* **alert:** fix component ([210baa2](https://github.com/Synerise/synerise-design/commit/210baa238e131bf4b2ca430e451479ea25c88f9b))
|
43
|
+
* **alert:** fix component ([fb7b928](https://github.com/Synerise/synerise-design/commit/fb7b92844fe958cddc10bbe01fa1e3f3378471d6))
|
44
|
+
* **alert:** fix padding of textDescription ([0689a5c](https://github.com/Synerise/synerise-design/commit/0689a5c2bd270ef193778605fa2943261663e5f4))
|
45
|
+
* **alert:** fix padding of textDescription ([bdce3ed](https://github.com/Synerise/synerise-design/commit/bdce3ed176e0775836cd37a3e31438cf9e9aeef8))
|
46
|
+
* **alert:** fix prop ([37cf9e2](https://github.com/Synerise/synerise-design/commit/37cf9e20fc6a859ae2a2f8fe3dc1abb9b83d584f))
|
47
|
+
* **alert:** fix prop ([8cd3a2a](https://github.com/Synerise/synerise-design/commit/8cd3a2a9a34f47be88f54f0ba01d09952947a459))
|
48
|
+
* **alert:** fix props ([ab9b3f1](https://github.com/Synerise/synerise-design/commit/ab9b3f1350d4349cd86c6fcb0eca2a2b4fdb92de))
|
49
|
+
* **alert:** fix props ([d262657](https://github.com/Synerise/synerise-design/commit/d262657b8f66ef31cdc0b9abde6b6321048b050a))
|
50
|
+
* **alert:** fix styles and add props ([0d829d2](https://github.com/Synerise/synerise-design/commit/0d829d26111780ee006cd26c3c5dc76962ae8c99))
|
51
|
+
* **alert:** fix styles and add props ([b555b8a](https://github.com/Synerise/synerise-design/commit/b555b8af547c632fca82d8024514561f20636dd6))
|
52
|
+
* **alert:** fix styles of toast ([65c8a2b](https://github.com/Synerise/synerise-design/commit/65c8a2b963ec671e365967dffa364922f4b95d79))
|
53
|
+
* **alert:** fix styles of toast ([c76c197](https://github.com/Synerise/synerise-design/commit/c76c197c79bcb1fc69b08f65cb69096521a4c440))
|
54
|
+
* **alert:** new component broadcast-bar ([0525d34](https://github.com/Synerise/synerise-design/commit/0525d345c2aefc097db832b8fd2693dca3902ea5))
|
55
|
+
* **alert:** new component Toast ([f1ed36b](https://github.com/Synerise/synerise-design/commit/f1ed36b88d98ef81e487eb6b8418ea6bb4be6a3d))
|
56
|
+
* **alert:** new component Toast ([665f9dc](https://github.com/Synerise/synerise-design/commit/665f9dcc2ea5812ef7ef3a5fa4fafd6590c78ecb))
|
57
|
+
* **alert:** update documentation ([3fa6258](https://github.com/Synerise/synerise-design/commit/3fa62584962af09ae0593ed7853043946b749618))
|
58
|
+
* **alert:** update documentation ([0aaff46](https://github.com/Synerise/synerise-design/commit/0aaff46cc8f7c5043648920dd788c579e63ea0d0))
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
## [0.3.22](https://github.com/Synerise/synerise-design/compare/@synerise/ds-alert@0.3.21...@synerise/ds-alert@0.3.22) (2021-10-19)
|
65
|
+
|
66
|
+
**Note:** Version bump only for package @synerise/ds-alert
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
## [0.3.21](https://github.com/Synerise/synerise-design/compare/@synerise/ds-alert@0.3.20...@synerise/ds-alert@0.3.21) (2021-09-21)
|
73
|
+
|
74
|
+
|
75
|
+
### Bug Fixes
|
76
|
+
|
77
|
+
* **alert:** fix styles ([a24c6a3](https://github.com/Synerise/synerise-design/commit/a24c6a353f6209205794b57ca115f5ebd3c605c1))
|
78
|
+
* **alert:** fix styles ([ddce48c](https://github.com/Synerise/synerise-design/commit/ddce48c5e36f9beb2078a123364990a2a6b9e741))
|
79
|
+
* **alert:** two new components IconAlert and InlineAlert ([7e28f50](https://github.com/Synerise/synerise-design/commit/7e28f50cb5b5d5c35d10b7c196d3cb36b112df15))
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
6
85
|
## [0.3.20](https://github.com/Synerise/synerise-design/compare/@synerise/ds-alert@0.3.19...@synerise/ds-alert@0.3.20) (2021-09-09)
|
7
86
|
|
8
87
|
**Note:** Version bump only for package @synerise/ds-alert
|
package/README.md
CHANGED
@@ -82,4 +82,52 @@ import Alert from '@synerise/ds-alert'
|
|
82
82
|
| --- | --- | --- | --- |
|
83
83
|
| type | Type of AlertSemanticColor, options: `notice`, `negative`, `positive`,`informative`,`neutral`,`supply`,`service`,`entity` | `string` | `positive` |
|
84
84
|
| color | type of colors,options: `red`, `green`,`yellow`,`grey`,`purple`,`violet`, `cyan`,`blue` | `string` | - |
|
85
|
-
| mode | type of modes, options: `background`, `background-outline`,`outline`,`shadow` | `string` | - |
|
85
|
+
| mode | type of modes, options: `background`, `background-outline`,`outline`,`shadow` | `string` | - |
|
86
|
+
|
87
|
+
### Alert.IconAlert
|
88
|
+
|
89
|
+
| Property | Description | Type | Default |
|
90
|
+
| ---- | --- | --- | --- |
|
91
|
+
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | `string` | `warning` |
|
92
|
+
| message | Message of Icon Alert | `React.ReactNode` | - |
|
93
|
+
| disabled | prop to set disabled icon | `boolean` | - |
|
94
|
+
| withEmphasis | prop to show bolder text | `React.ReactNode` | - |
|
95
|
+
| withLink | prop to show highlited text | `React.ReactNode` | - |
|
96
|
+
| iconAlert | prop to set custom icon | `boolean` | - |
|
97
|
+
| hoverButton | prop to set hover state button | `boolean` | - |
|
98
|
+
|
99
|
+
|
100
|
+
### Alert.Toast
|
101
|
+
|
102
|
+
| Property | Description | Type | Default |
|
103
|
+
| ---- | --- | --- | --- |
|
104
|
+
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | `string` | `warning` |
|
105
|
+
| message | Message of Icon Alert | `React.ReactNode` | - |
|
106
|
+
| button | prop to set button | `React.ReactNode` | - |
|
107
|
+
| expanded | prop to set show expanded content | `boolean` | - |
|
108
|
+
| onExpand | prop on click to show content | `isExpanded:boolean => void`| - |
|
109
|
+
| customColor | type of colors,options:`red`, `blue`, `green`,`yellow`,`grey`,`purple`,`violet`, `cyan`,`fern`,`orange`, `mars`,`pink` | `string` | - |
|
110
|
+
| customColorIcon | type of colors,options:`red`, `blue`, `green`,`yellow`,`grey`,`purple`,`violet`, `cyan`,`fern`,`orange`, `mars`,`pink` | `string` | - |
|
111
|
+
| color | type of colors,options: `red`, `green`,`yellow`,`grey`,`blue` | `string` | - |
|
112
|
+
| colorIcon | type of colors,options: `white`, `black`,`yellow`,`grey`,`blue` | `string` | - |
|
113
|
+
| customColorText | type of colors,options:`red`, `blue`, `green`,`yellow`,`grey`,`purple`,`violet`, `cyan`,`fern`,`orange`, `mars`,`pink` | `string` | - |
|
114
|
+
| withClose | prop to show close button | `React.ReactNode` | - |
|
115
|
+
| customIcon | prop to set custom icon | `React.ReactNode` | - |
|
116
|
+
| expander | prop to set expanded icon | `React.ReactNode` | - |
|
117
|
+
| expanderContent | prop to set custom icon | `React.ReactNode` | - |
|
118
|
+
| onCloseClick | Callback when Toast is closed | `(e: MouseEvent) => void` | - |
|
119
|
+
| show | prop to show Toast | `boolean` | - |
|
120
|
+
|
121
|
+
### Alert.BroadcastBar
|
122
|
+
|
123
|
+
| Property | Description | Type | Default |
|
124
|
+
| ---- | --- | --- | --- |
|
125
|
+
| type | Type of Alert styles, options: `success`, `warning`, `negative` | `string` | `warning` |
|
126
|
+
| color | type of colors,options: `red`, `green`,`yellow` | `string` | - |
|
127
|
+
| onCloseClick | prop to close broadcastBar | `void` | - |
|
128
|
+
| withEmphasis | prop to show bolder text | `React.ReactNode` | - |
|
129
|
+
| withLink | prop to show highlited text | `React.ReactNode` | - |
|
130
|
+
| withClose | prop to set closeIcon | `React.ReactNode` | - |
|
131
|
+
| button | prop to set button | `boolean` | - |
|
132
|
+
| textButton | string of button | `string` | - |
|
133
|
+
| text | string of withEmphasis or withLink | `string` | - |
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { CloseM, WarningFillM, Check3M, ErrorFillM } from '@synerise/ds-icon/dist/icons';
|
3
|
+
import Icon from '@synerise/ds-icon';
|
4
|
+
import * as S from './BroadcastBar.styles';
|
5
|
+
var ICONS = {
|
6
|
+
success: React.createElement(Check3M, null),
|
7
|
+
warning: React.createElement(WarningFillM, null),
|
8
|
+
negative: React.createElement(ErrorFillM, null)
|
9
|
+
};
|
10
|
+
var DEFAULT_ICON = React.createElement(WarningFillM, null);
|
11
|
+
|
12
|
+
var BroadcastBar = function BroadcastBar(_ref) {
|
13
|
+
var icon = _ref.icon,
|
14
|
+
type = _ref.type,
|
15
|
+
description = _ref.description,
|
16
|
+
button = _ref.button,
|
17
|
+
withEmphasis = _ref.withEmphasis,
|
18
|
+
withLink = _ref.withLink,
|
19
|
+
color = _ref.color,
|
20
|
+
withClose = _ref.withClose,
|
21
|
+
textButton = _ref.textButton,
|
22
|
+
onCloseClick = _ref.onCloseClick,
|
23
|
+
text = _ref.text;
|
24
|
+
var renderMessage = React.useMemo(function () {
|
25
|
+
return React.createElement(S.AlertContent, {
|
26
|
+
color: color,
|
27
|
+
withLink: withLink
|
28
|
+
}, React.createElement(S.Text, {
|
29
|
+
color: color
|
30
|
+
}, description && !withEmphasis && React.createElement(S.AlertDescription, {
|
31
|
+
color: color
|
32
|
+
}, description), withLink && !withEmphasis && !description && React.createElement(S.LinkWrapper, {
|
33
|
+
color: color
|
34
|
+
}, React.createElement(S.WrapperText, null, text), React.createElement(S.Link, null, withLink)), withEmphasis && React.createElement(S.EmphasisWrapper, {
|
35
|
+
color: color
|
36
|
+
}, React.createElement(S.WrapperText, {
|
37
|
+
emphasis: withEmphasis
|
38
|
+
}, text), withEmphasis)));
|
39
|
+
}, [description, withEmphasis, withLink, text, color]);
|
40
|
+
var renderIcon = React.useMemo(function () {
|
41
|
+
if (icon) return icon;
|
42
|
+
if (ICONS[type]) return ICONS[type];
|
43
|
+
return DEFAULT_ICON;
|
44
|
+
}, [icon, type]);
|
45
|
+
return React.createElement(S.Container, {
|
46
|
+
color: color
|
47
|
+
}, React.createElement(S.WrapperSectionMessage, {
|
48
|
+
color: color
|
49
|
+
}, React.createElement("div", null), React.createElement(S.AllContent, {
|
50
|
+
close: withClose,
|
51
|
+
color: color
|
52
|
+
}, React.createElement(S.IconWrapper, {
|
53
|
+
color: color
|
54
|
+
}, React.createElement(Icon, {
|
55
|
+
component: renderIcon
|
56
|
+
})), renderMessage, React.createElement(S.ButtonWrapper, {
|
57
|
+
color: color
|
58
|
+
}, button && React.createElement(S.BroadcastButton, {
|
59
|
+
color: color,
|
60
|
+
type: color === 'yellow' ? 'tertiary' : 'tertiary-white',
|
61
|
+
mode: "label"
|
62
|
+
}, textButton))), React.createElement(S.ButtonCloseWrapper, {
|
63
|
+
color: color
|
64
|
+
}, withClose && React.createElement(S.IconCloseWrapper, {
|
65
|
+
onClick: onCloseClick,
|
66
|
+
color: color
|
67
|
+
}, React.createElement(Icon, {
|
68
|
+
component: React.createElement(CloseM, null)
|
69
|
+
})))));
|
70
|
+
};
|
71
|
+
|
72
|
+
export default BroadcastBar;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import Button from '@synerise/ds-button';
|
3
|
+
export declare const AlertContent: import("styled-components").StyledComponent<"div", any, {
|
4
|
+
withLink?: React.ReactNode;
|
5
|
+
color?: "red" | "green" | "yellow" | undefined;
|
6
|
+
}, never>;
|
7
|
+
export declare const AllContent: import("styled-components").StyledComponent<"div", any, {
|
8
|
+
color?: "red" | "green" | "yellow" | undefined;
|
9
|
+
close?: boolean | React.ReactNode;
|
10
|
+
}, never>;
|
11
|
+
export declare const Text: import("styled-components").StyledComponent<"div", any, {
|
12
|
+
color?: "red" | "green" | "yellow" | undefined;
|
13
|
+
}, never>;
|
14
|
+
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {
|
15
|
+
color?: "red" | "green" | "yellow" | undefined;
|
16
|
+
}, never>;
|
17
|
+
export declare const IconCloseWrapper: import("styled-components").StyledComponent<"div", any, {
|
18
|
+
color?: "red" | "green" | "yellow" | undefined;
|
19
|
+
}, never>;
|
20
|
+
export declare const ButtonWrapper: import("styled-components").StyledComponent<"div", any, {
|
21
|
+
color?: "red" | "green" | "yellow" | undefined;
|
22
|
+
}, never>;
|
23
|
+
export declare const BroadcastButton: import("styled-components").StyledComponent<typeof Button, any, {
|
24
|
+
color?: "red" | "green" | "yellow" | undefined;
|
25
|
+
}, never>;
|
26
|
+
export declare const ButtonCloseWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
27
|
+
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {
|
28
|
+
color?: "red" | "green" | "yellow" | undefined;
|
29
|
+
}, never>;
|
30
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
31
|
+
color?: "red" | "green" | "yellow" | undefined;
|
32
|
+
}, never>;
|
33
|
+
export declare const WrapperSectionMessage: import("styled-components").StyledComponent<"div", any, {
|
34
|
+
color?: "red" | "green" | "yellow" | undefined;
|
35
|
+
}, never>;
|
36
|
+
export declare const AlertDescription: import("styled-components").StyledComponent<"span", any, {
|
37
|
+
color?: "red" | "green" | "yellow" | undefined;
|
38
|
+
}, never>;
|
39
|
+
export declare const EmphasisWrapper: import("styled-components").StyledComponent<"span", any, {
|
40
|
+
color?: "red" | "green" | "yellow" | undefined;
|
41
|
+
}, never>;
|
42
|
+
export declare const WrapperText: import("styled-components").StyledComponent<"span", any, {
|
43
|
+
emphasis?: boolean | React.ReactNode;
|
44
|
+
}, never>;
|
45
|
+
export declare const LinkWrapper: import("styled-components").StyledComponent<"span", any, {
|
46
|
+
color?: "red" | "green" | "yellow" | undefined;
|
47
|
+
}, never>;
|
48
|
+
export declare const Link: import("styled-components").StyledComponent<"span", any, {}, never>;
|
@@ -0,0 +1,117 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
import Button from '@synerise/ds-button';
|
3
|
+
|
4
|
+
var getColorBackground = function getColorBackground(props) {
|
5
|
+
if (props.color === 'red') {
|
6
|
+
return props.theme.palette['red-500'];
|
7
|
+
}
|
8
|
+
|
9
|
+
return props.theme.palette["".concat(props.color, "-600")];
|
10
|
+
};
|
11
|
+
|
12
|
+
var getColorIcon = function getColorIcon(props) {
|
13
|
+
if (props.color === 'yellow') {
|
14
|
+
return props.theme.palette['grey-800'];
|
15
|
+
}
|
16
|
+
|
17
|
+
return props.theme.palette.white;
|
18
|
+
};
|
19
|
+
|
20
|
+
export var AlertContent = styled.div.withConfig({
|
21
|
+
displayName: "BroadcastBarstyles__AlertContent",
|
22
|
+
componentId: "sc-1xh5805-0"
|
23
|
+
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px 0;color:", ";"], function (props) {
|
24
|
+
return props.color === 'yellow' ? props.theme.palette['grey-800'] : props.theme.palette.white;
|
25
|
+
});
|
26
|
+
export var AllContent = styled.div.withConfig({
|
27
|
+
displayName: "BroadcastBarstyles__AllContent",
|
28
|
+
componentId: "sc-1xh5805-1"
|
29
|
+
})(["display:flex;margin-left:", ";color:", ";"], function (props) {
|
30
|
+
return props.close ? '34px' : '0';
|
31
|
+
}, function (props) {
|
32
|
+
return props.color === 'yellow' ? props.theme.palette['grey-800'] : props.theme.palette.white;
|
33
|
+
});
|
34
|
+
export var Text = styled.div.withConfig({
|
35
|
+
displayName: "BroadcastBarstyles__Text",
|
36
|
+
componentId: "sc-1xh5805-2"
|
37
|
+
})(["display:flex;color:", ";"], function (props) {
|
38
|
+
return props.color === 'yellow' ? props.theme.palette['grey-800'] : props.theme.palette.white;
|
39
|
+
});
|
40
|
+
export var IconWrapper = styled.div.withConfig({
|
41
|
+
displayName: "BroadcastBarstyles__IconWrapper",
|
42
|
+
componentId: "sc-1xh5805-3"
|
43
|
+
})(["margin:10px 12px;color:", ";fill:", ";}"], function (props) {
|
44
|
+
return getColorIcon(props);
|
45
|
+
}, function (props) {
|
46
|
+
return getColorIcon(props);
|
47
|
+
});
|
48
|
+
export var IconCloseWrapper = styled.div.withConfig({
|
49
|
+
displayName: "BroadcastBarstyles__IconCloseWrapper",
|
50
|
+
componentId: "sc-1xh5805-4"
|
51
|
+
})(["margin:3px 5px 2px;cursor:pointer;svg{color:", ";fill:", ";}"], function (props) {
|
52
|
+
return getColorIcon(props);
|
53
|
+
}, function (props) {
|
54
|
+
return getColorIcon(props);
|
55
|
+
});
|
56
|
+
export var ButtonWrapper = styled.div.withConfig({
|
57
|
+
displayName: "BroadcastBarstyles__ButtonWrapper",
|
58
|
+
componentId: "sc-1xh5805-5"
|
59
|
+
})(["margin:6px 8px;border-radius:3px;display:flex;background-color:rgba(255,255,255,0.2);"]);
|
60
|
+
export var BroadcastButton = styled(Button).withConfig({
|
61
|
+
displayName: "BroadcastBarstyles__BroadcastButton",
|
62
|
+
componentId: "sc-1xh5805-6"
|
63
|
+
})(["color:", ";&&&:hover{color:", " !important;}"], function (props) {
|
64
|
+
return props.color === 'yellow' ? props.theme.palette['grey-800'] : props.theme.palette.white;
|
65
|
+
}, function (props) {
|
66
|
+
return props.color === 'yellow' ? props.theme.palette['grey-800'] : props.theme.palette.white;
|
67
|
+
});
|
68
|
+
export var ButtonCloseWrapper = styled.div.withConfig({
|
69
|
+
displayName: "BroadcastBarstyles__ButtonCloseWrapper",
|
70
|
+
componentId: "sc-1xh5805-7"
|
71
|
+
})(["margin:6px 8px;display:flex;"]);
|
72
|
+
export var Wrapper = styled.div.withConfig({
|
73
|
+
displayName: "BroadcastBarstyles__Wrapper",
|
74
|
+
componentId: "sc-1xh5805-8"
|
75
|
+
})(["margin-top:10px;color:", ";"], function (props) {
|
76
|
+
return props.color === 'yellow' ? props.theme.palette['grey-800'] : props.theme.palette.white;
|
77
|
+
});
|
78
|
+
export var Container = styled.div.withConfig({
|
79
|
+
displayName: "BroadcastBarstyles__Container",
|
80
|
+
componentId: "sc-1xh5805-9"
|
81
|
+
})(["width:100%;background-color:", ";"], function (props) {
|
82
|
+
return getColorBackground(props);
|
83
|
+
});
|
84
|
+
export var WrapperSectionMessage = styled.div.withConfig({
|
85
|
+
displayName: "BroadcastBarstyles__WrapperSectionMessage",
|
86
|
+
componentId: "sc-1xh5805-10"
|
87
|
+
})(["font-size:13px;display:flex;color:", ";justify-content:space-between;"], function (props) {
|
88
|
+
return props.color === 'yellow' ? props.theme.palette['grey-800'] : props.theme.palette.white;
|
89
|
+
});
|
90
|
+
export var AlertDescription = styled.span.withConfig({
|
91
|
+
displayName: "BroadcastBarstyles__AlertDescription",
|
92
|
+
componentId: "sc-1xh5805-11"
|
93
|
+
})(["display:flex;max-width:800px;white-space:normal;font-size:13px;line-height:1.39;font-weight:500;margin-top:1px;color:", ";"], function (props) {
|
94
|
+
return props.color === 'yellow' ? props.theme.palette['grey-800'] : props.theme.palette.white;
|
95
|
+
});
|
96
|
+
export var EmphasisWrapper = styled.span.withConfig({
|
97
|
+
displayName: "BroadcastBarstyles__EmphasisWrapper",
|
98
|
+
componentId: "sc-1xh5805-12"
|
99
|
+
})(["font-size:13px;max-width:800px;line-height:1.39;font-weight:500;margin-top:1px;color:", ";"], function (props) {
|
100
|
+
return props.color === 'yellow' ? props.theme.palette['grey-800'] : props.theme.palette.white;
|
101
|
+
});
|
102
|
+
export var WrapperText = styled.span.withConfig({
|
103
|
+
displayName: "BroadcastBarstyles__WrapperText",
|
104
|
+
componentId: "sc-1xh5805-13"
|
105
|
+
})(["font-weight:", ";margin-right:3px;max-width:800px;"], function (props) {
|
106
|
+
return props.emphasis ? '400' : '500';
|
107
|
+
});
|
108
|
+
export var LinkWrapper = styled.span.withConfig({
|
109
|
+
displayName: "BroadcastBarstyles__LinkWrapper",
|
110
|
+
componentId: "sc-1xh5805-14"
|
111
|
+
})(["font-size:13px;line-height:1.5;max-width:800px;font-weight:500;margin-top:1px;color:", ";"], function (props) {
|
112
|
+
return props.color === 'yellow' ? props.theme.palette['grey-800'] : props.theme.palette.white;
|
113
|
+
});
|
114
|
+
export var Link = styled.span.withConfig({
|
115
|
+
displayName: "BroadcastBarstyles__Link",
|
116
|
+
componentId: "sc-1xh5805-15"
|
117
|
+
})(["text-decoration:underline;cursor:pointer;max-width:800px;"]);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { AlertProps } from 'antd/lib/alert';
|
2
|
+
import * as React from 'react';
|
3
|
+
export declare type BroadcastBarTypes = 'success' | 'warning' | 'negative';
|
4
|
+
export declare type ColorType = 'red' | 'green' | 'yellow';
|
5
|
+
export interface Props extends Omit<AlertProps, 'type' | 'message'> {
|
6
|
+
type: string | BroadcastBarTypes;
|
7
|
+
color?: ColorType;
|
8
|
+
button?: boolean | React.ReactNode;
|
9
|
+
withEmphasis?: React.ReactNode;
|
10
|
+
withLink?: React.ReactNode;
|
11
|
+
withClose?: React.ReactNode;
|
12
|
+
onCloseClick?: () => void;
|
13
|
+
textButton?: string;
|
14
|
+
text?: string | React.ReactNode;
|
15
|
+
}
|
File without changes
|
@@ -0,0 +1,42 @@
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
|
+
|
5
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
6
|
+
|
7
|
+
import { Check2M, WarningFillM, InfoM } from '@synerise/ds-icon/dist/icons';
|
8
|
+
import * as React from 'react';
|
9
|
+
import Icon from '@synerise/ds-icon';
|
10
|
+
import * as S from './IconAlert.styles';
|
11
|
+
var ICONS = {
|
12
|
+
success: React.createElement(Check2M, null),
|
13
|
+
alert: React.createElement(WarningFillM, null),
|
14
|
+
warning: React.createElement(WarningFillM, null),
|
15
|
+
info: React.createElement(InfoM, null)
|
16
|
+
};
|
17
|
+
|
18
|
+
var IconAlert = function IconAlert(_ref) {
|
19
|
+
var _ref$type = _ref.type,
|
20
|
+
type = _ref$type === void 0 ? 'warning' : _ref$type,
|
21
|
+
iconAlert = _ref.iconAlert,
|
22
|
+
message = _ref.message,
|
23
|
+
withLink = _ref.withLink,
|
24
|
+
withEmphasis = _ref.withEmphasis,
|
25
|
+
hoverButton = _ref.hoverButton,
|
26
|
+
disabled = _ref.disabled,
|
27
|
+
rest = _objectWithoutProperties(_ref, ["type", "iconAlert", "message", "withLink", "withEmphasis", "hoverButton", "disabled"]);
|
28
|
+
|
29
|
+
var icon = React.useMemo(function () {
|
30
|
+
return ICONS[type];
|
31
|
+
}, [type]);
|
32
|
+
return React.createElement(S.IconAlertWrapper, _extends({}, rest, {
|
33
|
+
type: type,
|
34
|
+
disabled: disabled,
|
35
|
+
hoverButton: hoverButton,
|
36
|
+
className: "ds-inline-alert"
|
37
|
+
}), iconAlert && React.createElement(Icon, {
|
38
|
+
component: icon
|
39
|
+
}), message && React.createElement(S.Message, null, message, withLink && React.createElement(S.LinkWrapper, null, withLink), withEmphasis && !withLink && React.createElement(S.EmphasisWrapper, null, withEmphasis)));
|
40
|
+
};
|
41
|
+
|
42
|
+
export default IconAlert;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { IconAlertType } from './IconAlert.types';
|
2
|
+
export declare const Message: import("styled-components").StyledComponent<"span", any, {}, never>;
|
3
|
+
export declare const IconAlertWrapper: import("styled-components").StyledComponent<"span", any, {
|
4
|
+
type: IconAlertType;
|
5
|
+
hoverButton?: boolean | undefined;
|
6
|
+
disabled?: boolean | undefined;
|
7
|
+
}, never>;
|
8
|
+
export declare const EmphasisWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
|
9
|
+
export declare const LinkWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import styled, { css } from 'styled-components';
|
2
|
+
var COLORS = {
|
3
|
+
success: 'green-600',
|
4
|
+
warning: 'yellow-600',
|
5
|
+
alert: 'red-600',
|
6
|
+
info: 'grey-600'
|
7
|
+
};
|
8
|
+
var COLORS_TEXT = {
|
9
|
+
success: 'green-700',
|
10
|
+
warning: 'yellow-700',
|
11
|
+
alert: 'red-700',
|
12
|
+
info: 'grey-700'
|
13
|
+
};
|
14
|
+
var COLORS_HOVER = {
|
15
|
+
success: 'green-700',
|
16
|
+
warning: 'yellow-700',
|
17
|
+
alert: 'red-700',
|
18
|
+
info: 'grey-700'
|
19
|
+
};
|
20
|
+
export var Message = styled.span.withConfig({
|
21
|
+
displayName: "IconAlertstyles__Message",
|
22
|
+
componentId: "sc-1ty06sp-0"
|
23
|
+
})(["display:flex;font-size:13px;line-height:18px;font-weight:400;color:inherit;margin-left:4px;"]);
|
24
|
+
export var IconAlertWrapper = styled.span.withConfig({
|
25
|
+
displayName: "IconAlertstyles__IconAlertWrapper",
|
26
|
+
componentId: "sc-1ty06sp-1"
|
27
|
+
})(["display:flex;align-items:center;justify-content:flex-start;flex-direction:row;&:hover{cursor:", ";svg{color:", ";fill:", ";}}&:active{svg{color:", ";fill:", ";}}svg{color:", ";fill:", ";}", ";", "{color:", ";}"], function (props) {
|
28
|
+
return props.hoverButton ? 'pointer' : 'auto';
|
29
|
+
}, function (props) {
|
30
|
+
return props.hoverButton ? props.theme.palette[COLORS_HOVER[props.type]] : props.theme.palette[COLORS[props.type]];
|
31
|
+
}, function (props) {
|
32
|
+
return props.hoverButton ? props.theme.palette[COLORS_HOVER[props.type]] : props.theme.palette[COLORS[props.type]];
|
33
|
+
}, function (props) {
|
34
|
+
return props.theme.palette[COLORS[props.type]];
|
35
|
+
}, function (props) {
|
36
|
+
return props.theme.palette[COLORS[props.type]];
|
37
|
+
}, function (props) {
|
38
|
+
return props.theme.palette[COLORS[props.type]];
|
39
|
+
}, function (props) {
|
40
|
+
return props.theme.palette[COLORS[props.type]];
|
41
|
+
}, function (props) {
|
42
|
+
return !!props.disabled && css(["pointer-events:none;opacity:0.4;"]);
|
43
|
+
}, Message, function (props) {
|
44
|
+
return props.theme.palette[COLORS_TEXT[props.type]];
|
45
|
+
});
|
46
|
+
export var EmphasisWrapper = styled.span.withConfig({
|
47
|
+
displayName: "IconAlertstyles__EmphasisWrapper",
|
48
|
+
componentId: "sc-1ty06sp-2"
|
49
|
+
})(["display:flex;padding-bottom:1px;font-size:13px;line-height:1.39;padding-left:3px;font-weight:500;color:inherit;"]);
|
50
|
+
export var LinkWrapper = styled.span.withConfig({
|
51
|
+
displayName: "IconAlertstyles__LinkWrapper",
|
52
|
+
componentId: "sc-1ty06sp-3"
|
53
|
+
})(["display:flex;font-size:13px;line-height:1.39;font-weight:400;margin-left:3px;color:inherit;text-decoration:underline;cursor:pointer;"]);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
export declare type IconAlertType = 'success' | 'alert' | 'warning' | 'info';
|
3
|
+
export declare type IconAlertProps = {
|
4
|
+
type: IconAlertType;
|
5
|
+
message: string | React.ReactNode;
|
6
|
+
withEmphasis?: React.ReactNode;
|
7
|
+
withLink?: React.ReactNode;
|
8
|
+
iconAlert?: boolean;
|
9
|
+
hoverButton?: boolean;
|
10
|
+
disabled?: boolean;
|
11
|
+
};
|
File without changes
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { CloseM, WarningFillM, Check3M, HelpFillM, InfoFillM, AngleDownS } from '@synerise/ds-icon/dist/icons';
|
3
|
+
import Icon from '@synerise/ds-icon';
|
4
|
+
import * as S from './Toast.styles';
|
5
|
+
var ICONS = {
|
6
|
+
success: React.createElement(Check3M, null),
|
7
|
+
warning: React.createElement(WarningFillM, null),
|
8
|
+
negative: React.createElement(WarningFillM, null),
|
9
|
+
neutral: React.createElement(HelpFillM, null),
|
10
|
+
informative: React.createElement(InfoFillM, null)
|
11
|
+
};
|
12
|
+
var DEFAULT_ICON = React.createElement(WarningFillM, null);
|
13
|
+
|
14
|
+
var Toast = function Toast(_ref) {
|
15
|
+
var icon = _ref.icon,
|
16
|
+
type = _ref.type,
|
17
|
+
message = _ref.message,
|
18
|
+
description = _ref.description,
|
19
|
+
expander = _ref.expander,
|
20
|
+
expandedContent = _ref.expandedContent,
|
21
|
+
color = _ref.color,
|
22
|
+
withClose = _ref.withClose,
|
23
|
+
customColor = _ref.customColor,
|
24
|
+
customColorIcon = _ref.customColorIcon,
|
25
|
+
customIcon = _ref.customIcon,
|
26
|
+
colorIcon = _ref.colorIcon,
|
27
|
+
customColorText = _ref.customColorText,
|
28
|
+
expanded = _ref.expanded,
|
29
|
+
onExpand = _ref.onExpand,
|
30
|
+
onCloseClick = _ref.onCloseClick,
|
31
|
+
show = _ref.show,
|
32
|
+
button = _ref.button;
|
33
|
+
var renderMessage = React.useMemo(function () {
|
34
|
+
return React.createElement(S.AlertContent, null, message && React.createElement(S.AlertMessage, {
|
35
|
+
customColorText: customColorText,
|
36
|
+
color: color
|
37
|
+
}, message), React.createElement(S.Text, {
|
38
|
+
customColorText: customColorText,
|
39
|
+
color: color
|
40
|
+
}, description && React.createElement(S.AlertDescription, {
|
41
|
+
expandedContent: expandedContent,
|
42
|
+
button: button,
|
43
|
+
customColorText: customColorText,
|
44
|
+
color: color
|
45
|
+
}, description)), expandedContent && expanded && React.createElement(S.ListWrapper, {
|
46
|
+
description: description,
|
47
|
+
visible: expanded
|
48
|
+
}, expandedContent), button);
|
49
|
+
}, [message, description, expandedContent, customColorText, color, expanded, button]);
|
50
|
+
var renderIcon = React.useMemo(function () {
|
51
|
+
if (icon) return icon;
|
52
|
+
if (ICONS[type]) return ICONS[type];
|
53
|
+
return DEFAULT_ICON;
|
54
|
+
}, [icon, type]);
|
55
|
+
var expandContent = React.useCallback(function () {
|
56
|
+
onExpand && onExpand(!expanded);
|
57
|
+
}, [onExpand, expanded]);
|
58
|
+
return React.createElement(S.Container, {
|
59
|
+
expander: expander,
|
60
|
+
expandedContent: expandedContent,
|
61
|
+
withClose: withClose,
|
62
|
+
visible: show,
|
63
|
+
onCloseClick: onCloseClick,
|
64
|
+
color: color,
|
65
|
+
customColor: customColor
|
66
|
+
}, React.createElement(S.WrapperSectionMessage, null, React.createElement(S.AllContent, null, React.createElement(S.IconWrapper, {
|
67
|
+
colorIcon: colorIcon,
|
68
|
+
customColorIcon: customColorIcon
|
69
|
+
}, customIcon || React.createElement(Icon, {
|
70
|
+
component: renderIcon
|
71
|
+
})), renderMessage), React.createElement(S.ButtonWrapper, null, expander && React.createElement(S.IconExpanderWrapper, {
|
72
|
+
onClick: expandContent,
|
73
|
+
expanded: expanded,
|
74
|
+
customColorText: customColorText,
|
75
|
+
color: color
|
76
|
+
}, React.createElement(Icon, {
|
77
|
+
component: React.createElement(AngleDownS, null),
|
78
|
+
size: 24
|
79
|
+
})), withClose && React.createElement(S.IconCloseWrapper, {
|
80
|
+
onClick: onCloseClick,
|
81
|
+
customColorText: customColorText,
|
82
|
+
color: color
|
83
|
+
}, React.createElement(Icon, {
|
84
|
+
component: React.createElement(CloseM, null)
|
85
|
+
})))));
|
86
|
+
};
|
87
|
+
|
88
|
+
export default Toast;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { Keyframes } from 'styled-components';
|
2
|
+
import * as React from 'react';
|
3
|
+
import 'animate.css';
|
4
|
+
export declare const openingAnimation: () => Keyframes;
|
5
|
+
export declare const closingAnimation: () => Keyframes;
|
6
|
+
export declare const AlertContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
7
|
+
export declare const AllContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
8
|
+
export declare const Text: import("styled-components").StyledComponent<"div", any, {
|
9
|
+
customColorText?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
10
|
+
color?: "blue" | "grey" | "red" | "green" | "yellow" | undefined;
|
11
|
+
}, never>;
|
12
|
+
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {
|
13
|
+
colorIcon?: "blue" | "grey" | "yellow" | "white" | "black" | undefined;
|
14
|
+
customColorIcon?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
15
|
+
}, never>;
|
16
|
+
export declare const IconCloseWrapper: import("styled-components").StyledComponent<"div", any, {
|
17
|
+
customColorText?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
18
|
+
color?: "blue" | "grey" | "red" | "green" | "yellow" | undefined;
|
19
|
+
}, never>;
|
20
|
+
export declare const IconExpanderWrapper: import("styled-components").StyledComponent<"div", any, {
|
21
|
+
customColorText?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
22
|
+
color?: "blue" | "grey" | "red" | "green" | "yellow" | undefined;
|
23
|
+
expanded?: boolean | undefined;
|
24
|
+
}, never>;
|
25
|
+
export declare const ButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
26
|
+
export declare const FirstButtonWrapper: import("styled-components").StyledComponent<"div", any, {
|
27
|
+
customColorText?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
28
|
+
color?: "blue" | "grey" | "red" | "green" | "yellow" | undefined;
|
29
|
+
}, never>;
|
30
|
+
export declare const NumberWrapper: import("styled-components").StyledComponent<"div", any, {
|
31
|
+
customColorText?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
32
|
+
color?: "blue" | "grey" | "red" | "green" | "yellow" | undefined;
|
33
|
+
}, never>;
|
34
|
+
export declare const ListWrapper: import("styled-components").StyledComponent<"div", any, {
|
35
|
+
visible?: boolean | undefined;
|
36
|
+
description?: React.ReactNode;
|
37
|
+
}, never>;
|
38
|
+
export declare const IconOrderWrapper: import("styled-components").StyledComponent<"div", any, {
|
39
|
+
customColorText?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
40
|
+
color?: "blue" | "grey" | "red" | "green" | "yellow" | undefined;
|
41
|
+
}, never>;
|
42
|
+
export declare const OrderWrapper: import("styled-components").StyledComponent<"div", any, {
|
43
|
+
customColorText?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
44
|
+
color?: "blue" | "grey" | "red" | "green" | "yellow" | undefined;
|
45
|
+
}, never>;
|
46
|
+
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
47
|
+
export declare const AnimationContainer: import("styled-components").StyledComponent<"div", any, {
|
48
|
+
show?: boolean | undefined;
|
49
|
+
}, never>;
|
50
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
51
|
+
color?: "blue" | "grey" | "red" | "green" | "yellow" | undefined;
|
52
|
+
visible?: React.ReactNode | boolean;
|
53
|
+
customColor?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
54
|
+
onCloseClick?: (() => void) | undefined;
|
55
|
+
expandedContent?: React.ReactNode | boolean;
|
56
|
+
expander?: React.ReactNode | boolean;
|
57
|
+
withClose?: React.ReactNode | boolean;
|
58
|
+
}, never>;
|
59
|
+
export declare const WrapperSectionMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
|
60
|
+
export declare const AlertMessage: import("styled-components").StyledComponent<"span", any, {
|
61
|
+
customColorText?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
62
|
+
color?: "blue" | "grey" | "red" | "green" | "yellow" | undefined;
|
63
|
+
}, never>;
|
64
|
+
export declare const AlertDescription: import("styled-components").StyledComponent<"span", any, {
|
65
|
+
customColorText?: "blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet" | undefined;
|
66
|
+
color?: "blue" | "grey" | "red" | "green" | "yellow" | undefined;
|
67
|
+
button?: React.ReactNode | boolean;
|
68
|
+
expandedContent?: React.ReactNode | boolean;
|
69
|
+
}, never>;
|
@@ -0,0 +1,181 @@
|
|
1
|
+
import styled, { keyframes } from 'styled-components';
|
2
|
+
import 'animate.css';
|
3
|
+
|
4
|
+
var getColorIcon = function getColorIcon(props) {
|
5
|
+
switch (props.colorIcon) {
|
6
|
+
case 'white':
|
7
|
+
return props.theme.palette.white;
|
8
|
+
|
9
|
+
case 'grey':
|
10
|
+
return props.theme.palette['grey-600'];
|
11
|
+
|
12
|
+
case 'black':
|
13
|
+
return props.theme.palette['grey-800'];
|
14
|
+
|
15
|
+
default:
|
16
|
+
return props.theme.palette['blue-600'];
|
17
|
+
}
|
18
|
+
};
|
19
|
+
|
20
|
+
var getColorText = function getColorText(props) {
|
21
|
+
switch (props.color) {
|
22
|
+
case 'red':
|
23
|
+
return props.theme.palette.white;
|
24
|
+
|
25
|
+
case 'green':
|
26
|
+
return props.theme.palette.white;
|
27
|
+
|
28
|
+
case 'yellow':
|
29
|
+
return props.theme.palette['grey-800'];
|
30
|
+
|
31
|
+
default:
|
32
|
+
return props.theme.palette['grey-600'];
|
33
|
+
}
|
34
|
+
};
|
35
|
+
|
36
|
+
var getColorBackground = function getColorBackground(props) {
|
37
|
+
switch (props.color) {
|
38
|
+
case 'grey':
|
39
|
+
return props.theme.palette.white;
|
40
|
+
|
41
|
+
case 'blue':
|
42
|
+
return props.theme.palette['blue-050'];
|
43
|
+
|
44
|
+
case 'red':
|
45
|
+
return props.theme.palette['red-500'];
|
46
|
+
|
47
|
+
default:
|
48
|
+
return props.theme.palette["".concat(props.color, "-600")];
|
49
|
+
}
|
50
|
+
};
|
51
|
+
|
52
|
+
var getWidth = function getWidth(props) {
|
53
|
+
if (props.expandedContent || props.expander && props.withClose) {
|
54
|
+
return '420px';
|
55
|
+
}
|
56
|
+
|
57
|
+
return '354px';
|
58
|
+
};
|
59
|
+
|
60
|
+
export var openingAnimation = function openingAnimation() {
|
61
|
+
return keyframes(["0%{height:0%;opacity:0;}100%{height:100%;opacity:1;}"]);
|
62
|
+
};
|
63
|
+
export var closingAnimation = function closingAnimation() {
|
64
|
+
return keyframes(["0%{height:100%;opacity:1;}100%{height:0%;opacity:0;}"]);
|
65
|
+
};
|
66
|
+
export var AlertContent = styled.div.withConfig({
|
67
|
+
displayName: "Toaststyles__AlertContent",
|
68
|
+
componentId: "q5tn0-0"
|
69
|
+
})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;padding:12px 0;"]);
|
70
|
+
export var AllContent = styled.div.withConfig({
|
71
|
+
displayName: "Toaststyles__AllContent",
|
72
|
+
componentId: "q5tn0-1"
|
73
|
+
})(["display:flex;color:inherit;"]);
|
74
|
+
export var Text = styled.div.withConfig({
|
75
|
+
displayName: "Toaststyles__Text",
|
76
|
+
componentId: "q5tn0-2"
|
77
|
+
})(["display:flex;color:", ";"], function (props) {
|
78
|
+
return props.customColorText ? props.theme.palette["".concat(props.customColorText, "-600")] : getColorText(props);
|
79
|
+
});
|
80
|
+
export var IconWrapper = styled.div.withConfig({
|
81
|
+
displayName: "Toaststyles__IconWrapper",
|
82
|
+
componentId: "q5tn0-3"
|
83
|
+
})(["margin:10px 12px;display:flex;svg{color:", ";fill:", ";}"], function (props) {
|
84
|
+
return props.customColorIcon ? props.theme.palette["".concat(props.customColorIcon, "-600")] : getColorIcon;
|
85
|
+
}, function (props) {
|
86
|
+
return props.customColorIcon ? props.theme.palette["".concat(props.customColorIcon, "-600")] : getColorIcon;
|
87
|
+
});
|
88
|
+
export var IconCloseWrapper = styled.div.withConfig({
|
89
|
+
displayName: "Toaststyles__IconCloseWrapper",
|
90
|
+
componentId: "q5tn0-4"
|
91
|
+
})(["margin:3px 5px 2px;cursor:pointer;svg{fill:", ";}"], function (props) {
|
92
|
+
return props.customColorText ? props.theme.palette["".concat(props.customColorText, "-600")] : getColorText(props);
|
93
|
+
});
|
94
|
+
export var IconExpanderWrapper = styled.div.withConfig({
|
95
|
+
displayName: "Toaststyles__IconExpanderWrapper",
|
96
|
+
componentId: "q5tn0-5"
|
97
|
+
})(["margin:3px 5px 2px;cursor:pointer;svg{fill:", ";transition:transform 0.1s linear;transform:rotateZ(", ");}"], function (props) {
|
98
|
+
return props.customColorText ? props.theme.palette["".concat(props.customColorText, "-600")] : getColorText(props);
|
99
|
+
}, function (props) {
|
100
|
+
return props.expanded ? '180deg' : '0deg';
|
101
|
+
});
|
102
|
+
export var ButtonWrapper = styled.div.withConfig({
|
103
|
+
displayName: "Toaststyles__ButtonWrapper",
|
104
|
+
componentId: "q5tn0-6"
|
105
|
+
})(["padding:6px 8px 0 8px;display:flex;"]);
|
106
|
+
export var FirstButtonWrapper = styled.div.withConfig({
|
107
|
+
displayName: "Toaststyles__FirstButtonWrapper",
|
108
|
+
componentId: "q5tn0-7"
|
109
|
+
})(["margin-right:8px;"]);
|
110
|
+
export var NumberWrapper = styled.div.withConfig({
|
111
|
+
displayName: "Toaststyles__NumberWrapper",
|
112
|
+
componentId: "q5tn0-8"
|
113
|
+
})(["margin-left:4px;color:inherit;opacity:0.6;cursor:pointer;&:hover{background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;opacity:1;color:", ";}"], function (props) {
|
114
|
+
return props.theme.palette['grey-400'];
|
115
|
+
}, function (props) {
|
116
|
+
return props.customColorText ? props.theme.palette["".concat(props.customColorText, "-600")] : getColorText(props);
|
117
|
+
});
|
118
|
+
export var ListWrapper = styled.div.withConfig({
|
119
|
+
displayName: "Toaststyles__ListWrapper",
|
120
|
+
componentId: "q5tn0-9"
|
121
|
+
})(["display:flex;margin-top:", ";"], function (props) {
|
122
|
+
return !props.description ? '10px' : '0';
|
123
|
+
});
|
124
|
+
export var IconOrderWrapper = styled.div.withConfig({
|
125
|
+
displayName: "Toaststyles__IconOrderWrapper",
|
126
|
+
componentId: "q5tn0-10"
|
127
|
+
})(["display:none;margin:-4px 0;svg{fill:", ";}&:hover{svg{fill:", ";cursor:pointer;}}"], function (props) {
|
128
|
+
return props.customColorText ? props.theme.palette["".concat(props.customColorText, "-600")] : getColorText(props);
|
129
|
+
}, function (props) {
|
130
|
+
return props.theme.palette['blue-600'];
|
131
|
+
});
|
132
|
+
export var OrderWrapper = styled.div.withConfig({
|
133
|
+
displayName: "Toaststyles__OrderWrapper",
|
134
|
+
componentId: "q5tn0-11"
|
135
|
+
})(["display:flex;color:", ";&:hover{", "{display:block;}", "{background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;opacity:1;color:", ";}}"], function (props) {
|
136
|
+
return props.customColorText ? props.theme.palette["".concat(props.customColorText, "-600")] : getColorText(props);
|
137
|
+
}, IconOrderWrapper, NumberWrapper, function (props) {
|
138
|
+
return props.customColorText ? props.theme.palette["".concat(props.customColorText, "-600")] : getColorText(props);
|
139
|
+
}, function (props) {
|
140
|
+
return props.customColorText ? props.theme.palette["".concat(props.customColorText, "-600")] : getColorText(props);
|
141
|
+
});
|
142
|
+
export var Wrapper = styled.div.withConfig({
|
143
|
+
displayName: "Toaststyles__Wrapper",
|
144
|
+
componentId: "q5tn0-12"
|
145
|
+
})(["color:", ";"], function (props) {
|
146
|
+
return props.theme.palette['grey-050'];
|
147
|
+
});
|
148
|
+
export var AnimationContainer = styled.div.withConfig({
|
149
|
+
displayName: "Toaststyles__AnimationContainer",
|
150
|
+
componentId: "q5tn0-13"
|
151
|
+
})(["animation:", " 0.5s ease-in-out 0s 1;"], function (props) {
|
152
|
+
return props.show ? openingAnimation() : closingAnimation();
|
153
|
+
});
|
154
|
+
export var Container = styled.div.withConfig({
|
155
|
+
displayName: "Toaststyles__Container",
|
156
|
+
componentId: "q5tn0-14"
|
157
|
+
})(["width:", ";align-items:center;justify-content:center;background-color:", ";border-radius:4px;box-shadow:", ";"], function (props) {
|
158
|
+
return props.expander && props.expandedContent && props.withClose ? '460px' : getWidth(props);
|
159
|
+
}, function (props) {
|
160
|
+
return props.customColor ? props.theme.palette["".concat(props.customColor, "-600")] : getColorBackground(props);
|
161
|
+
}, function (props) {
|
162
|
+
return props.color ? "0px 16px 32px 5px ".concat(props.theme.palette["grey-200"]) : 'none';
|
163
|
+
});
|
164
|
+
export var WrapperSectionMessage = styled.div.withConfig({
|
165
|
+
displayName: "Toaststyles__WrapperSectionMessage",
|
166
|
+
componentId: "q5tn0-15"
|
167
|
+
})(["display:flex;font-size:13px;color:inherit;justify-content:space-between;"]);
|
168
|
+
export var AlertMessage = styled.span.withConfig({
|
169
|
+
displayName: "Toaststyles__AlertMessage",
|
170
|
+
componentId: "q5tn0-16"
|
171
|
+
})(["font-size:16px;line-height:1.25;font-weight:500;max-width:400px;overflow:hidden;text-overflow:ellipsis;color:", ";"], function (props) {
|
172
|
+
return props.customColorText ? props.theme.palette["".concat(props.customColorText, "-600")] : getColorText(props);
|
173
|
+
});
|
174
|
+
export var AlertDescription = styled.span.withConfig({
|
175
|
+
displayName: "Toaststyles__AlertDescription",
|
176
|
+
componentId: "q5tn0-17"
|
177
|
+
})(["display:flex;font-size:13px;line-height:1.39;font-weight:normal;padding:", ";margin-top:2px;color:", ";"], function (props) {
|
178
|
+
return props.button || props.expandedContent ? ' 0 3px 10px 0' : '0px';
|
179
|
+
}, function (props) {
|
180
|
+
return props.customColorText ? props.theme.palette["".concat(props.customColorText, "-600")] : getColorText(props);
|
181
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { AlertProps } from 'antd/lib/alert';
|
2
|
+
import * as React from 'react';
|
3
|
+
export declare type ToastType = 'success' | 'warning' | 'negative' | 'informative' | 'neutral';
|
4
|
+
export declare type CustomColorType = 'blue' | 'grey' | 'red' | 'green' | 'yellow' | 'pink' | 'mars' | 'orange' | 'fern' | 'cyan' | 'purple' | 'violet';
|
5
|
+
export declare type ColorType = 'grey' | 'red' | 'green' | 'yellow' | 'blue';
|
6
|
+
export declare type ColorIconType = 'white' | 'grey' | 'black' | 'yellow' | 'blue';
|
7
|
+
export interface Props extends Omit<AlertProps, 'type' | 'message'> {
|
8
|
+
message?: React.ReactNode;
|
9
|
+
type: string | ToastType;
|
10
|
+
customColor?: CustomColorType;
|
11
|
+
customColorText?: CustomColorType;
|
12
|
+
customColorIcon?: CustomColorType;
|
13
|
+
color?: ColorType;
|
14
|
+
colorIcon?: ColorIconType;
|
15
|
+
expander?: boolean | React.ReactNode;
|
16
|
+
expandedContent?: React.ReactNode;
|
17
|
+
withClose?: React.ReactNode;
|
18
|
+
customIcon?: React.ReactElement;
|
19
|
+
button?: React.ReactNode;
|
20
|
+
expanded?: boolean;
|
21
|
+
onExpand?: (isExpanded: boolean) => void;
|
22
|
+
onCloseClick?: () => void;
|
23
|
+
show?: boolean;
|
24
|
+
}
|
File without changes
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@synerise/ds-alert",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.24",
|
4
4
|
"description": "Alert UI Component for the Synerise Design System",
|
5
5
|
"license": "ISC",
|
6
6
|
"repository": "Synerise/synerise-design",
|
@@ -32,17 +32,20 @@
|
|
32
32
|
],
|
33
33
|
"types": "dist/index.d.ts",
|
34
34
|
"dependencies": {
|
35
|
-
"@synerise/ds-button": "^0.
|
36
|
-
"@synerise/ds-icon": "^0.
|
37
|
-
"@synerise/ds-typography": "^0.11.
|
38
|
-
"@synerise/ds-unordered-list": "^0.1.
|
35
|
+
"@synerise/ds-button": "^0.15.0",
|
36
|
+
"@synerise/ds-icon": "^0.45.2",
|
37
|
+
"@synerise/ds-typography": "^0.11.9",
|
38
|
+
"@synerise/ds-unordered-list": "^0.1.47",
|
39
|
+
"animate.css": "^4.1.1",
|
40
|
+
"react-animate-height": "^2.0.23",
|
41
|
+
"react-mount-animation": "0.0.9"
|
39
42
|
},
|
40
43
|
"peerDependencies": {
|
41
44
|
"@synerise/ds-core": "*",
|
42
45
|
"react": ">=16.9.0 < 17.0.0"
|
43
46
|
},
|
44
47
|
"devDependencies": {
|
45
|
-
"@synerise/ds-utils": "^0.
|
48
|
+
"@synerise/ds-utils": "^0.19.0"
|
46
49
|
},
|
47
|
-
"gitHead": "
|
50
|
+
"gitHead": "daaf50ad62081d7ad77eb4ac65100173df77c731"
|
48
51
|
}
|