@elliemae/ds-banner 3.0.0-next.8 → 3.0.0-rc.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.
Files changed (58) hide show
  1. package/dist/cjs/DSBanner.js +60 -61
  2. package/dist/cjs/DSBanner.js.map +2 -2
  3. package/dist/cjs/exported-related/DSBannerDatatestid.js +34 -0
  4. package/dist/cjs/exported-related/DSBannerDatatestid.js.map +7 -0
  5. package/dist/cjs/exported-related/bannerTypes.js +33 -0
  6. package/dist/cjs/exported-related/bannerTypes.js.map +7 -0
  7. package/dist/cjs/exported-related/index.js +24 -0
  8. package/dist/cjs/exported-related/index.js.map +7 -0
  9. package/dist/cjs/exported-related/theming.js +38 -0
  10. package/dist/cjs/exported-related/theming.js.map +7 -0
  11. package/dist/cjs/index.js +12 -18
  12. package/dist/cjs/index.js.map +3 -3
  13. package/dist/cjs/react-desc-prop-types.js +77 -0
  14. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  15. package/dist/cjs/sharedTypes.js +20 -0
  16. package/dist/cjs/sharedTypes.js.map +7 -0
  17. package/dist/cjs/styles.js +33 -28
  18. package/dist/cjs/styles.js.map +2 -2
  19. package/dist/cjs/utils/icons.js +13 -20
  20. package/dist/cjs/utils/icons.js.map +2 -2
  21. package/dist/cjs/utils/styleHelpers.js +15 -21
  22. package/dist/cjs/utils/styleHelpers.js.map +2 -2
  23. package/dist/esm/DSBanner.js +51 -45
  24. package/dist/esm/DSBanner.js.map +2 -2
  25. package/dist/esm/exported-related/DSBannerDatatestid.js +12 -0
  26. package/dist/esm/exported-related/DSBannerDatatestid.js.map +7 -0
  27. package/dist/esm/{utils → exported-related}/bannerTypes.js +0 -0
  28. package/dist/esm/{utils → exported-related}/bannerTypes.js.map +2 -2
  29. package/dist/esm/exported-related/index.js +5 -0
  30. package/dist/esm/exported-related/index.js.map +7 -0
  31. package/dist/esm/exported-related/theming.js +16 -0
  32. package/dist/esm/exported-related/theming.js.map +7 -0
  33. package/dist/esm/index.js +1 -1
  34. package/dist/esm/index.js.map +2 -2
  35. package/dist/esm/react-desc-prop-types.js +57 -0
  36. package/dist/esm/react-desc-prop-types.js.map +7 -0
  37. package/dist/esm/sharedTypes.js +2 -0
  38. package/dist/esm/{index.d.js.map → sharedTypes.js.map} +0 -0
  39. package/dist/esm/styles.js +25 -13
  40. package/dist/esm/styles.js.map +2 -2
  41. package/dist/esm/utils/icons.js +4 -4
  42. package/dist/esm/utils/icons.js.map +2 -2
  43. package/dist/esm/utils/styleHelpers.js +2 -1
  44. package/dist/esm/utils/styleHelpers.js.map +2 -2
  45. package/package.json +13 -12
  46. package/dist/cjs/defaultProps.js +0 -45
  47. package/dist/cjs/defaultProps.js.map +0 -7
  48. package/dist/cjs/index.d.js +0 -27
  49. package/dist/cjs/index.d.js.map +0 -7
  50. package/dist/cjs/propTypes.js +0 -55
  51. package/dist/cjs/propTypes.js.map +0 -7
  52. package/dist/cjs/utils/bannerTypes.js +0 -40
  53. package/dist/cjs/utils/bannerTypes.js.map +0 -7
  54. package/dist/esm/defaultProps.js +0 -16
  55. package/dist/esm/defaultProps.js.map +0 -7
  56. package/dist/esm/index.d.js +0 -2
  57. package/dist/esm/propTypes.js +0 -26
  58. package/dist/esm/propTypes.js.map +0 -7
@@ -1,8 +1,6 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
5
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
6
  var __getProtoOf = Object.getPrototypeOf;
@@ -20,67 +18,72 @@ var __spreadValues = (a, b) => {
20
18
  }
21
19
  return a;
22
20
  };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
21
+ var __objRest = (source, exclude) => {
22
+ var target = {};
23
+ for (var prop in source)
24
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
+ target[prop] = source[prop];
26
+ if (source != null && __getOwnPropSymbols)
27
+ for (var prop of __getOwnPropSymbols(source)) {
28
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
+ target[prop] = source[prop];
30
+ }
31
+ return target;
32
+ };
25
33
  var __export = (target, all) => {
26
34
  for (var name in all)
27
35
  __defProp(target, name, { get: all[name], enumerable: true });
28
36
  };
