@ebay/ui-core-react 7.0.2 → 7.0.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-notice.d.ts","sourceRoot":"","sources":["../../src/ebay-section-notice/section-notice.tsx"],"names":[],"mappings":"AAAA,OAAc,EACV,cAAc,EACd,EAAE,EAEF,oBAAoB,EAEpB,iBAAiB,EAEpB,MAAM,OAAO,CAAA;AAId,OAAO,EAAY,IAAI,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"section-notice.d.ts","sourceRoot":"","sources":["../../src/ebay-section-notice/section-notice.tsx"],"names":[],"mappings":"AAAA,OAAc,EACV,cAAc,EACd,EAAE,EAEF,oBAAoB,EAEpB,iBAAiB,EAEpB,MAAM,OAAO,CAAA;AAId,OAAO,EAAY,IAAI,EAAE,MAAM,cAAc,CAAA;AAI7C,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,CAAA;AACjH,MAAM,MAAM,KAAK,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG;IAC5C,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,iBAAiB,GAAG,oBAAoB,CAAC;IACrD,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,CA2EhC,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -43,9 +43,14 @@ const ebay_notice_content_1 = require("../ebay-notice-base/components/ebay-notic
|
|
|
43
43
|
const notice_content_1 = __importDefault(require("../common/notice-utils/notice-content"));
|
|
44
44
|
const ebay_icon_1 = require("../ebay-icon");
|
|
45
45
|
const index_1 = require("./index");
|
|
46
|
+
const random_id_1 = require("../common/random-id");
|
|
46
47
|
const EbaySectionNotice = (_a) => {
|
|
47
48
|
var { status = 'general', children, className, 'aria-label': ariaLabel, 'aria-roledescription': ariaRoleDescription = 'Notice', a11yDismissText, educationIcon, iconClass, prominent, onDismiss = () => { } } = _a, rest = __rest(_a, ["status", "children", "className", 'aria-label', 'aria-roledescription', "a11yDismissText", "educationIcon", "iconClass", "prominent", "onDismiss"]);
|
|
48
49
|
const [dismissed, setDismissed] = (0, react_1.useState)(false);
|
|
50
|
+
const [rId, setRandomId] = (0, react_1.useState)('');
|
|
51
|
+
(0, react_1.useEffect)(() => {
|
|
52
|
+
setRandomId((0, random_id_1.randomId)());
|
|
53
|
+
}, []);
|
|
49
54
|
const childrenArray = react_1.default.Children.toArray(children);
|
|
50
55
|
const content = childrenArray.find(({ type }) => type === ebay_notice_content_1.EbayNoticeContent);
|
|
51
56
|
const hasStatus = status !== 'general' && status !== 'none';
|
|
@@ -70,8 +75,8 @@ const EbaySectionNotice = (_a) => {
|
|
|
70
75
|
[`section-notice--${status}`]: hasStatus,
|
|
71
76
|
'section-notice--education': isEducational && prominent,
|
|
72
77
|
'section-notice--large-icon': isEducational
|
|
73
|
-
}), role: "region", "aria-label": !hasStatus ? ariaLabel : null, "aria-labelledby": hasStatus ? `section-notice-${status}` : null, "aria-roledescription": ariaRoleDescription }),
|
|
74
|
-
iconName && (react_1.default.createElement("div", { className: "section-notice__header", id: `section-notice-${status}` },
|
|
78
|
+
}), role: "region", "aria-label": !hasStatus ? ariaLabel : null, "aria-labelledby": hasStatus ? `section-notice-${status}-${rId}` : null, "aria-roledescription": ariaRoleDescription }),
|
|
79
|
+
iconName && (react_1.default.createElement("div", { className: "section-notice__header", id: `section-notice-${status}-${rId}` },
|
|
75
80
|
react_1.default.createElement(ebay_icon_1.EbayIcon, { className: iconClass, name: iconName, a11yText: ariaLabel, a11yVariant: "label" }))),
|
|
76
81
|
react_1.default.createElement(notice_content_1.default, Object.assign({}, content.props, { type: "section" })),
|
|
77
82
|
children,
|