@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.
Files changed (54) hide show
  1. package/cjs/DSBanner.js +65 -75
  2. package/cjs/defaultProps.js +5 -10
  3. package/cjs/index.d.js +0 -1
  4. package/cjs/index.js +3 -18
  5. package/cjs/propTypes.js +3 -4
  6. package/cjs/styles.js +57 -79
  7. package/cjs/utils/bannerTypes.js +1 -2
  8. package/cjs/utils/icons.js +16 -9
  9. package/cjs/utils/styleHelpers.js +15 -22
  10. package/esm/DSBanner.js +60 -70
  11. package/esm/defaultProps.js +3 -8
  12. package/esm/index.d.js +0 -1
  13. package/esm/index.js +0 -15
  14. package/esm/propTypes.js +1 -2
  15. package/esm/styles.js +56 -78
  16. package/esm/utils/bannerTypes.js +1 -2
  17. package/esm/utils/icons.js +11 -8
  18. package/esm/utils/styleHelpers.js +8 -15
  19. package/package.json +57 -14
  20. package/types/DSBanner.d.ts +32 -0
  21. package/types/defaultProps.d.ts +14 -0
  22. package/types/index.d.ts +3 -0
  23. package/types/propTypes.d.ts +10 -0
  24. package/types/styles.d.ts +8 -0
  25. package/types/tests/DSBanner.events.test.d.ts +1 -0
  26. package/types/tests/DSBanner.test.d.ts +1 -0
  27. package/types/utils/bannerTypes.d.ts +6 -0
  28. package/types/utils/icons.d.ts +7 -0
  29. package/types/utils/styleHelpers.d.ts +5 -0
  30. package/DSBanner/package.json +0 -10
  31. package/cjs/DSBanner.js.map +0 -1
  32. package/cjs/defaultProps.js.map +0 -1
  33. package/cjs/index.d.js.map +0 -1
  34. package/cjs/index.js.map +0 -1
  35. package/cjs/propTypes.js.map +0 -1
  36. package/cjs/styles.js.map +0 -1
  37. package/cjs/utils/bannerTypes.js.map +0 -1
  38. package/cjs/utils/icons.js.map +0 -1
  39. package/cjs/utils/styleHelpers.js.map +0 -1
  40. package/defaultProps/package.json +0 -10
  41. package/esm/DSBanner.js.map +0 -1
  42. package/esm/defaultProps.js.map +0 -1
  43. package/esm/index.d.js.map +0 -1
  44. package/esm/index.js.map +0 -1
  45. package/esm/propTypes.js.map +0 -1
  46. package/esm/styles.js.map +0 -1
  47. package/esm/utils/bannerTypes.js.map +0 -1
  48. package/esm/utils/icons.js.map +0 -1
  49. package/esm/utils/styleHelpers.js.map +0 -1
  50. package/propTypes/package.json +0 -10
  51. package/styles/package.json +0 -10
  52. package/utils/bannerTypes/package.json +0 -10
  53. package/utils/icons/package.json +0 -10
  54. package/utils/styleHelpers/package.json +0 -10