29
- var __reExport = (target, module2, copyDefault, desc) => {
30
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
31
- for (let key of __getOwnPropNames(module2))
32
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
33
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
37
+ var __copyProps = (to, from, except, desc) => {
38
+ if (from && typeof from === "object" || typeof from === "function") {
39
+ for (let key of __getOwnPropNames(from))
40
+ if (!__hasOwnProp.call(to, key) && key !== except)
41
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
42
  }
35
- return target;
36
- };
37
- var __toESM = (module2, isNodeMode) => {
38
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
43
+ return to;
39
44
  };
40
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
41
- return (module2, temp) => {
42
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
43
- };
44
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
45
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
46
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45
47
  var DSBanner_exports = {};
46
48
  __export(DSBanner_exports, {
47
49
  DSBanner: () => DSBanner,
48
50
  DSBannerWithSchema: () => DSBannerWithSchema,
49
51
  default: () => DSBanner_default
50
52
  });
53
+ module.exports = __toCommonJS(DSBanner_exports);
51
54
  var React = __toESM(require("react"));
52
55
  var import_react = __toESM(require("react"));
56
+ var import_ds_utilities = require("@elliemae/ds-utilities");
53
57
  var import_ds_icons = require("@elliemae/ds-icons");
54
58
  var import_react_desc = require("react-desc");
55
59
  var import_icons = require("./utils/icons");
56
- var import_propTypes = require("./propTypes");
57
- var import_defaultProps = require("./defaultProps");
60
+ var import_react_desc_prop_types = require("./react-desc-prop-types");
61
+ var import_exported_related = require("./exported-related");
58
62
  var import_styles = require("./styles");
59
- const DSBanner = ({
60
- type,
61
- isOpen,
62
- onClose,
63
- label,
64
- body,
65
- actionLink,
66
- showCloseButton,
67
- containerProps,
68
- actionRef
69
- }) => {
63
+ const DSBanner = (props) => {
64
+ const propsWithDefaults = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
65
+ const _a = propsWithDefaults, { type, isOpen, onClose, label, body, actionLink, showCloseButton, containerProps, actionRef } = _a, rest = __objRest(_a, ["type", "isOpen", "onClose", "label", "body", "actionLink", "showCloseButton", "containerProps", "actionRef"]);
66
+ const globalAttrs = (0, import_ds_utilities.useGetGlobalAttributes)(rest);
67
+ const xstyledAttrs = (0, import_ds_utilities.useGetXstyledProps)(rest);
70
68
  const innerContainerRef = (0, import_react.useRef)(null);
71
69
  const linkRef = (0, import_react.useRef)(null);
72
70
  const [current, setCurrent] = (0, import_react.useState)(isOpen);
73
71
  const [isAnimating, setIsAnimating] = (0, import_react.useState)(false);
72
+ const [height, setHeight] = (0, import_react.useState)(0);
74
73
  const [alertTabIndex, setAlertTabIndex] = (0, import_react.useState)(void 0);
75
- const ownerState = { type };
76
- import_react.default.useEffect(() => {
74
+ (0, import_react.useEffect)(() => {
75
+ if (innerContainerRef.current) {
76
+ setHeight(innerContainerRef.current.offsetHeight);
77
+ }
78
+ }, [isAnimating, isOpen]);
79
+ (0, import_react.useEffect)(() => {
77
80
  if (actionRef && actionRef.current) {
78
81
  actionRef.current.focusOnWrapper = () => {
79
82
  if (innerContainerRef.current) {
80
83
  setAlertTabIndex(0);
81
84
  setTimeout(() => {
82
- innerContainerRef.current.focus();
83
- }, 100);
85
+ innerContainerRef.current?.focus();
86
+ }, 300);
84
87
  }
85
88
  };
86
89
  actionRef.current.focusOnLink = () => {
@@ -90,12 +93,6 @@ const DSBanner = ({
90
93
  };
91
94
  }
92
95
  }, [actionRef]);
93
- (0, import_react.useLayoutEffect)(() => {
94
- if (isOpen !== current || isOpen)
95
- setIsAnimating(true);
96
- else
97
- setIsAnimating(false);
98
- }, [isOpen, current]);
99
96
  const handleBlur = (0, import_react.useCallback)(() => {
100
97
  setAlertTabIndex(void 0);
101
98
  }, []);
@@ -106,29 +103,34 @@ const DSBanner = ({
106
103
  linkRef.current.click();
107
104
  }
108
105
  }, []);
106
+ (0, import_react.useLayoutEffect)(() => {
107
+ if (isOpen !== current || isOpen)
108
+ setIsAnimating(true);
109
+ else
110
+ setIsAnimating(false);
111
+ }, [isOpen, current]);
109
112
  if (!isAnimating && !isOpen)
110
113
  return null;
111
- return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledBannerContainer, __spreadProps(__spreadValues({
114
+ return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledBannerContainer, __spreadValues(__spreadValues(__spreadValues({
112
115
  type,
113
116
  isOpen,
117
+ height,
114
118
  isAnimating,
115
119
  onAnimationEnd: () => setCurrent(isOpen),
116
- "data-testid": "ds-banner-container"
117
- }, containerProps), {
118
- ownerState
119
- }), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledInnerContainer, {
120
+ "data-testid": import_exported_related.DSBannerDatatestid.CONTAINER
121
+ }, containerProps), globalAttrs), xstyledAttrs), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledInnerContainer, {
120
122
  type,
121
123
  isOpen,
122
124
  ref: innerContainerRef,
123
125
  isAnimating,
124
- "data-testid": "ds-banner",
126
+ "data-testid": import_exported_related.DSBannerDatatestid.INNER_CONTAINER,
125
127
  role: "alert",
126
128
  tabIndex: alertTabIndex,
127
129
  onBlur: handleBlur
128
130
  }, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledIconContainer, {
129
- "data-testid": "ds-banner-icon"
131
+ "data-testid": import_exported_related.DSBannerDatatestid.ICON_CONTAINER
130
132
  }, import_icons.icons[type]), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledTitle, null, label), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledSubTitle, null, /* @__PURE__ */ import_react.default.createElement("span", null, body), actionLink && /* @__PURE__ */ import_react.default.createElement(import_styles.StyledActionLink, {
131
- "data-testid": "ds-banner-action-link",
133
+ "data-testid": import_exported_related.DSBannerDatatestid.ACTION_LINK,
132
134
  onClick: actionLink.onClick,
133
135
  href: actionLink.href,
134
136
  ref: linkRef,
@@ -136,20 +138,17 @@ const DSBanner = ({
136
138
  tabIndex: 0,
137
139
  isBodyEmpty: body
138
140
  }, actionLink.label)), showCloseButton ? /* @__PURE__ */ import_react.default.createElement(import_styles.StyledCloseButton, {
139
- "data-testid": "ds-banner-close-button",
140
- buttonType: "secondary",
141
+ "data-testid": import_exported_related.DSBannerDatatestid.CLOSE_BUTTON,
142
+ buttonType: "icon",
141
143
  onClick: onClose,
142
- "aria-label": "Close icon",
143
- icon: /* @__PURE__ */ import_react.default.createElement(import_ds_icons.CloseX, {
144
- width: "12px",
145
- height: "12px"
146
- })
147
- }) : /* @__PURE__ */ import_react.default.createElement("span", null)));
144
+ "aria-label": "Close icon"
145
+ }, /* @__PURE__ */ import_react.default.createElement(import_ds_icons.CloseX, {
146
+ width: 12,
147
+ height: 12
148
+ })) : /* @__PURE__ */ import_react.default.createElement("span", null)));
148
149
  };
