Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

terra-alert

Package Overview
Dependencies
Maintainers
10
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terra-alert - npm Package Compare versions

Comparing version 4.47.0 to 4.48.0

9

CHANGELOG.md

@@ -5,2 +5,11 @@ # Changelog

## 4.48.0 - (January 5, 2021)
* Changed
* Updated to be compatible with `react-intl` v2-v5
* Removed usage of `FormattedMessage` in favor of `injectIntl`
* Fixed
* Fixed broken links in documentation.
## 4.47.0 - (December 8, 2020)

@@ -7,0 +16,0 @@

29

lib/Alert.js

@@ -112,2 +112,10 @@ "use strict";

/**
* @private
* intl object programmatically imported through injectIntl from react-intl.
* */
intl: _propTypes.default.shape({
formatMessage: _propTypes.default.func
}).isRequired,
/**
* The title for the alert which will be bolded.

@@ -184,5 +192,6 @@ */

onDismiss = _ref.onDismiss,
intl = _ref.intl,
title = _ref.title,
type = _ref.type,
customProps = _objectWithoutProperties(_ref, ["action", "children", "customIcon", "customColorClass", "onDismiss", "title", "type"]);
customProps = _objectWithoutProperties(_ref, ["action", "children", "customIcon", "customColorClass", "onDismiss", "intl", "title", "type"]);

@@ -196,3 +205,3 @@ var theme = _react.default.useContext(_terraThemeContext.default);

var defaultTitle = type === AlertTypes.CUSTOM ? '' : /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
var defaultTitle = type === AlertTypes.CUSTOM ? '' : intl.formatMessage({
id: "Terra.alert.".concat(type)

@@ -213,9 +222,7 @@ });

if (onDismiss) {
dismissButton = /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
id: "Terra.alert.dismiss"
}, function (buttonText) {
return /*#__PURE__*/_react.default.createElement(_terraButton.default, {
text: buttonText,
onClick: onDismiss
});
dismissButton = /*#__PURE__*/_react.default.createElement(_terraButton.default, {
text: intl.formatMessage({
id: 'Terra.alert.dismiss'
}),
onClick: onDismiss
});

@@ -266,3 +273,5 @@ }

Alert.Opts.Types = AlertTypes;
var _default = Alert;
var _default = (0, _reactIntl.injectIntl)(Alert);
exports.default = _default;
{
"name": "terra-alert",
"main": "lib/Alert.js",
"version": "4.47.0",
"version": "4.48.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.",

@@ -27,3 +27,3 @@ "repository": {

"react-dom": "^16.8.5",
"react-intl": "^2.8.0"
"react-intl": ">=2.8.0 <6.0.0"
},

@@ -33,7 +33,7 @@ "dependencies": {

"prop-types": "^15.5.8",
"terra-button": "^3.51.0",
"terra-icon": "^3.39.0",
"terra-responsive-element": "^5.27.0",
"terra-button": "^3.52.0",
"terra-icon": "^3.40.0",
"terra-responsive-element": "^5.28.0",
"terra-theme-context": "^1.0.0",
"terra-toggle": "^3.42.0"
"terra-toggle": "^3.43.0"
},

@@ -53,3 +53,3 @@ "scripts": {

},
"gitHead": "a831aafb7547ff092f55bb322c2800129e51fdf9"
"gitHead": "ded4e20a75b7e1fc40d9298b6d619fdea043815f"
}

@@ -5,3 +5,3 @@ import React, { useState } from 'react';

import Button from 'terra-button';
import { FormattedMessage } from 'react-intl';
import { injectIntl } from 'react-intl';
import IconAlert from 'terra-icon/lib/icon/IconAlert';

@@ -60,2 +60,7 @@ import IconError from 'terra-icon/lib/icon/IconError';

/**
* @private
* intl object programmatically imported through injectIntl from react-intl.
* */
intl: PropTypes.shape({ formatMessage: PropTypes.func }).isRequired,
/**
* The title for the alert which will be bolded.

@@ -117,2 +122,3 @@ */

onDismiss,
intl,
title,

@@ -125,3 +131,3 @@ type,

const defaultTitle = type === AlertTypes.CUSTOM ? '' : <FormattedMessage id={`Terra.alert.${type}`} />;
const defaultTitle = type === AlertTypes.CUSTOM ? '' : intl.formatMessage({ id: `Terra.alert.${type}` });
const alertClassNames = classNames(

@@ -147,9 +153,3 @@ cx(

if (onDismiss) {
dismissButton = (
<FormattedMessage id="Terra.alert.dismiss">
{buttonText => (
<Button text={buttonText} onClick={onDismiss} />
)}
</FormattedMessage>
);
dismissButton = <Button text={intl.formatMessage({ id: 'Terra.alert.dismiss' })} onClick={onDismiss} />;
}

@@ -202,2 +202,2 @@

export default Alert;
export default injectIntl(Alert);

@@ -125,4 +125,4 @@ import React from 'react';

const wrapper = shallowWithIntl(<Alert type="success" />);
const headerContainer = wrapper.dive();
const headerContainer = wrapper.dive().dive();
expect(headerContainer).toMatchSnapshot();
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc