terra-alert
Advanced tools
Comparing version 4.92.0 to 4.93.0
@@ -5,2 +5,7 @@ # Changelog | ||
## 4.93.0 - (March 15, 2024) | ||
* Added | ||
* Added `titleID` prop so that consumers can specify the ID of the alert title without using the `alert-title-${id}` string. | ||
## 4.92.0 - (March 4, 2024) | ||
@@ -7,0 +12,0 @@ |
@@ -20,3 +20,3 @@ "use strict"; | ||
var _AlertModule = _interopRequireDefault(require("./Alert.module.scss")); | ||
var _excluded = ["action", "children", "customIcon", "customColorClass", "disableAlertActionFocus", "onDismiss", "intl", "id", "role", "title", "type"]; | ||
var _excluded = ["action", "children", "customIcon", "customColorClass", "disableAlertActionFocus", "onDismiss", "intl", "id", "role", "title", "titleID", "type"]; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -103,2 +103,6 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
/** | ||
* The unique ID that is used to identify the alert title. | ||
* */ | ||
titleID: _propTypes.default.string, | ||
/** | ||
* The type of notification banner to be rendered. One of `alert`, `error`, `warning`, `unsatisfied`, `unverified`, `advisory`, | ||
@@ -166,2 +170,3 @@ * `info`, `success`, or `custom`. | ||
title = _ref.title, | ||
titleID = _ref.titleID, | ||
type = _ref.type, | ||
@@ -193,3 +198,3 @@ customProps = _objectWithoutProperties(_ref, _excluded); | ||
var alertId = id || (0, _uuid.v4)(); | ||
var alertTitleId = "alert-title-".concat(alertId); | ||
var alertTitleId = titleID || "alert-title-".concat(alertId); | ||
var alertMessageId = "alert-message-".concat(alertId); | ||
@@ -196,0 +201,0 @@ var dismissButtonAriaDescribedBy = title || defaultTitle ? alertTitleId : alertMessageId; |
{ | ||
"name": "terra-alert", | ||
"version": "4.92.0", | ||
"version": "4.93.0", | ||
"description": "The Terra Alert component is a notification banner that can be rendered in your application when there is information that you want to bring to the user's attention. The Alert component supports a number of built-in notification types that render with pre-defined colors and icons that help the user understand the severity and meaning of the notification. A custom notification type is also supported that allows your application to customize an alert that may not fit into the pre-defined types.", | ||
@@ -24,2 +24,11 @@ "author": "Cerner Corporation", | ||
"main": "lib/Alert.js", | ||
"files": [ | ||
"lib", | ||
"src", | ||
"translations", | ||
"CHANGELOG.md", | ||
"LICENSE", | ||
"NOTICE", | ||
"README.md" | ||
], | ||
"dependencies": { | ||
@@ -53,12 +62,3 @@ "classnames": "^2.2.5", | ||
}, | ||
"files": [ | ||
"lib", | ||
"src", | ||
"translations", | ||
"CHANGELOG.md", | ||
"LICENSE", | ||
"NOTICE", | ||
"README.md" | ||
], | ||
"gitHead": "442d8e342a9db411808d183f6549e45a6ee75d65" | ||
"gitHead": "ac51d94d27fae4a46f9bfa81235100bc5ff7a044" | ||
} |
@@ -89,2 +89,6 @@ import React, { useEffect, useRef, useState } from 'react'; | ||
/** | ||
* The unique ID that is used to identify the alert title. | ||
* */ | ||
titleID: PropTypes.string, | ||
/** | ||
* The type of notification banner to be rendered. One of `alert`, `error`, `warning`, `unsatisfied`, `unverified`, `advisory`, | ||
@@ -149,2 +153,3 @@ * `info`, `success`, or `custom`. | ||
title, | ||
titleID, | ||
type, | ||
@@ -182,3 +187,3 @@ ...customProps | ||
const alertId = id || uuidv4(); | ||
const alertTitleId = `alert-title-${alertId}`; | ||
const alertTitleId = titleID || `alert-title-${alertId}`; | ||
const alertMessageId = `alert-message-${alertId}`; | ||
@@ -185,0 +190,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83685
695