149
- DSBanner.defaultProps = import_defaultProps.defaultProps;
150
- DSBanner.propTypes = import_propTypes.propTypes;
150
+ DSBanner.displayName = "DSBanner";
151
151
  const DSBannerWithSchema = (0, import_react_desc.describe)(DSBanner);
152
- DSBannerWithSchema.propTypes = import_propTypes.propTypes;
152
+ DSBannerWithSchema.propTypes = import_react_desc_prop_types.propTypes;
153
153
  var DSBanner_default = DSBanner;
154
- module.exports = __toCommonJS(DSBanner_exports);
155
154
  //# sourceMappingURL=DSBanner.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSBanner.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useLayoutEffect, useRef, useCallback, useState } from 'react';\nimport { CloseX } from '@elliemae/ds-icons';\nimport { describe } from 'react-desc';\nimport type { BannerPropsT } from './index.d';\nimport { icons } from './utils/icons';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport {\n StyledActionLink,\n StyledCloseButton,\n StyledInnerContainer,\n StyledBannerContainer,\n StyledIconContainer,\n StyledSubTitle,\n StyledTitle,\n} from './styles';\n\nconst DSBanner = ({\n type,\n isOpen,\n onClose,\n label,\n body,\n actionLink,\n showCloseButton,\n containerProps,\n actionRef,\n}: BannerPropsT): JSX.Element => {\n const innerContainerRef = useRef<HTMLDivElement | null>(null);\n const linkRef = useRef<HTMLAnchorElement | null>(null);\n const [current, setCurrent] = useState<boolean>(isOpen);\n const [isAnimating, setIsAnimating] = useState<boolean>(false);\n const [alertTabIndex, setAlertTabIndex] = useState<number | undefined>(undefined);\n\n const ownerState = { type };\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusOnWrapper = () => {\n if (innerContainerRef.current) {\n setAlertTabIndex(0);\n setTimeout(() => {\n innerContainerRef.current.focus();\n }, 100);\n }\n };\n actionRef.current.focusOnLink = () => {\n if (linkRef.current) {\n linkRef.current.focus();\n }\n };\n }\n }, [actionRef]);\n\n useLayoutEffect(() => {\n if (isOpen !== current || isOpen) setIsAnimating(true);\n else setIsAnimating(false);\n }, [isOpen, current]);\n\n const handleBlur = useCallback(() => {\n setAlertTabIndex(undefined);\n }, []);\n const handleOnKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n if (linkRef.current) linkRef.current.click();\n }\n }, []);\n\n if (!isAnimating && !isOpen) return null;\n\n return (\n <StyledBannerContainer\n type={type}\n isOpen={isOpen}\n isAnimating={isAnimating}\n onAnimationEnd={() => setCurrent(isOpen)}\n data-testid=\"ds-banner-container\"\n {...containerProps}\n ownerState={ownerState}\n >\n <StyledInnerContainer\n type={type}\n isOpen={isOpen}\n ref={innerContainerRef}\n isAnimating={isAnimating}\n data-testid=\"ds-banner\"\n role=\"alert\"\n tabIndex={alertTabIndex}\n onBlur={handleBlur}\n >\n <StyledIconContainer data-testid=\"ds-banner-icon\">{icons[type]}</StyledIconContainer>\n <StyledTitle>{label}</StyledTitle>\n <StyledSubTitle>\n <span>{body}</span>\n {actionLink && (\n <StyledActionLink\n data-testid=\"ds-banner-action-link\"\n onClick={actionLink.onClick}\n href={actionLink.href}\n ref={linkRef}\n onKeyDown={handleOnKeyDown}\n tabIndex={0}\n isBodyEmpty={body}\n >\n {actionLink.label}\n </StyledActionLink>\n )}\n </StyledSubTitle>\n\n {showCloseButton ? (\n <StyledCloseButton\n data-testid=\"ds-banner-close-button\"\n buttonType=\"secondary\"\n onClick={onClose}\n aria-label=\"Close icon\"\n icon={<CloseX width=\"12px\" height=\"12px\" />}\n />\n ) : (\n <span />\n )}\n </StyledInnerContainer>\n </StyledBannerContainer>\n );\n};\n\nDSBanner.defaultProps = defaultProps;\nDSBanner.propTypes = propTypes;\nconst DSBannerWithSchema = describe(DSBanner);\nDSBannerWithSchema.propTypes = propTypes;\n\nexport default DSBanner;\nexport { DSBanner, DS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EtC;AAEH,MAAI,CAAC,eAAe,CAAC;AAAQ,WAAO;AAEpC,SACE,mDAAC,qCAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,MAAM,WAAW;AAAA,IACjC,eAAY;AAAA,KACR,iBANN;AAAA,IAOE;AAAA,MAEA,mDAAC,oCAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL;AAAA,IACA,eAAY;AAAA,IACZ,MAAK;AAAA,IACL,UAAU;AAAA,IACV,QAAQ;AAAA,KAER,mDAAC,mCAAD;AAAA,IAAqB,eAAY;AAAA,KAAkB,mBAAM,QACzD,mDAAC,2BAAD,MAAc,QACd,mDAAC,8BAAD,MACE,mDAAC,QAAD,MAAO,OACN,cACC,mDAAC,gCAAD;AAAA,IACE,eAAY;AAAA,IACZ,SAAS,WAAW;AAAA,IACpB,MAAM,WAAW;AAAA,IACjB,KAAK;AAAA,IACL,WAAW;AAAA,IACX,UAAU;AAAA,IACV,aAAa;AAAA,KAEZ,WAAW,SAKjB,kBACC,mDAAC,iCAAD;AAAA,IACE,eAAY;AAAA,IACZ,YAAW;AAAA,IACX,SAAS;AAAA,IACT,cAAW;AAAA,IACX,MAAM,mDAAC,wBAAD;AAAA,MAAQ,OAAM;AAAA,MAAO,QAAO;AAAA;AAAA,OAGpC,mDAAC,QAAD;AAAA;AAOV,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,MAAM,qBAAqB,gCAAS;AACpC,mBAAmB,YAAY;AAE/B,IAAO,mBAAQ;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useLayoutEffect, useRef, useCallback, useState, useEffect } from 'react';\nimport { useMemoMergePropsWithDefault, useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-utilities';\nimport { CloseX } from '@elliemae/ds-icons';\nimport { describe } from 'react-desc';\nimport { icons } from './utils/icons';\nimport { propTypes, defaultProps } from './react-desc-prop-types';\nimport { DSBannerDatatestid } from './exported-related';\nimport {\n StyledActionLink,\n StyledCloseButton,\n StyledInnerContainer,\n StyledBannerContainer,\n StyledIconContainer,\n StyledSubTitle,\n StyledTitle,\n} from './styles';\nimport type { DSBannerT } from './react-desc-prop-types';\n\nconst DSBanner = (props: DSBannerT.Props): JSX.Element | null => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);\n\n const { type, isOpen, onClose, label, body, actionLink, showCloseButton, containerProps, actionRef, ...rest } =\n propsWithDefaults;\n\n const globalAttrs = useGetGlobalAttributes(rest);\n\n const xstyledAttrs = useGetXstyledProps(rest);\n\n const innerContainerRef = useRef<HTMLDivElement | null>(null);\n const linkRef = useRef<HTMLAnchorElement | null>(null);\n const [current, setCurrent] = useState<boolean>(isOpen);\n const [isAnimating, setIsAnimating] = useState<boolean>(false);\n const [height, setHeight] = useState<number>(0);\n const [alertTabIndex, setAlertTabIndex] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n if (innerContainerRef.current) {\n setHeight(innerContainerRef.current.offsetHeight);\n }\n }, [isAnimating, isOpen]);\n\n useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusOnWrapper = () => {\n if (innerContainerRef.current) {\n setAlertTabIndex(0);\n setTimeout(() => {\n innerContainerRef.current?.focus();\n }, 300);\n }\n };\n actionRef.current.focusOnLink = () => {\n if (linkRef.current) {\n linkRef.current.focus();\n }\n };\n }\n }, [actionRef]);\n\n const handleBlur = useCallback(() => {\n setAlertTabIndex(undefined);\n }, []);\n\n const handleOnKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n if (linkRef.current) linkRef.current.click();\n }\n }, []);\n\n useLayoutEffect(() => {\n if (isOpen !== current || isOpen) setIsAnimating(true);\n else setIsAnimating(false);\n }, [isOpen, current]);\n\n if (!isAnimating && !isOpen) return null;\n\n return (\n <StyledBannerContainer\n type={type}\n isOpen={isOpen}\n height={height}\n isAnimating={isAnimating}\n onAnimationEnd={() => setCurrent(isOpen)}\n data-testid={DSBannerDatatestid.CONTAINER}\n {...containerProps}\n {...globalAttrs}\n {...xstyledAttrs}\n >\n <StyledInnerContainer\n type={type}\n isOpen={isOpen}\n ref={innerContainerRef}\n isAnimating={isAnimating}\n data-testid={DSBannerDatatestid.INNER_CONTAINER}\n role=\"alert\"\n tabIndex={alertTabIndex}\n onBlur={handleBlur}\n >\n <StyledIconContainer data-testid={DSBannerDatatestid.ICON_CONTAINER}>{icons[type]}</StyledIconContainer>\n <StyledTitle>{label}</StyledTitle>\n <StyledSubTitle>\n <span>{body}</span>\n {actionLink && (\n <StyledActionLink\n data-testid={DSBannerDatatestid.ACTION_LINK}\n onClick={actionLink.onClick}\n href={actionLink.href}\n ref={linkRef}\n onKeyDown={handleOnKeyDown}\n tabIndex={0}\n isBodyEmpty={body}\n >\n {actionLink.label}\n </StyledActionLink>\n )}\n </StyledSubTitle>\n {showCloseButton ? (\n <StyledCloseButton\n data-testid={DSBannerDatatestid.CLOSE_BUTTON}\n buttonType=\"icon\"\n onClick={onClose}\n aria-label=\"Close icon\"\n >\n <CloseX width={12} height={12} />\n </StyledCloseButton>\n ) : (\n <span />\n )}\n </StyledInnerContainer>\n </StyledBannerContainer>\n );\n};\n\nDSBanner.displayName = 'DSBanner';\nconst DSBannerWithSchema = describe(DSBanner);\nDSBannerWithSchema.propTypes = propTypes;\n\nexport default DSBanner;\nexport { DSBanner, DSBannerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAiF;AACjF,0BAAyF;AACzF,sBAAuB;AACvB,wBAAyB;AACzB,mBAAsB;AACtB,mCAAwC;AACxC,8BAAmC;AACnC,oBAQO;AAGP,MAAM,WAAW,CAAC,UAA+C;AAC/D,QAAM,oBAAoB,sDAA6B,OAAO,yCAAY;AAE1E,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PropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var DSBannerDatatestid_exports = {};
