@elliemae/ds-banner 2.2.0-alpha.3 → 3.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSBanner.js +107 -113
- package/cjs/defaultProps.js +16 -39
- package/cjs/index.d.js +2 -27
- package/cjs/index.js +12 -37
- package/cjs/propTypes.js +22 -53
- package/cjs/styles.js +145 -106
- package/cjs/utils/bannerTypes.js +10 -38
- package/cjs/utils/icons.js +18 -40
- package/cjs/utils/styleHelpers.js +40 -86
- package/esm/DSBanner.js +88 -84
- package/esm/defaultProps.js +11 -9
- package/esm/index.d.js +1 -2
- package/esm/index.js +2 -8
- package/esm/propTypes.js +14 -20
- package/esm/styles.js +131 -78
- package/esm/utils/bannerTypes.js +6 -9
- package/esm/utils/icons.js +10 -11
- package/esm/utils/styleHelpers.js +27 -53
- package/package.json +4 -4
- package/types/DSBanner.d.ts +1 -1
- package/cjs/DSBanner.js.map +0 -7
- package/cjs/defaultProps.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/propTypes.js.map +0 -7
- package/cjs/styles.js.map +0 -7
- package/cjs/utils/bannerTypes.js.map +0 -7
- package/cjs/utils/icons.js.map +0 -7
- package/cjs/utils/styleHelpers.js.map +0 -7
- package/esm/DSBanner.js.map +0 -7
- package/esm/defaultProps.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/propTypes.js.map +0 -7
- package/esm/styles.js.map +0 -7
- package/esm/utils/bannerTypes.js.map +0 -7
- package/esm/utils/icons.js.map +0 -7
- package/esm/utils/styleHelpers.js.map +0 -7
package/cjs/DSBanner.js
CHANGED
|
@@ -1,62 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
13
|
+
var React = require('react');
|
|
14
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
15
|
+
var reactDesc = require('react-desc');
|
|
16
|
+
var icons = require('./utils/icons.js');
|
|
17
|
+
var propTypes = require('./propTypes.js');
|
|
18
|
+
var defaultProps = require('./defaultProps.js');
|
|
19
|
+
var styles = require('./styles.js');
|
|
20
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
21
|
+
|
|
22
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
+
|
|
24
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
25
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
26
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
27
|
+
|
|
28
|
+
var _CloseX, _span;
|
|
29
|
+
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
33
|
+
|
|
34
|
+
const DSBanner = _ref => {
|
|
35
|
+
let {
|
|
36
|
+
type,
|
|
37
|
+
isOpen,
|
|
38
|
+
onClose,
|
|
39
|
+
label,
|
|
40
|
+
body,
|
|
41
|
+
actionLink,
|
|
42
|
+
showCloseButton,
|
|
43
|
+
containerProps,
|
|
44
|
+
actionRef
|
|
45
|
+
} = _ref;
|
|
46
|
+
const innerContainerRef = React.useRef(null);
|
|
47
|
+
const linkRef = React.useRef(null);
|
|
48
|
+
const [current, setCurrent] = React.useState(isOpen);
|
|
49
|
+
const [isAnimating, setIsAnimating] = React.useState(false);
|
|
50
|
+
const [alertTabIndex, setAlertTabIndex] = React.useState(undefined);
|
|
51
|
+
const ownerState = {
|
|
52
|
+
type
|
|
26
53
|
};
|
|
27
|
-
|
|
28
|
-
var DSBanner_exports = {};
|
|
29
|
-
__export(DSBanner_exports, {
|
|
30
|
-
DSBanner: () => DSBanner,
|
|
31
|
-
DSBannerWithSchema: () => DSBannerWithSchema,
|
|
32
|
-
default: () => DSBanner_default
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_ds_icons = __toESM(require("@elliemae/ds-icons"));
|
|
37
|
-
var import_react_desc = __toESM(require("react-desc"));
|
|
38
|
-
var import_icons = __toESM(require("./utils/icons"));
|
|
39
|
-
var import_propTypes = __toESM(require("./propTypes"));
|
|
40
|
-
var import_defaultProps = __toESM(require("./defaultProps"));
|
|
41
|
-
var import_styles = __toESM(require("./styles"));
|
|
42
|
-
const DSBanner = ({
|
|
43
|
-
type,
|
|
44
|
-
isOpen,
|
|
45
|
-
onClose,
|
|
46
|
-
label,
|
|
47
|
-
body,
|
|
48
|
-
actionLink,
|
|
49
|
-
showCloseButton,
|
|
50
|
-
containerProps,
|
|
51
|
-
actionRef
|
|
52
|
-
}) => {
|
|
53
|
-
const innerContainerRef = (0, import_react.useRef)(null);
|
|
54
|
-
const linkRef = (0, import_react.useRef)(null);
|
|
55
|
-
const [current, setCurrent] = (0, import_react.useState)(isOpen);
|
|
56
|
-
const [isAnimating, setIsAnimating] = (0, import_react.useState)(false);
|
|
57
|
-
const [alertTabIndex, setAlertTabIndex] = (0, import_react.useState)(void 0);
|
|
58
|
-
const ownerState = { type };
|
|
59
|
-
import_react.default.useEffect(() => {
|
|
54
|
+
React__default["default"].useEffect(() => {
|
|
60
55
|
if (actionRef && actionRef.current) {
|
|
61
56
|
actionRef.current.focusOnWrapper = () => {
|
|
62
57
|
if (innerContainerRef.current) {
|
|
@@ -66,6 +61,7 @@ const DSBanner = ({
|
|
|
66
61
|
}, 100);
|
|
67
62
|
}
|
|
68
63
|
};
|
|
64
|
+
|
|
69
65
|
actionRef.current.focusOnLink = () => {
|
|
70
66
|
if (linkRef.current) {
|
|
71
67
|
linkRef.current.focus();
|
|
@@ -73,66 +69,64 @@ const DSBanner = ({
|
|
|
73
69
|
};
|
|
74
70
|
}
|
|
75
71
|
}, [actionRef]);
|
|
76
|
-
|
|
77
|
-
if (isOpen !== current || isOpen)
|
|
78
|
-
setIsAnimating(true);
|
|
79
|
-
else
|
|
80
|
-
setIsAnimating(false);
|
|
72
|
+
React.useLayoutEffect(() => {
|
|
73
|
+
if (isOpen !== current || isOpen) setIsAnimating(true);else setIsAnimating(false);
|
|
81
74
|
}, [isOpen, current]);
|
|
82
|
-
const handleBlur =
|
|
83
|
-
setAlertTabIndex(
|
|
75
|
+
const handleBlur = React.useCallback(() => {
|
|
76
|
+
setAlertTabIndex(undefined);
|
|
84
77
|
}, []);
|
|
85
|
-
const handleOnKeyDown =
|
|
86
|
-
if (e.key ===
|
|
78
|
+
const handleOnKeyDown = React.useCallback(e => {
|
|
79
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
87
80
|
e.preventDefault();
|
|
88
|
-
if (linkRef.current)
|
|
89
|
-
linkRef.current.click();
|
|
81
|
+
if (linkRef.current) linkRef.current.click();
|
|
90
82
|
}
|
|
91
83
|
}, []);
|
|
92
|
-
if (!isAnimating && !isOpen)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
isAnimating,
|
|
84
|
+
if (!isAnimating && !isOpen) return null;
|
|
85
|
+
return /*#__PURE__*/jsxRuntime.jsx(styles.StyledBannerContainer, _objectSpread(_objectSpread({
|
|
86
|
+
type: type,
|
|
87
|
+
isOpen: isOpen,
|
|
88
|
+
isAnimating: isAnimating,
|
|
98
89
|
onAnimationEnd: () => setCurrent(isOpen),
|
|
99
|
-
"data-testid": "ds-banner-container"
|
|
100
|
-
|
|
101
|
-
ownerState
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
90
|
+
"data-testid": "ds-banner-container"
|
|
91
|
+
}, containerProps), {}, {
|
|
92
|
+
ownerState: ownerState,
|
|
93
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(styles.StyledInnerContainer, {
|
|
94
|
+
type: type,
|
|
95
|
+
isOpen: isOpen,
|
|
96
|
+
ref: innerContainerRef,
|
|
97
|
+
isAnimating: isAnimating,
|
|
98
|
+
"data-testid": "ds-banner",
|
|
99
|
+
role: "alert",
|
|
100
|
+
tabIndex: alertTabIndex,
|
|
101
|
+
onBlur: handleBlur,
|
|
102
|
+
children: [/*#__PURE__*/_jsx__default["default"](styles.StyledIconContainer, {
|
|
103
|
+
"data-testid": "ds-banner-icon"
|
|
104
|
+
}, void 0, icons.icons[type]), /*#__PURE__*/_jsx__default["default"](styles.StyledTitle, {}, void 0, label), /*#__PURE__*/_jsx__default["default"](styles.StyledSubTitle, {}, void 0, /*#__PURE__*/_jsx__default["default"]("span", {}, void 0, body), actionLink && /*#__PURE__*/jsxRuntime.jsx(styles.StyledActionLink, {
|
|
105
|
+
"data-testid": "ds-banner-action-link",
|
|
106
|
+
onClick: actionLink.onClick,
|
|
107
|
+
href: actionLink.href,
|
|
108
|
+
ref: linkRef,
|
|
109
|
+
onKeyDown: handleOnKeyDown,
|
|
110
|
+
tabIndex: 0,
|
|
111
|
+
isBodyEmpty: body,
|
|
112
|
+
children: actionLink.label
|
|
113
|
+
})), showCloseButton ? /*#__PURE__*/_jsx__default["default"](styles.StyledCloseButton, {
|
|
114
|
+
"data-testid": "ds-banner-close-button",
|
|
115
|
+
buttonType: "secondary",
|
|
116
|
+
onClick: onClose,
|
|
117
|
+
"aria-label": "Close icon",
|
|
118
|
+
icon: _CloseX || (_CloseX = /*#__PURE__*/_jsx__default["default"](dsIcons.CloseX, {
|
|
119
|
+
width: "12px",
|
|
120
|
+
height: "12px"
|
|
121
|
+
}))
|
|
122
|
+
}) : _span || (_span = /*#__PURE__*/_jsx__default["default"]("span", {}))]
|
|
129
123
|
})
|
|
130
|
-
})
|
|
124
|
+
}));
|
|
131
125
|
};
|
|
132
|
-
|
|
133
|
-
DSBanner.
|
|
134
|
-
const DSBannerWithSchema =
|
|
135
|
-
DSBannerWithSchema.propTypes =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
126
|
+
|
|
127
|
+
DSBanner.defaultProps = defaultProps.defaultProps;
|
|
128
|
+
const DSBannerWithSchema = reactDesc.describe(DSBanner);
|
|
129
|
+
DSBannerWithSchema.propTypes = propTypes.propTypes;
|
|
130
|
+
|
|
131
|
+
exports.DSBannerWithSchema = DSBannerWithSchema;
|
|
132
|
+
exports["default"] = DSBanner;
|
package/cjs/defaultProps.js
CHANGED
|
@@ -1,45 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var defaultProps_exports = {};
|
|
29
|
-
__export(defaultProps_exports, {
|
|
30
|
-
defaultProps: () => defaultProps
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_bannerTypes = __toESM(require("./utils/bannerTypes"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var bannerTypes = require('./utils/bannerTypes.js');
|
|
6
|
+
|
|
34
7
|
const defaultProps = {
|
|
35
8
|
containerProps: {},
|
|
36
|
-
label:
|
|
37
|
-
body:
|
|
38
|
-
type:
|
|
9
|
+
label: '',
|
|
10
|
+
body: '',
|
|
11
|
+
type: bannerTypes.BANNER_TYPES.INFO,
|
|
39
12
|
isOpen: true,
|
|
40
13
|
onClose: () => null,
|
|
41
14
|
showCloseButton: true,
|
|
42
|
-
actionLink: {
|
|
15
|
+
actionLink: {
|
|
16
|
+
label: '',
|
|
17
|
+
onClick: () => null,
|
|
18
|
+
href: ''
|
|
19
|
+
}
|
|
43
20
|
};
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
|
|
22
|
+
exports.defaultProps = defaultProps;
|
package/cjs/index.d.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var index_d_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
module.exports = __toCommonJS(index_d_exports);
|
|
27
|
-
//# sourceMappingURL=index.d.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
package/cjs/index.js
CHANGED
|
@@ -1,37 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var src_exports = {};
|
|
29
|
-
__export(src_exports, {
|
|
30
|
-
default: () => import_DSBanner.default
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_DSBanner = __toESM(require("./DSBanner"));
|
|
34
|
-
__reExport(src_exports, __toESM(require("./DSBanner")));
|
|
35
|
-
__reExport(src_exports, __toESM(require("./utils/bannerTypes")));
|
|
36
|
-
module.exports = __toCommonJS(src_exports);
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var DSBanner = require('./DSBanner.js');
|
|
6
|
+
var bannerTypes = require('./utils/bannerTypes.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.DSBannerWithSchema = DSBanner.DSBannerWithSchema;
|
|
11
|
+
exports["default"] = DSBanner["default"];
|
|
12
|
+
exports.BANNER_TYPES = bannerTypes.BANNER_TYPES;
|
package/cjs/propTypes.js
CHANGED
|
@@ -1,55 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var propTypes_exports = {};
|
|
29
|
-
__export(propTypes_exports, {
|
|
30
|
-
propTypes: () => propTypes
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react_desc = __toESM(require("react-desc"));
|
|
34
|
-
var import_bannerTypes = __toESM(require("./utils/bannerTypes"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactDesc = require('react-desc');
|
|
6
|
+
var bannerTypes = require('./utils/bannerTypes.js');
|
|
7
|
+
|
|
35
8
|
const propTypes = {
|
|
36
|
-
containerProps:
|
|
37
|
-
label:
|
|
38
|
-
body:
|
|
39
|
-
type:
|
|
40
|
-
onClose:
|
|
41
|
-
isOpen:
|
|
42
|
-
showCloseButton:
|
|
43
|
-
actionLink:
|
|
44
|
-
label:
|
|
45
|
-
onClick:
|
|
46
|
-
href:
|
|
47
|
-
}).description(
|
|
48
|
-
actionRef:
|
|
49
|
-
Reference to use actions:
|
|
50
|
-
- focusOnLink: function to focus the banner
|
|
51
|
-
- focusOnWrapper: function to focus the link
|
|
52
|
-
`).defaultValue({})
|
|
9
|
+
containerProps: reactDesc.PropTypes.object.description('Set of Properties attached to the main container').defaultValue({}),
|
|
10
|
+
label: reactDesc.PropTypes.string.description('banner s label').defaultValue(''),
|
|
11
|
+
body: reactDesc.PropTypes.string.description('banner s body content').defaultValue(''),
|
|
12
|
+
type: reactDesc.PropTypes.oneOf(Object.values(bannerTypes.BANNER_TYPES)).description('banner s type').defaultValue(bannerTypes.BANNER_TYPES.INFO),
|
|
13
|
+
onClose: reactDesc.PropTypes.func.description('function executed when the banner closes'),
|
|
14
|
+
isOpen: reactDesc.PropTypes.bool.description('whether the banner is open or closed').defaultValue(true),
|
|
15
|
+
showCloseButton: reactDesc.PropTypes.bool.description('whether to show close button or not').defaultValue(true),
|
|
16
|
+
actionLink: reactDesc.PropTypes.shape({
|
|
17
|
+
label: reactDesc.PropTypes.string,
|
|
18
|
+
onClick: reactDesc.PropTypes.func,
|
|
19
|
+
href: reactDesc.PropTypes.string
|
|
20
|
+
}).description('Properties of the ActionLink component').defaultValue({}),
|
|
21
|
+
actionRef: reactDesc.PropTypes.object.description("\n Reference to use actions:\n - focusOnLink: function to focus the banner\n - focusOnWrapper: function to focus the link\n ").defaultValue({})
|
|
53
22
|
};
|
|
54
|
-
|
|
55
|
-
|
|
23
|
+
|
|
24
|
+
exports.propTypes = propTypes;
|