@ebay/ui-core-react 3.8.0 → 3.8.2
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.
|
@@ -49,3 +49,5 @@ import "@ebay/skin/page-notice";
|
|
|
49
49
|
| `children` | React Node | No | The content to be displayed within the notice | - |
|
|
50
50
|
| `a11yDismissText` | String | No | Determines if the notice will have a dismiss button. Acts as the aria-label for the dismiss button. Should not be used with a footer. | - |
|
|
51
51
|
| `onDismissed` | Dispatch<boolean> | No | Handler for any extra functionality for after a notice is dismissed. | - |
|
|
52
|
+
|
|
53
|
+
Note: When using multiple PageNotice components with an aria-label, make sure to set a unique `id` attribute for each one or you'll run into accessibility issues.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-notice.d.ts","sourceRoot":"","sources":["../../src/ebay-page-notice/page-notice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAA0B,MAAM,OAAO,CAAA;AAK/E,aAAK,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG;IACxC,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,CAAC;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAA;CACnC,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"page-notice.d.ts","sourceRoot":"","sources":["../../src/ebay-page-notice/page-notice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAA0B,MAAM,OAAO,CAAA;AAK/E,aAAK,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG;IACxC,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,CAAC;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAA;CACnC,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,KAAK,CAqD7B,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -49,7 +49,7 @@ var notice_content_1 = __importDefault(require("../common/notice-utils/notice-co
|
|
|
49
49
|
var ebay_notice_content_1 = require("../ebay-notice-base/components/ebay-notice-content");
|
|
50
50
|
var ebay_icon_1 = require("../ebay-icon");
|
|
51
51
|
var EbayPageNotice = function (_a) {
|
|
52
|
-
var _b = _a.status, status = _b === void 0 ? 'general' : _b, children = _a.children, onDismiss = _a.onDismiss, a11yDismissText = _a.a11yDismissText, ariaLabel = _a["aria-label"], rest = __rest(_a, ["status", "children", "onDismiss", "a11yDismissText", 'aria-label']);
|
|
52
|
+
var id = _a.id, _b = _a.status, status = _b === void 0 ? 'general' : _b, children = _a.children, onDismiss = _a.onDismiss, a11yDismissText = _a.a11yDismissText, ariaLabel = _a["aria-label"], rest = __rest(_a, ["id", "status", "children", "onDismiss", "a11yDismissText", 'aria-label']);
|
|
53
53
|
var _c = react_1.useState(false), dismissed = _c[0], setDismissed = _c[1];
|
|
54
54
|
var childrenArray = react_1.default.Children.toArray(children);
|
|
55
55
|
var content = childrenArray.find(function (child) { return child.type === ebay_notice_content_1.EbayNoticeContent; });
|
|
@@ -62,8 +62,8 @@ var EbayPageNotice = function (_a) {
|
|
|
62
62
|
onDismiss(event);
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
return dismissed ? null : (react_1.default.createElement("section", __assign({}, rest, { "aria-labelledby": status + "-status", className: "page-notice " + (status !== "general" ? "page-notice--" + status : ""), role: "region" }),
|
|
66
|
-
status !== "general" ? (react_1.default.createElement("div", { className: "page-notice__header", id: status + "-status" },
|
|
65
|
+
return dismissed ? null : (react_1.default.createElement("section", __assign({}, rest, { "aria-labelledby": id || status + "-status", className: "page-notice " + (status !== "general" ? "page-notice--" + status : ""), role: "region" }),
|
|
66
|
+
status !== "general" ? (react_1.default.createElement("div", { className: "page-notice__header", id: id || status + "-status" },
|
|
67
67
|
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: status + "FilledSmall", a11yText: ariaLabel, a11yVariant: "label" }))) : null,
|
|
68
68
|
react_1.default.createElement(notice_content_1.default, __assign({}, content.props, { type: "page" })),
|
|
69
69
|
children,
|