22
+ __export(DSBannerDatatestid_exports, {
23
+ DSBannerDatatestid: () => DSBannerDatatestid
24
+ });
25
+ module.exports = __toCommonJS(DSBannerDatatestid_exports);
26
+ var React = __toESM(require("react"));
27
+ const DSBannerDatatestid = {
28
+ CONTAINER: "ds-banner-container",
29
+ INNER_CONTAINER: "ds-banner",
30
+ ICON_CONTAINER: "ds-banner-icon",
31
+ ACTION_LINK: "ds-banner-action-link",
32
+ CLOSE_BUTTON: "ds-banner-close-button"
33
+ };
34
+ //# sourceMappingURL=DSBannerDatatestid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/exported-related/DSBannerDatatestid.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export const DSBannerDatatestid = {\n CONTAINER: 'ds-banner-container',\n INNER_CONTAINER: 'ds-banner',\n ICON_CONTAINER: 'ds-banner-icon',\n ACTION_LINK: 'ds-banner-action-link',\n CLOSE_BUTTON: 'ds-banner-close-button',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,qBAAqB;AAAA,EAChC,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,cAAc;AAChB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,33 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var bannerTypes_exports = {};
22
+ __export(bannerTypes_exports, {
23
+ BANNER_TYPES: () => BANNER_TYPES
24
+ });
25
+ module.exports = __toCommonJS(bannerTypes_exports);
26
+ var React = __toESM(require("react"));
27
+ const BANNER_TYPES = {
28
+ INFO: "info",
29
+ SUCCESS: "success",
30
+ WARNING: "warning",
31
+ DANGER: "danger"
32
+ };
33
+ //# sourceMappingURL=bannerTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/exported-related/bannerTypes.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export const BANNER_TYPES = {\n INFO: 'info',\n SUCCESS: 'success',\n WARNING: 'warning',\n DANGER: 'danger',\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;",
6
+ "names": []
7
+ }
@@ -0,0 +1,24 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from))
10
+ if (!__hasOwnProp.call(to, key) && key !== except)
11
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ }
13
+ return to;
14
+ };
15
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var exported_related_exports = {};
19
+ module.exports = __toCommonJS(exported_related_exports);
20
+ var React = __toESM(require("react"));
21
+ __reExport(exported_related_exports, require("./DSBannerDatatestid"), module.exports);
22
+ __reExport(exported_related_exports, require("./theming"), module.exports);
23
+ __reExport(exported_related_exports, require("./bannerTypes"), module.exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/exported-related/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export * from './DSBannerDatatestid';\nexport * from './theming';\nexport * from './bannerTypes';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,qCAAc,iCAAd;AACA,qCAAc,sBADd;AAEA,qCAAc,0BAFd;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var theming_exports = {};
22
+ __export(theming_exports, {
23
+ COMPONENT_NAME: () => COMPONENT_NAME,
24
+ slots: () => slots
25
+ });
26
+ module.exports = __toCommonJS(theming_exports);
27
+ var React = __toESM(require("react"));
28
+ const COMPONENT_NAME = "DS-Banner";
29
+ const slots = {
30
+ CONTAINER: "root",
31
+ INNER_CONTAINER: "inner-container",
32
+ TITLE: "title",
33
+ SUBTITLE: "subtitle",
34
+ ICON_CONTAINER: "icon-container",
35
+ ACTION_LINK: "action-link",
36
+ CLOSE_BUTTON: "close-button"
37
+ };
38
+ //# sourceMappingURL=theming.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/exported-related/theming.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export const COMPONENT_NAME = 'DS-Banner';\n\nexport const slots = {\n CONTAINER: 'root',\n INNER_CONTAINER: 'inner-container',\n TITLE: 'title',\n SUBTITLE: 'subtitle',\n ICON_CONTAINER: 'icon-container',\n ACTION_LINK: 'action-link',\n CLOSE_BUTTON: 'close-button',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,iBAAiB;AAEvB,MAAM,QAAQ;AAAA,EACnB,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,cAAc;AAChB;",
6
+ "names": []
7
+ }
package/dist/cjs/index.js CHANGED
@@ -4,34 +4,28 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
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 });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
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);
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
22
  var src_exports = {};