package/esm/DSBanner.js CHANGED
@@ -1,103 +1,93 @@
1
- import _extends from '@babel/runtime/helpers/esm/extends';
2
- import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
3
- import React, { useRef, useState, useEffect, useLayoutEffect, useCallback } from 'react';
4
- import { CloseX } from '@elliemae/ds-icons';
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 './utils/bannerTypes.js';
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 DSBanner = function DSBanner(_ref) {
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
- var _useState = useState(isOpen),
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
- var _useState3 = useState(false),
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
- var _useState5 = useState(0),
40
- _useState6 = _slicedToArray(_useState5, 2),
41
- height = _useState6[0],
42
- setHeight = _useState6[1];
43
-
44
- useEffect(function () {
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(function () {
39
+ useLayoutEffect(() => {
50
40
  if (isOpen !== current || isOpen) setIsAnimating(true);else setIsAnimating(false);
51
41
  }, [isOpen, current]);
52
- var handleOnKeyDown = useCallback(function (e) {
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__*/React.createElement(StyledBannerContainer, _extends({
49
+ return /*#__PURE__*/jsx(StyledBannerContainer, _objectSpread(_objectSpread({
60
50
  type: type,
61
51
  isOpen: isOpen,
62
52
  isAnimating: isAnimating,
63
- onAnimationEnd: function onAnimationEnd() {
64
- return setCurrent(isOpen);
65
- },
53
+ onAnimationEnd: () => setCurrent(isOpen),
66
54
  height: height,
67
55
  "data-testid": "ds-banner-container"
68
- }, containerProps), /*#__PURE__*/React.createElement(StyledInnerContainer, {
69
- type: type,
70
- isOpen: isOpen,
71
- ref: innerContainerRef,
72
- isAnimating: isAnimating,
73
- "data-testid": "ds-banner",
74
- role: "alert"
75
- }, /*#__PURE__*/React.createElement(StyledIconContainer, {
76
- "data-testid": "ds-banner-icon"
77
- }, icons[type]), /*#__PURE__*/React.createElement(StyledTitle, null, label), /*#__PURE__*/React.createElement(StyledSubTitle, null, /*#__PURE__*/React.createElement("span", null, body), actionLink && /*#__PURE__*/React.createElement(StyledActionLink, {
78
- "data-testid": "ds-banner-action-link",
79
- onClick: actionLink.onClick,
80
- href: actionLink.href,
81
- ref: linkRef,
82
- onKeyDown: handleOnKeyDown,
83
- tabIndex: 0,
84
- isBodyEmpty: body
85
- }, actionLink.label)), showCloseButton && /*#__PURE__*/React.createElement(StyledCloseButton, {
86
- "data-testid": "ds-banner-close-button",
87
- buttonType: "secondary",
88
- onClick: onClose,
89
- "aria-label": "Close icon",
90
- icon: /*#__PURE__*/React.createElement(CloseX, {
91
- width: "12px",
92
- height: "12px"
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
- DSBanner.propTypes = propTypes;
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
@@ -1,23 +1,18 @@
1
1
  import { BANNER_TYPES } from './utils/bannerTypes.js';
2
2
 
3
- var defaultProps = {
3
+ const defaultProps = {
4
4
  containerProps: {},
5
5
  label: '',
6
6
  body: '',
7
7
  type: BANNER_TYPES.INFO,
8
8
  isOpen: true,
9
- onClose: function onClose() {
10
- return null;
11
- },
9
+ onClose: () => null,
12
10
  showCloseButton: true,
13
11
  actionLink: {
14
12
  label: '',
15
- onClick: function 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
@@ -1,2 +1 @@
1
1
 
2
- //# sourceMappingURL=index.d.js.map
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
- var propTypes = {
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-button';
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
- var StyledBannerContainer = /*#__PURE__*/styled.div.withConfig({
5
+ const StyledBannerContainer = /*#__PURE__*/styled.div.withConfig({
9
6
  componentId: "sc-ffu2hq-0"
10
- })(["overflow:hidden;height:", ";", ";"], function (_ref) {
11
- var isOpen = _ref.isOpen;
12
- return isOpen ? 'auto' : '0px';
13
- }, function (_ref2) {
14
- var isAnimating = _ref2.isAnimating,
15
- isOpen = _ref2.isOpen,
16
- height = _ref2.height;
17
- return handleAnimation(isAnimating, isOpen, height);
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 ", ";", ";"], function (_ref3) {
22
- var theme = _ref3.theme;
23
- return theme.colors.neutral['000'];
24
- }, function (_ref4) {
25
- var type = _ref4.type,
26
- theme = _ref4.theme;
27
- return handleBorderColor(type, theme);
28
- }, function (_ref5) {
29
- var isAnimating = _ref5.isAnimating,
30
- isOpen = _ref5.isOpen;
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:", ";"], function (_ref6) {
36
- var theme = _ref6.theme;
37
- return theme.space.xxs;
38
- }, function (_ref7) {
39
- var theme = _ref7.theme;
40
- return theme.space.xs;
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;"], function (_ref8) {
45
- var theme = _ref8.theme;
46
- return theme.colors.neutral[700];
47
- }, function (_ref9) {
48
- var theme = _ref9.theme;
49
- return theme.fontSizes.label[400];
50
- }, function (_ref10) {
51
- var theme = _ref10.theme;
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:", ";"], function (_ref11) {
57
- var theme = _ref11.theme;
58
- return theme.space.xs;
59
- }, function (_ref12) {
60
- var theme = _ref12.theme;
61
- return theme.fontSizes.subTitle[400];
62
- }, function (_ref13) {
63
- var theme = _ref13.theme;
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:", ";"], function (_ref14) {
69
- var theme = _ref14.theme,
70
- isBodyEmpty = _ref14.isBodyEmpty;
71
- return isBodyEmpty ? theme.space.xs : 0;
72
- }, function (_ref15) {
73
- var theme = _ref15.theme;
74
- return theme.fontSizes.hyperlink[400];
75
- }, function (_ref16) {
76
- var theme = _ref16.theme;
77
- return theme.fontWeights.regular;
78
- }, function (_ref17) {
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;}"], function (_ref18) {
85
- var theme = _ref18.theme;
86
- return theme.space.s;
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
@@ -1,4 +1,4 @@
1
- var BANNER_TYPES = {
1
+ const BANNER_TYPES = {
2
2
  INFO: 'info',
3
3
  SUCCESS: 'success',
4
4
  WARNING: 'warning',
@@ -6,4 +6,3 @@ var BANNER_TYPES = {
6
6
  };
7
7
 
8
8
  export { BANNER_TYPES };
9
- //# sourceMappingURL=bannerTypes.js.map
@@ -1,23 +1,27 @@
1
- import React from 'react';
2
- import { SuccessFill, InfoFill, AlertsDetailFill, WarningSquare } from '@elliemae/ds-icons';
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
- var icons = {
5
- success: /*#__PURE__*/React.createElement(SuccessFill, {
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__*/React.createElement(InfoFill, {
14
+ info: /*#__PURE__*/_jsx(InfoFill, {
11
15
  fill: "#1e79c2",
12
16
  width: "20px",
13
17
  height: "20px"
14
18
  }),
15
- danger: /*#__PURE__*/React.createElement(AlertsDetailFill, {
19
+ danger: /*#__PURE__*/_jsx(AlertsDetailFill, {
16
20
  fill: "#c64252",
17
21
  width: "20px",
18
22
  height: "20px"
19
23
  }),
20
- warning: /*#__PURE__*/React.createElement(WarningSquare, {
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
- var 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
- var 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"])));
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
- var spanContainer = function spanContainer(height) {
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
- var handleBorderColor = function handleBorderColor(type, _ref) {
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
- var handleAnimation = function handleAnimation(isAnimating, isOpen) {
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": "1.57.1",
3
+ "version": "2.0.0-alpha.11",
4
4
  "license": "MIT",
5
- "description": "Ellie Mae - Dim Sum - Banner",
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": "1.57.1",
20
- "@elliemae/ds-icons": "1.57.1",
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.0"
67
+ "styled-components": "~5.3.1"
26
68
  },
27
69
  "peerDependencies": {
28
- "lodash": "^4.17.20",
29
- "react": "^17.0.1",
30
- "react-dom": "^17.0.1",
31
- "styled-components": "^5.3.0"
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
+ };
@@ -0,0 +1,3 @@
1
+ export { default } from './DSBanner';
2
+ export * from './DSBanner';
3
+ export * from './utils/bannerTypes';
@@ -0,0 +1,10 @@
1
+ export declare const propTypes: {
2
+ containerProps: any;
3
+ label: any;
4
+ body: any;
5
+ type: any;
6
+ onClose: any;
7
+ isOpen: any;
8
+ showCloseButton: any;
9
+ actionLink: any;
10
+ };
@@ -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 {};