@elliemae/ds-banner 1.57.1 → 2.0.0-alpha.11
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/cjs/DSBanner.js +65 -75
- package/cjs/defaultProps.js +5 -10
- package/cjs/index.d.js +0 -1
- package/cjs/index.js +3 -18
- package/cjs/propTypes.js +3 -4
- package/cjs/styles.js +57 -79
- package/cjs/utils/bannerTypes.js +1 -2
- package/cjs/utils/icons.js +16 -9
- package/cjs/utils/styleHelpers.js +15 -22
- package/esm/DSBanner.js +60 -70
- package/esm/defaultProps.js +3 -8
- package/esm/index.d.js +0 -1
- package/esm/index.js +0 -15
- package/esm/propTypes.js +1 -2
- package/esm/styles.js +56 -78
- package/esm/utils/bannerTypes.js +1 -2
- package/esm/utils/icons.js +11 -8
- package/esm/utils/styleHelpers.js +8 -15
- package/package.json +57 -14
- package/types/DSBanner.d.ts +32 -0
- package/types/defaultProps.d.ts +14 -0
- package/types/index.d.ts +3 -0
- package/types/propTypes.d.ts +10 -0
- package/types/styles.d.ts +8 -0
- package/types/tests/DSBanner.events.test.d.ts +1 -0
- package/types/tests/DSBanner.test.d.ts +1 -0
- package/types/utils/bannerTypes.d.ts +6 -0
- package/types/utils/icons.d.ts +7 -0
- package/types/utils/styleHelpers.d.ts +5 -0
- package/DSBanner/package.json +0 -10
- package/cjs/DSBanner.js.map +0 -1
- package/cjs/defaultProps.js.map +0 -1
- package/cjs/index.d.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/propTypes.js.map +0 -1
- package/cjs/styles.js.map +0 -1
- package/cjs/utils/bannerTypes.js.map +0 -1
- package/cjs/utils/icons.js.map +0 -1
- package/cjs/utils/styleHelpers.js.map +0 -1
- package/defaultProps/package.json +0 -10
- package/esm/DSBanner.js.map +0 -1
- package/esm/defaultProps.js.map +0 -1
- package/esm/index.d.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/propTypes.js.map +0 -1
- package/esm/styles.js.map +0 -1
- package/esm/utils/bannerTypes.js.map +0 -1
- package/esm/utils/icons.js.map +0 -1
- package/esm/utils/styleHelpers.js.map +0 -1
- package/propTypes/package.json +0 -10
- package/styles/package.json +0 -10
- package/utils/bannerTypes/package.json +0 -10
- package/utils/icons/package.json +0 -10
- package/utils/styleHelpers/package.json +0 -10
package/esm/DSBanner.js
CHANGED
|
@@ -1,103 +1,93 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
|
+
import { useRef, useState, useEffect, useLayoutEffect, useCallback } from 'react';
|
|
5
|
+
import CloseX from '@elliemae/ds-icons/CloseX';
|
|
5
6
|
import { describe } from 'react-desc';
|
|
6
7
|
import { icons } from './utils/icons.js';
|
|
7
8
|
import { propTypes } from './propTypes.js';
|
|
8
9
|
import { defaultProps } from './defaultProps.js';
|
|
9
10
|
import { StyledBannerContainer, StyledInnerContainer, StyledIconContainer, StyledTitle, StyledSubTitle, StyledActionLink, StyledCloseButton } from './styles.js';
|
|
10
|
-
import '
|
|
11
|
-
import 'styled-components';
|
|
12
|
-
import '@elliemae/ds-button';
|
|
13
|
-
import './utils/styleHelpers.js';
|
|
14
|
-
import '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
15
|
-
import '@elliemae/ds-system';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
16
12
|
|
|
17
|
-
var
|
|
18
|
-
var type = _ref.type,
|
|
19
|
-
isOpen = _ref.isOpen,
|
|
20
|
-
onClose = _ref.onClose,
|
|
21
|
-
label = _ref.label,
|
|
22
|
-
body = _ref.body,
|
|
23
|
-
actionLink = _ref.actionLink,
|
|
24
|
-
showCloseButton = _ref.showCloseButton,
|
|
25
|
-
containerProps = _ref.containerProps;
|
|
26
|
-
var innerContainerRef = useRef(null);
|
|
27
|
-
var linkRef = useRef(null);
|
|
13
|
+
var _CloseX;
|
|
28
14
|
|
|
29
|
-
|
|
30
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
-
current = _useState2[0],
|
|
32
|
-
setCurrent = _useState2[1];
|
|
15
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
33
16
|
|
|
34
|
-
|
|
35
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
-
isAnimating = _useState4[0],
|
|
37
|
-
setIsAnimating = _useState4[1];
|
|
17
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
38
18
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
19
|
+
const DSBanner = ({
|
|
20
|
+
type,
|
|
21
|
+
isOpen,
|
|
22
|
+
onClose,
|
|
23
|
+
label,
|
|
24
|
+
body,
|
|
25
|
+
actionLink,
|
|
26
|
+
showCloseButton,
|
|
27
|
+
containerProps
|
|
28
|
+
}) => {
|
|
29
|
+
const innerContainerRef = useRef(null);
|
|
30
|
+
const linkRef = useRef(null);
|
|
31
|
+
const [current, setCurrent] = useState(isOpen);
|
|
32
|
+
const [isAnimating, setIsAnimating] = useState(false);
|
|
33
|
+
const [height, setHeight] = useState(0);
|
|
34
|
+
useEffect(() => {
|
|
45
35
|
if (innerContainerRef.current) {
|
|
46
36
|
setHeight(innerContainerRef.current.offsetHeight);
|
|
47
37
|
}
|
|
48
38
|
}, [isAnimating, isOpen]);
|
|
49
|
-
useLayoutEffect(
|
|
39
|
+
useLayoutEffect(() => {
|
|
50
40
|
if (isOpen !== current || isOpen) setIsAnimating(true);else setIsAnimating(false);
|
|
51
41
|
}, [isOpen, current]);
|
|
52
|
-
|
|
42
|
+
const handleOnKeyDown = useCallback(e => {
|
|
53
43
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
54
44
|
e.preventDefault();
|
|
55
45
|
if (linkRef.current) linkRef.current.click();
|
|
56
46
|
}
|
|
57
47
|
}, []);
|
|
58
48
|
if (!isAnimating && !isOpen) return null;
|
|
59
|
-
return /*#__PURE__*/
|
|
49
|
+
return /*#__PURE__*/jsx(StyledBannerContainer, _objectSpread(_objectSpread({
|
|
60
50
|
type: type,
|
|
61
51
|
isOpen: isOpen,
|
|
62
52
|
isAnimating: isAnimating,
|
|
63
|
-
onAnimationEnd:
|
|
64
|
-
return setCurrent(isOpen);
|
|
65
|
-
},
|
|
53
|
+
onAnimationEnd: () => setCurrent(isOpen),
|
|
66
54
|
height: height,
|
|
67
55
|
"data-testid": "ds-banner-container"
|
|
68
|
-
}, containerProps),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
56
|
+
}, containerProps), {}, {
|
|
57
|
+
children: /*#__PURE__*/jsxs(StyledInnerContainer, {
|
|
58
|
+
type: type,
|
|
59
|
+
isOpen: isOpen,
|
|
60
|
+
ref: innerContainerRef,
|
|
61
|
+
isAnimating: isAnimating,
|
|
62
|
+
"data-testid": "ds-banner",
|
|
63
|
+
role: "alert",
|
|
64
|
+
children: [/*#__PURE__*/_jsx(StyledIconContainer, {
|
|
65
|
+
"data-testid": "ds-banner-icon"
|
|
66
|
+
}, void 0, icons[type]), /*#__PURE__*/_jsx(StyledTitle, {}, void 0, label), /*#__PURE__*/_jsx(StyledSubTitle, {}, void 0, /*#__PURE__*/_jsx("span", {}, void 0, body), actionLink && /*#__PURE__*/jsx(StyledActionLink, {
|
|
67
|
+
"data-testid": "ds-banner-action-link",
|
|
68
|
+
onClick: actionLink.onClick,
|
|
69
|
+
href: actionLink.href,
|
|
70
|
+
ref: linkRef,
|
|
71
|
+
onKeyDown: handleOnKeyDown,
|
|
72
|
+
tabIndex: 0,
|
|
73
|
+
isBodyEmpty: body,
|
|
74
|
+
children: actionLink.label
|
|
75
|
+
})), showCloseButton && /*#__PURE__*/_jsx(StyledCloseButton, {
|
|
76
|
+
"data-testid": "ds-banner-close-button",
|
|
77
|
+
buttonType: "secondary",
|
|
78
|
+
onClick: onClose,
|
|
79
|
+
"aria-label": "Close icon",
|
|
80
|
+
icon: _CloseX || (_CloseX = /*#__PURE__*/_jsx(CloseX, {
|
|
81
|
+
width: "12px",
|
|
82
|
+
height: "12px"
|
|
83
|
+
}))
|
|
84
|
+
})]
|
|
93
85
|
})
|
|
94
|
-
}))
|
|
86
|
+
}));
|
|
95
87
|
};
|
|
96
88
|
|
|
97
89
|
DSBanner.defaultProps = defaultProps;
|
|
98
|
-
|
|
99
|
-
var DSBannerWithSchema = describe(DSBanner);
|
|
90
|
+
const DSBannerWithSchema = describe(DSBanner);
|
|
100
91
|
DSBannerWithSchema.propTypes = propTypes;
|
|
101
92
|
|
|
102
93
|
export { DSBannerWithSchema, DSBanner as default };
|
|
103
|
-
//# sourceMappingURL=DSBanner.js.map
|
package/esm/defaultProps.js
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { BANNER_TYPES } from './utils/bannerTypes.js';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const defaultProps = {
|
|
4
4
|
containerProps: {},
|
|
5
5
|
label: '',
|
|
6
6
|
body: '',
|
|
7
7
|
type: BANNER_TYPES.INFO,
|
|
8
8
|
isOpen: true,
|
|
9
|
-
onClose:
|
|
10
|
-
return null;
|
|
11
|
-
},
|
|
9
|
+
onClose: () => null,
|
|
12
10
|
showCloseButton: true,
|
|
13
11
|
actionLink: {
|
|
14
12
|
label: '',
|
|
15
|
-
onClick:
|
|
16
|
-
return null;
|
|
17
|
-
},
|
|
13
|
+
onClick: () => null,
|
|
18
14
|
href: ''
|
|
19
15
|
}
|
|
20
16
|
};
|
|
21
17
|
|
|
22
18
|
export { defaultProps };
|
|
23
|
-
//# sourceMappingURL=defaultProps.js.map
|
package/esm/index.d.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
1
|
export { DSBannerWithSchema, default } from './DSBanner.js';
|
|
2
2
|
export { BANNER_TYPES } from './utils/bannerTypes.js';
|
|
3
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
4
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
5
|
-
import 'react';
|
|
6
|
-
import '@elliemae/ds-icons';
|
|
7
|
-
import 'react-desc';
|
|
8
|
-
import './utils/icons.js';
|
|
9
|
-
import './propTypes.js';
|
|
10
|
-
import './defaultProps.js';
|
|
11
|
-
import './styles.js';
|
|
12
|
-
import 'styled-components';
|
|
13
|
-
import '@elliemae/ds-button';
|
|
14
|
-
import './utils/styleHelpers.js';
|
|
15
|
-
import '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
16
|
-
import '@elliemae/ds-system';
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
package/esm/propTypes.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropTypes } from 'react-desc';
|
|
2
2
|
import { BANNER_TYPES } from './utils/bannerTypes.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const propTypes = {
|
|
5
5
|
containerProps: PropTypes.object.description('Set of Properties attached to the main container').defaultValue({}),
|
|
6
6
|
label: PropTypes.string.description('banner s label').defaultValue(''),
|
|
7
7
|
body: PropTypes.string.description('banner s body content').defaultValue(''),
|
|
@@ -17,4 +17,3 @@ var propTypes = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { propTypes };
|
|
20
|
-
//# sourceMappingURL=propTypes.js.map
|
package/esm/styles.js
CHANGED
|
@@ -1,90 +1,68 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import DSButton from '@elliemae/ds-
|
|
2
|
+
import DSButton from '@elliemae/ds-basic/Button';
|
|
3
3
|
import { handleAnimation, handleBorderColor } from './utils/styleHelpers.js';
|
|
4
|
-
import '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
5
|
-
import '@elliemae/ds-system';
|
|
6
|
-
import './utils/bannerTypes.js';
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
const StyledBannerContainer = /*#__PURE__*/styled.div.withConfig({
|
|
9
6
|
componentId: "sc-ffu2hq-0"
|
|
10
|
-
})(["overflow:hidden;height:", ";", ";"],
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
var StyledInnerContainer = /*#__PURE__*/styled.div.withConfig({
|
|
7
|
+
})(["overflow:hidden;height:", ";", ";"], ({
|
|
8
|
+
isOpen
|
|
9
|
+
}) => isOpen ? 'auto' : '0px', ({
|
|
10
|
+
isAnimating,
|
|
11
|
+
isOpen,
|
|
12
|
+
height
|
|
13
|
+
}) => handleAnimation(isAnimating, isOpen, height));
|
|
14
|
+
const StyledInnerContainer = /*#__PURE__*/styled.div.withConfig({
|
|
20
15
|
componentId: "sc-ffu2hq-1"
|
|
21
|
-
})(["padding-right:6px;display:flex;align-items:center;min-height:41px;width:100%;background-color:", ";border-bottom:5px solid ", ";", ";"],
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return handleAnimation(isAnimating, isOpen);
|
|
32
|
-
});
|
|
33
|
-
var StyledIconContainer = /*#__PURE__*/styled.div.withConfig({
|
|
16
|
+
})(["padding-right:6px;display:flex;align-items:center;min-height:41px;width:100%;background-color:", ";border-bottom:5px solid ", ";", ";"], ({
|
|
17
|
+
theme
|
|
18
|
+
}) => theme.colors.neutral['000'], ({
|
|
19
|
+
type,
|
|
20
|
+
theme
|
|
21
|
+
}) => handleBorderColor(type, theme), ({
|
|
22
|
+
isAnimating,
|
|
23
|
+
isOpen
|
|
24
|
+
}) => handleAnimation(isAnimating, isOpen));
|
|
25
|
+
const StyledIconContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34
26
|
componentId: "sc-ffu2hq-2"
|
|
35
|
-
})(["margin-right:", ";margin-left:", ";"],
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
42
|
-
var StyledTitle = /*#__PURE__*/styled.div.withConfig({
|
|
27
|
+
})(["margin-right:", ";margin-left:", ";"], ({
|
|
28
|
+
theme
|
|
29
|
+
}) => theme.space.xxs, ({
|
|
30
|
+
theme
|
|
31
|
+
}) => theme.space.xs);
|
|
32
|
+
const StyledTitle = /*#__PURE__*/styled.div.withConfig({
|
|
43
33
|
componentId: "sc-ffu2hq-3"
|
|
44
|
-
})(["color:", ";font-size:", ";font-weight:", ";white-space:nowrap;"],
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return theme.fontWeights.semibold;
|
|
53
|
-
});
|
|
54
|
-
var StyledSubTitle = /*#__PURE__*/styled.div.withConfig({
|
|
34
|
+
})(["color:", ";font-size:", ";font-weight:", ";white-space:nowrap;"], ({
|
|
35
|
+
theme
|
|
36
|
+
}) => theme.colors.neutral[700], ({
|
|
37
|
+
theme
|
|
38
|
+
}) => theme.fontSizes.label[400], ({
|
|
39
|
+
theme
|
|
40
|
+
}) => theme.fontWeights.semibold);
|
|
41
|
+
const StyledSubTitle = /*#__PURE__*/styled.div.withConfig({
|
|
55
42
|
componentId: "sc-ffu2hq-4"
|
|
56
|
-
})(["width:100%;margin-left:", ";font-size:", ";font-weight:", ";"],
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return theme.fontWeights.regular;
|
|
65
|
-
});
|
|
66
|
-
var StyledActionLink = /*#__PURE__*/styled.a.withConfig({
|
|
43
|
+
})(["width:100%;margin-left:", ";font-size:", ";font-weight:", ";"], ({
|
|
44
|
+
theme
|
|
45
|
+
}) => theme.space.xs, ({
|
|
46
|
+
theme
|
|
47
|
+
}) => theme.fontSizes.subTitle[400], ({
|
|
48
|
+
theme
|
|
49
|
+
}) => theme.fontWeights.regular);
|
|
50
|
+
const StyledActionLink = /*#__PURE__*/styled.a.withConfig({
|
|
67
51
|
componentId: "sc-ffu2hq-5"
|
|
68
|
-
})(["margin-left:", ";white-space:nowrap;text-decoration:none;line-height:1.1;font-size:", ";font-weight:", ";color:", ";"],
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var theme = _ref17.theme;
|
|
80
|
-
return theme.colors.brand[600];
|
|
81
|
-
});
|
|
82
|
-
var StyledCloseButton = /*#__PURE__*/styled(DSButton).withConfig({
|
|
52
|
+
})(["margin-left:", ";white-space:nowrap;text-decoration:none;line-height:1.1;font-size:", ";font-weight:", ";color:", ";"], ({
|
|
53
|
+
theme,
|
|
54
|
+
isBodyEmpty
|
|
55
|
+
}) => isBodyEmpty ? theme.space.xs : 0, ({
|
|
56
|
+
theme
|
|
57
|
+
}) => theme.fontSizes.hyperlink[400], ({
|
|
58
|
+
theme
|
|
59
|
+
}) => theme.fontWeights.regular, ({
|
|
60
|
+
theme
|
|
61
|
+
}) => theme.colors.brand[600]);
|
|
62
|
+
const StyledCloseButton = /*#__PURE__*/styled(DSButton).withConfig({
|
|
83
63
|
componentId: "sc-ffu2hq-6"
|
|
84
|
-
})(["margin-left:", ";&:not(focus){border:transparent;}"],
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
});
|
|
64
|
+
})(["margin-left:", ";&:not(focus){border:transparent;}"], ({
|
|
65
|
+
theme
|
|
66
|
+
}) => theme.space.s);
|
|
88
67
|
|
|
89
68
|
export { StyledActionLink, StyledBannerContainer, StyledCloseButton, StyledIconContainer, StyledInnerContainer, StyledSubTitle, StyledTitle };
|
|
90
|
-
//# sourceMappingURL=styles.js.map
|
package/esm/utils/bannerTypes.js
CHANGED
package/esm/utils/icons.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import SuccessFill from '@elliemae/ds-icons/SuccessFill';
|
|
4
|
+
import InfoFill from '@elliemae/ds-icons/InfoFill';
|
|
5
|
+
import AlertsDetailFill from '@elliemae/ds-icons/AlertsDetailFill';
|
|
6
|
+
import WarningSquare from '@elliemae/ds-icons/WarningSquare';
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
success: /*#__PURE__*/
|
|
8
|
+
const icons = {
|
|
9
|
+
success: /*#__PURE__*/_jsx(SuccessFill, {
|
|
6
10
|
fill: "#207e56",
|
|
7
11
|
width: "20px",
|
|
8
12
|
height: "20px"
|
|
9
13
|
}),
|
|
10
|
-
info: /*#__PURE__*/
|
|
14
|
+
info: /*#__PURE__*/_jsx(InfoFill, {
|
|
11
15
|
fill: "#1e79c2",
|
|
12
16
|
width: "20px",
|
|
13
17
|
height: "20px"
|
|
14
18
|
}),
|
|
15
|
-
danger: /*#__PURE__*/
|
|
19
|
+
danger: /*#__PURE__*/_jsx(AlertsDetailFill, {
|
|
16
20
|
fill: "#c64252",
|
|
17
21
|
width: "20px",
|
|
18
22
|
height: "20px"
|
|
19
23
|
}),
|
|
20
|
-
warning: /*#__PURE__*/
|
|
24
|
+
warning: /*#__PURE__*/_jsx(WarningSquare, {
|
|
21
25
|
fill: "#d17a00",
|
|
22
26
|
width: "20px",
|
|
23
27
|
height: "20px"
|
|
@@ -25,4 +29,3 @@ var icons = {
|
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
export { icons };
|
|
28
|
-
//# sourceMappingURL=icons.js.map
|
|
@@ -3,20 +3,16 @@ import { kfrm, css } from '@elliemae/ds-system';
|
|
|
3
3
|
import { BANNER_TYPES } from './bannerTypes.js';
|
|
4
4
|
|
|
5
5
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const slideIn = kfrm(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: translate3d(0, -100%, 0);\n }\n 100% {\n transform: translate3d(0, 0, 0);\n }\n"])));
|
|
7
|
+
const slideOut = kfrm(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n }\n 60% {\n opacity: 0;\n }\n 100% {\n opacity: 0;\n transform: translate3d(0, -100%, 0);\n }\n"])));
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
return kfrm(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n 0% {\n height: 0px;\n }\n 100% {\n height: ", "px;\n }\n"])), height);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
var shrinkContainer = function shrinkContainer(height) {
|
|
14
|
-
return kfrm(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n 0% {\n height: ", "px;\n }\n 100% {\n height: 0px;\n }\n"])), height);
|
|
15
|
-
};
|
|
9
|
+
const spanContainer = height => kfrm(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n 0% {\n height: 0px;\n }\n 100% {\n height: ", "px;\n }\n"])), height);
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
var colors = _ref.colors;
|
|
11
|
+
const shrinkContainer = height => kfrm(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n 0% {\n height: ", "px;\n }\n 100% {\n height: 0px;\n }\n"])), height);
|
|
19
12
|
|
|
13
|
+
const handleBorderColor = (type, {
|
|
14
|
+
colors
|
|
15
|
+
}) => {
|
|
20
16
|
switch (type) {
|
|
21
17
|
case BANNER_TYPES.SUCCESS:
|
|
22
18
|
return colors.success[900];
|
|
@@ -31,9 +27,7 @@ var handleBorderColor = function handleBorderColor(type, _ref) {
|
|
|
31
27
|
return colors.danger[900];
|
|
32
28
|
}
|
|
33
29
|
};
|
|
34
|
-
|
|
35
|
-
var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
36
|
-
|
|
30
|
+
const handleAnimation = (isAnimating, isOpen, height = null) => {
|
|
37
31
|
if (isAnimating) {
|
|
38
32
|
if (isOpen) {
|
|
39
33
|
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n animation: ", " 0.5s ease-in;\n "])), height ? spanContainer(height) : slideIn);
|
|
@@ -44,4 +38,3 @@ var handleAnimation = function handleAnimation(isAnimating, isOpen) {
|
|
|
44
38
|
};
|
|
45
39
|
|
|
46
40
|
export { handleAnimation, handleBorderColor };
|
|
47
|
-
//# sourceMappingURL=styleHelpers.js.map
|
package/package.json
CHANGED
|
@@ -1,14 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-banner",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.11",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
6
|
-
"module": "esm/index.js",
|
|
7
|
-
"main": "cjs/index.js",
|
|
5
|
+
"description": "ICE MT - Dimsum - Banner",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"main": "./cjs/index.js",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./utils/styleHelpers": {
|
|
15
|
+
"import": "./esm/utils/styleHelpers.js",
|
|
16
|
+
"require": "./cjs/utils/styleHelpers.js"
|
|
17
|
+
},
|
|
18
|
+
"./utils/icons": {
|
|
19
|
+
"import": "./esm/utils/icons.js",
|
|
20
|
+
"require": "./cjs/utils/icons.js"
|
|
21
|
+
},
|
|
22
|
+
"./utils/bannerTypes": {
|
|
23
|
+
"import": "./esm/utils/bannerTypes.js",
|
|
24
|
+
"require": "./cjs/utils/bannerTypes.js"
|
|
25
|
+
},
|
|
26
|
+
"./styles": {
|
|
27
|
+
"import": "./esm/styles.js",
|
|
28
|
+
"require": "./cjs/styles.js"
|
|
29
|
+
},
|
|
30
|
+
"./propTypes": {
|
|
31
|
+
"import": "./esm/propTypes.js",
|
|
32
|
+
"require": "./cjs/propTypes.js"
|
|
33
|
+
},
|
|
34
|
+
"./DSBanner": {
|
|
35
|
+
"import": "./esm/DSBanner.js",
|
|
36
|
+
"require": "./cjs/DSBanner.js"
|
|
37
|
+
},
|
|
38
|
+
"./defaultProps": {
|
|
39
|
+
"import": "./esm/defaultProps.js",
|
|
40
|
+
"require": "./cjs/defaultProps.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
8
43
|
"sideEffects": [
|
|
9
44
|
"*.css",
|
|
10
45
|
"*.scss"
|
|
11
46
|
],
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"npm": ">=7",
|
|
53
|
+
"node": ">=14"
|
|
54
|
+
},
|
|
55
|
+
"author": "ICE MT",
|
|
12
56
|
"scripts": {
|
|
13
57
|
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
14
58
|
"prebuild": "exit 0",
|
|
@@ -16,22 +60,21 @@
|
|
|
16
60
|
"build": "node ../../scripts/build/build.js"
|
|
17
61
|
},
|
|
18
62
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-basic": "
|
|
20
|
-
"@elliemae/ds-
|
|
21
|
-
"@elliemae/ds-system": "1.57.1",
|
|
22
|
-
"react-desc": "^4.1.2"
|
|
63
|
+
"@elliemae/ds-basic": "2.0.0-alpha.11",
|
|
64
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.11"
|
|
23
65
|
},
|
|
24
66
|
"devDependencies": {
|
|
25
|
-
"styled-components": "~5.3.
|
|
67
|
+
"styled-components": "~5.3.1"
|
|
26
68
|
},
|
|
27
69
|
"peerDependencies": {
|
|
28
|
-
"lodash": "^4.17.
|
|
29
|
-
"react": "^17.0.
|
|
30
|
-
"react-dom": "^17.0.
|
|
31
|
-
"styled-components": "^5.3.
|
|
70
|
+
"lodash": "^4.17.21",
|
|
71
|
+
"react": "^17.0.2",
|
|
72
|
+
"react-dom": "^17.0.2",
|
|
73
|
+
"styled-components": "^5.3.1"
|
|
32
74
|
},
|
|
33
75
|
"publishConfig": {
|
|
34
76
|
"access": "public",
|
|
35
|
-
"directory": "dist"
|
|
77
|
+
"directory": "dist",
|
|
78
|
+
"generateSubmodules": true
|
|
36
79
|
}
|
|
37
80
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { BannerPropsT } from './index.d';
|
|
3
|
+
declare const DSBanner: {
|
|
4
|
+
({ type, isOpen, onClose, label, body, actionLink, showCloseButton, containerProps, }: BannerPropsT): JSX.Element;
|
|
5
|
+
defaultProps: {
|
|
6
|
+
containerProps: {};
|
|
7
|
+
label: string;
|
|
8
|
+
body: string;
|
|
9
|
+
type: "info";
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
onClose: () => null;
|
|
12
|
+
showCloseButton: boolean;
|
|
13
|
+
actionLink: {
|
|
14
|
+
label: string;
|
|
15
|
+
onClick: () => null;
|
|
16
|
+
href: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
propTypes: {
|
|
20
|
+
containerProps: any;
|
|
21
|
+
label: any;
|
|
22
|
+
body: any;
|
|
23
|
+
type: any;
|
|
24
|
+
onClose: any;
|
|
25
|
+
isOpen: any;
|
|
26
|
+
showCloseButton: any;
|
|
27
|
+
actionLink: any;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
declare const DSBannerWithSchema: any;
|
|
31
|
+
export default DSBanner;
|
|
32
|
+
export { DSBannerWithSchema };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const defaultProps: {
|
|
2
|
+
containerProps: {};
|
|
3
|
+
label: string;
|
|
4
|
+
body: string;
|
|
5
|
+
type: "info";
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
onClose: () => null;
|
|
8
|
+
showCloseButton: boolean;
|
|
9
|
+
actionLink: {
|
|
10
|
+
label: string;
|
|
11
|
+
onClick: () => null;
|
|
12
|
+
href: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StyledActionLinkT, StyledBannerContainerT, StyledInnerContainerT } from './index.d';
|
|
2
|
+
export declare const StyledBannerContainer: import("styled-components").StyledComponent<"div", any, StyledBannerContainerT, never>;
|
|
3
|
+
export declare const StyledInnerContainer: import("styled-components").StyledComponent<"div", any, StyledInnerContainerT, never>;
|
|
4
|
+
export declare const StyledIconContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const StyledTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const StyledSubTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const StyledActionLink: import("styled-components").StyledComponent<"a", any, StyledActionLinkT, never>;
|
|
8
|
+
export declare const StyledCloseButton: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|