29
23
  __export(src_exports, {
30
24
  default: () => import_DSBanner.default
31
25
  });
26
+ module.exports = __toCommonJS(src_exports);
32
27
  var React = __toESM(require("react"));
33
28
  var import_DSBanner = __toESM(require("./DSBanner"));
34
- __reExport(src_exports, require("./DSBanner"));
35
- __reExport(src_exports, require("./utils/bannerTypes"));
36
- module.exports = __toCommonJS(src_exports);
29
+ __reExport(src_exports, require("./DSBanner"), module.exports);
30
+ __reExport(src_exports, require("./exported-related"), module.exports);
37
31
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export { default } from './DSBanner';\nexport * from './DSBanner';\nexport * from './utils/bannerTypes';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,sBAAwB;AACxB,wBAAc;AACd,wBAAc;",
3
+ "sources": ["../../src/index.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export { default } from './DSBanner';\nexport * from './DSBanner';\nexport * from './exported-related';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,sBAAwB;AACxB,wBAAc,uBADd;AAEA,wBAAc,+BAFd;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,77 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __export = (target, all) => {
25
+ for (var name in all)
26
+ __defProp(target, name, { get: all[name], enumerable: true });
27
+ };
28
+ var __copyProps = (to, from, except, desc) => {
29
+ if (from && typeof from === "object" || typeof from === "function") {
30
+ for (let key of __getOwnPropNames(from))
31
+ if (!__hasOwnProp.call(to, key) && key !== except)
32
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
33
+ }
34
+ return to;
35
+ };
36
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
37
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
+ var react_desc_prop_types_exports = {};
39
+ __export(react_desc_prop_types_exports, {
40
+ defaultProps: () => defaultProps,
41
+ propTypes: () => propTypes
42
+ });
43
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
44
+ var React = __toESM(require("react"));
45
+ var import_exported_related = require("./exported-related");
46
+ var import_ds_utilities = require("@elliemae/ds-utilities");
47
+ const noop = () => null;
48
+ const defaultProps = {
49
+ containerProps: {},
50
+ label: "",
51
+ body: "",
52
+ type: import_exported_related.BANNER_TYPES.INFO,
53
+ isOpen: true,
54
+ onClose: () => null,
55
+ showCloseButton: true,
56
+ actionLink: { label: "", onClick: noop, href: "" }
57
+ };
58
+ const propTypes = __spreadProps(__spreadValues(__spreadValues({}, import_ds_utilities.globalAttributesPropTypes), import_ds_utilities.xstyledPropTypes), {
59
+ containerProps: import_ds_utilities.PropTypes.object.description("Set of Properties attached to the main container.").defaultValue({}),
60
+ label: import_ds_utilities.PropTypes.string.description("Banner label.").defaultValue(""),
61
+ body: import_ds_utilities.PropTypes.string.description("Banner body content").defaultValue(""),
62
+ type: import_ds_utilities.PropTypes.oneOf(Object.values(import_exported_related.BANNER_TYPES)).description("Banner type.").defaultValue(import_exported_related.BANNER_TYPES.INFO),
63
+ onClose: import_ds_utilities.PropTypes.func.description("Callback when the Banner closes."),
64
+ isOpen: import_ds_utilities.PropTypes.bool.description("Whether the Banner is open or closed.").defaultValue(true),
65
+ showCloseButton: import_ds_utilities.PropTypes.bool.description("Whether to show close button or not.").defaultValue(true),
66
+ actionLink: import_ds_utilities.PropTypes.shape({
67
+ label: import_ds_utilities.PropTypes.string,
68
+ onClick: import_ds_utilities.PropTypes.func,
69
+ href: import_ds_utilities.PropTypes.string
70
+ }).description("Properties for the Action Link.").defaultValue({}),
71
+ actionRef: import_ds_utilities.PropTypes.object.description(`
72
+ Reference to use actions:
73
+ - focusOnLink: function to focus the banner
74
+ - focusOnWrapper: function to focus the link
75
+ `).defaultValue({})
76
+ });
77
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/react-desc-prop-types.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { BANNER_TYPES } from './exported-related';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\nimport type { DSBannerInternalsT } from './sharedTypes';\n\nconst noop = () => null;\n\nexport declare namespace DSBannerT {\n export interface Props {\n type?: DSBannerInternalsT.BannerTypesT;\n isOpen?: boolean;\n onClose?: () => void | null;\n actionLink?: DSBannerInternalsT.ActionLinkT;\n label?: string;\n body?: string;\n showCloseButton?: boolean;\n containerProps?: Record<string, unknown>;\n actionRef?: any;\n }\n}\n\nexport const defaultProps: DSBannerT.Props = {\n containerProps: {},\n label: '',\n body: '',\n type: BANNER_TYPES.INFO,\n isOpen: true,\n onClose: () => null,\n showCloseButton: true,\n actionLink: { label: '', onClick: noop, href: '' },\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n containerProps: PropTypes.object.description('Set of Properties attached to the main container.').defaultValue({}),\n label: PropTypes.string.description('Banner label.').defaultValue(''),\n body: PropTypes.string.description('Banner body content').defaultValue(''),\n type: PropTypes.oneOf(Object.values(BANNER_TYPES)).description('Banner type.').defaultValue(BANNER_TYPES.INFO),\n onClose: PropTypes.func.description('Callback when the Banner closes.'),\n isOpen: PropTypes.bool.description('Whether the Banner is open or closed.').defaultValue(true),\n showCloseButton: PropTypes.bool.description('Whether to show close button or not.').defaultValue(true),\n actionLink: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n href: PropTypes.string,\n })\n .description('Properties for the Action Link.')\n .defaultValue({}),\n actionRef: PropTypes.object\n .description(\n `\n Reference to use actions:\n - focusOnLink: function to focus the banner\n - focusOnWrapper: function to focus the link\n `,\n )\n .defaultValue({}),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA6B;AAC7B,0BAAuE;AAGvE,MAAM,OAAO,MAAM;AAgBZ,MAAM,eAAgC;AAAA,EAC3C,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM,qCAAa;AAAA,EACnB,QAAQ;AAAA,EACR,SAAS,MAAM;AAAA,EACf,iBAAiB;AAAA,EACjB,YAAY,EAAE,OAAO,IAAI,SAAS,MAAM,MAAM,GAAG;AACnD;AAEO,MAAM,YAAY,gDACpB,gDACA,uCAFoB;AAAA,EAGvB,gBAAgB,8BAAU,OAAO,YAAY,mDAAmD,EAAE,aAAa,CAAC,CAAC;AAAA,EACjH,OAAO,8BAAU,OAAO,YAAY,eAAe,EAAE,aAAa,EAAE;AAAA,EACpE,MAAM,8BAAU,OAAO,YAAY,qBAAqB,EAAE,aAAa,EAAE;AAAA,EACzE,MAAM,8BAAU,MAAM,OAAO,OAAO,oCAAY,CAAC,EAAE,YAAY,cAAc,EAAE,aAAa,qCAAa,IAAI;AAAA,EAC7G,SAAS,8BAAU,KAAK,YAAY,kCAAkC;AAAA,EACtE,QAAQ,8BAAU,KAAK,YAAY,uCAAuC,EAAE,aAAa,IAAI;AAAA,EAC7F,iBAAiB,8BAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,IAAI;AAAA,EACrG,YAAY,8BAAU,MAAM;AAAA,IAC1B,OAAO,8BAAU;AAAA,IACjB,SAAS,8BAAU;AAAA,IACnB,MAAM,8BAAU;AAAA,EAClB,CAAC,EACE,YAAY,iCAAiC,EAC7C,aAAa,CAAC,CAAC;AAAA,EAClB,WAAW,8BAAU,OAClB,YACC;AAAA;AAAA;AAAA;AAAA,KAKF,EACC,aAAa,CAAC,CAAC;AACpB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,20 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from))
10
+ if (!__hasOwnProp.call(to, key) && key !== except)
11
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ }
13
+ return to;
14
+ };
15
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
16
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
17
+ var sharedTypes_exports = {};
18
+ module.exports = __toCommonJS(sharedTypes_exports);
19
+ var React = __toESM(require("react"));
20
+ //# sourceMappingURL=sharedTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/sharedTypes.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { BANNER_TYPES } from './exported-related';\n\nexport declare namespace DSBannerInternalsT {\n export type BannerTypesT = typeof BANNER_TYPES[keyof typeof BANNER_TYPES];\n\n export interface ActionLinkT {\n label: string;\n onClick?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void | null;\n href: string;\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
6
+ "names": []
7
+ }