@transferwise/components 43.0.16 → 43.0.18
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.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [43.0.18](https://github.com/transferwise/neptune-web/compare/@transferwise/components@43.0.17...@transferwise/components@43.0.18) (2022-12-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **Alert:** link ([a1de049](https://github.com/transferwise/neptune-web/commit/a1de049ecf57a44a06fd8e82762cb8a5c3343650))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [43.0.17](https://github.com/transferwise/neptune-web/compare/@transferwise/components@43.0.16...@transferwise/components@43.0.17) (2022-12-02)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @transferwise/components
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [43.0.16](https://github.com/transferwise/neptune-web/compare/@transferwise/components@43.0.15...@transferwise/components@43.0.16) (2022-12-02)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_deprecatedTypeMapMes;function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{InfoCircle,InfoCircleFill,Warning as AlertTriangle,AlertCircleFill,CrossCircle,CrossCircleFill,CheckCircle,CheckCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement,useState,useRef}from"react";import requiredIf from"react-required-if";import Body from"../body/Body";import{Sentiment,Typography,Variant}from"../common";import CloseButton from"../common/closeButton";import Link from"../link";import{logActionRequiredIf,deprecated}from"../utilities";import InlineMarkdown from"./inlineMarkdown";import withArrow from"./withArrow";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Sentiment.SUCCESS,Sentiment.POSITIVE),_defineProperty(_deprecatedTypeMap,Sentiment.INFO,Sentiment.NEUTRAL),_defineProperty(_deprecatedTypeMap,Sentiment.ERROR,Sentiment.NEGATIVE),_deprecatedTypeMap),Alert=function(a){var b,c=useTheme(),d=c.isModern,e=(b={},_defineProperty(b,Sentiment.POSITIVE,d?CheckCircleFill:CheckCircle),_defineProperty(b,Sentiment.NEUTRAL,d?InfoCircleFill:InfoCircle),_defineProperty(b,Sentiment.WARNING,d?AlertCircleFill:AlertTriangle),_defineProperty(b,Sentiment.NEGATIVE,d?CrossCircleFill:CrossCircle),b),f=useState(!1),g=_slicedToArray(f,2),h=g[0],i=g[1],j=a.arrow,k=a.action,l=a.children,m=a.className,n=a.icon,o=a.onDismiss,p=a.message,q=a.type,r=a.variant,s=useRef(null);if(j){var w=withArrow(Alert,j);return/*#__PURE__*/_jsx(w,_objectSpread({},a))}logActionRequired(a);var t=deprecatedTypeMap[q]||q,u=e[t],v=n?/*#__PURE__*/cloneElement(n,{size:24}):/*#__PURE__*/_jsxs("span",{className:"alert-sentiment-icon-and-background",children:[function(a){return d?/*#__PURE__*/_jsx("span",{className:classNames("alert-sentiment-icon-background",a)}):/*#__PURE__*/_jsx(_Fragment,{})}("warning"===t?"black":"white"),/*#__PURE__*/_jsx(u,{className:"alert-sentiment-icon",size:24})]});return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(t),m),onTouchStart:function handleTouchStart(){return i(!0)},onTouchEnd:function handleTouchEnd(a){h&&k&&null!==s&&void 0!==s&&s.current&&!s.current.contains(a.target)&&("_blank"===(null===k||void 0===k?void 0:k.target)?window.top.open(k.href):window.top.location.assign(k.href)),i(!1)},onTouchMove:function handleTouchMove(){return i(!1)},children:[/*#__PURE__*/_jsxs("div",{className:classNames("alert__content","d-flex","flex-grow-1",r),"data-testid":r,children:[v,/*#__PURE__*/_jsxs("div",{className:"alert__message",children:[/*#__PURE__*/_jsx(Body,{className:"d-block",type:Typography.BODY_LARGE,children:l||/*#__PURE__*/_jsx(InlineMarkdown,{children:p})}),k&&/*#__PURE__*/_jsx(Link,{href:k.href,className:"m-t-1
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_deprecatedTypeMapMes;function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{InfoCircle,InfoCircleFill,Warning as AlertTriangle,AlertCircleFill,CrossCircle,CrossCircleFill,CheckCircle,CheckCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement,useState,useRef}from"react";import requiredIf from"react-required-if";import Body from"../body/Body";import{Sentiment,Typography,Variant}from"../common";import CloseButton from"../common/closeButton";import Link from"../link";import{logActionRequiredIf,deprecated}from"../utilities";import InlineMarkdown from"./inlineMarkdown";import withArrow from"./withArrow";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Sentiment.SUCCESS,Sentiment.POSITIVE),_defineProperty(_deprecatedTypeMap,Sentiment.INFO,Sentiment.NEUTRAL),_defineProperty(_deprecatedTypeMap,Sentiment.ERROR,Sentiment.NEGATIVE),_deprecatedTypeMap),Alert=function(a){var b,c=useTheme(),d=c.isModern,e=(b={},_defineProperty(b,Sentiment.POSITIVE,d?CheckCircleFill:CheckCircle),_defineProperty(b,Sentiment.NEUTRAL,d?InfoCircleFill:InfoCircle),_defineProperty(b,Sentiment.WARNING,d?AlertCircleFill:AlertTriangle),_defineProperty(b,Sentiment.NEGATIVE,d?CrossCircleFill:CrossCircle),b),f=useState(!1),g=_slicedToArray(f,2),h=g[0],i=g[1],j=a.arrow,k=a.action,l=a.children,m=a.className,n=a.icon,o=a.onDismiss,p=a.message,q=a.type,r=a.variant,s=useRef(null);if(j){var w=withArrow(Alert,j);return/*#__PURE__*/_jsx(w,_objectSpread({},a))}logActionRequired(a);var t=deprecatedTypeMap[q]||q,u=e[t],v=n?/*#__PURE__*/cloneElement(n,{size:24}):/*#__PURE__*/_jsxs("span",{className:"alert-sentiment-icon-and-background",children:[function(a){return d?/*#__PURE__*/_jsx("span",{className:classNames("alert-sentiment-icon-background",a)}):/*#__PURE__*/_jsx(_Fragment,{})}("warning"===t?"black":"white"),/*#__PURE__*/_jsx(u,{className:"alert-sentiment-icon",size:24})]});return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(t),m),onTouchStart:function handleTouchStart(){return i(!0)},onTouchEnd:function handleTouchEnd(a){h&&k&&null!==s&&void 0!==s&&s.current&&!s.current.contains(a.target)&&("_blank"===(null===k||void 0===k?void 0:k.target)?window.top.open(k.href):window.top.location.assign(k.href)),i(!1)},onTouchMove:function handleTouchMove(){return i(!1)},children:[/*#__PURE__*/_jsxs("div",{className:classNames("alert__content","d-flex","flex-grow-1",r),"data-testid":r,children:[v,/*#__PURE__*/_jsxs("div",{className:"alert__message",children:[/*#__PURE__*/_jsx(Body,{className:"d-block",type:Typography.BODY_LARGE,children:l||/*#__PURE__*/_jsx(InlineMarkdown,{children:p})}),k&&/*#__PURE__*/_jsx(Link,{href:k.href,className:"m-t-1","aria-label":k["aria-label"],target:k.target,type:Typography.LINK_LARGE,children:k.text})]})]}),o&&/*#__PURE__*/_jsx(CloseButton,{ref:s,size:24,className:"m-l-2",onClick:o})]})},deprecatedTypeMapMessage=(_deprecatedTypeMapMes={},_defineProperty(_deprecatedTypeMapMes,Sentiment.SUCCESS,"Sentiment.POSITIVE"),_defineProperty(_deprecatedTypeMapMes,Sentiment.INFO,"Sentiment.NEUTRAL"),_defineProperty(_deprecatedTypeMapMes,Sentiment.ERROR,"Sentiment.NEGATIVE"),_deprecatedTypeMapMes),deprecatedTypes=Object.keys(deprecatedTypeMap);function logActionRequired(a){var b=a.size,c=a.type;logActionRequiredIf("Alert no longer supports any possible variations in size. Please remove the `size` prop.",!!b),logActionRequiredIf("Alert has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))}Alert.propTypes={/** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */action:PropTypes.shape({"aria-label":PropTypes.string,href:PropTypes.string.isRequired,target:PropTypes.string,text:PropTypes.node.isRequired}),className:PropTypes.string,/** An optional icon. If not provided, we will default the icon to something appropriate for the type */icon:PropTypes.element,/** The main body of the alert. Accepts plain text and bold words specified with **double stars*/message:requiredIf(PropTypes.node,function(a){var b=a.children;return!b}),/** The presence of the onDismiss handler will trigger the visibility of the close button */onDismiss:PropTypes.func,/** The type dictates which icon and colour will be used */type:PropTypes.oneOf(["negative","neutral","positive","warning","info","error","success"]),variant:PropTypes.oneOf(["desktop","mobile"]),/** @deprecated no arrow for `Alert` component anymore, consider to use [`InlineAlert`](https://transferwise.github.io/neptune-web/components/alerts/InlineAlert) component */arrow:deprecated(PropTypes.oneOf(["up-left","up-center","up-right","down-left","down-center","down-right"]),{component:"Alert",expiryDate:new Date("03-01-2021")}),/** @deprecated use `message` property instead */children:deprecated(requiredIf(PropTypes.node,function(a){var b=a.message;return!b}),{component:"Alert",message:"You should now use the `message` prop. Be aware `message` only accepts plain text or text with **bold** markdown.",expiryDate:new Date("03-01-2021")}),/** @deprecated use `onDismiss` instead */dismissible:deprecated(PropTypes.bool,{component:"Alert",message:"The Alert will now be considered dismissible if an `onDismiss` hander is present.",expiryDate:new Date("03-01-2021")})},Alert.defaultProps={action:void 0,arrow:void 0,className:void 0,dismissible:void 0,icon:void 0,type:Sentiment.NEUTRAL,variant:Variant.DESKTOP};export default Alert;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_deprecatedTypeMapMes;import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{InfoCircle,InfoCircleFill,Warning as AlertTriangle,AlertCircleFill,CrossCircle,CrossCircleFill,CheckCircle,CheckCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement,useState,useRef}from"react";import requiredIf from"react-required-if";import Body from"../body/Body";import{Sentiment,Typography,Variant}from"../common";import CloseButton from"../common/closeButton";import Link from"../link";import{logActionRequiredIf,deprecated}from"../utilities";import InlineMarkdown from"./inlineMarkdown";import withArrow from"./withArrow";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Sentiment.SUCCESS,Sentiment.POSITIVE),_defineProperty(_deprecatedTypeMap,Sentiment.INFO,Sentiment.NEUTRAL),_defineProperty(_deprecatedTypeMap,Sentiment.ERROR,Sentiment.NEGATIVE),_deprecatedTypeMap),Alert=function(a){var b,c=useTheme(),d=c.isModern,e=(b={},_defineProperty(b,Sentiment.POSITIVE,d?CheckCircleFill:CheckCircle),_defineProperty(b,Sentiment.NEUTRAL,d?InfoCircleFill:InfoCircle),_defineProperty(b,Sentiment.WARNING,d?AlertCircleFill:AlertTriangle),_defineProperty(b,Sentiment.NEGATIVE,d?CrossCircleFill:CrossCircle),b),f=useState(!1),g=_slicedToArray(f,2),h=g[0],i=g[1],j=a.arrow,k=a.action,l=a.children,m=a.className,n=a.icon,o=a.onDismiss,p=a.message,q=a.type,r=a.variant,s=useRef(null);if(j){var w=withArrow(Alert,j);return/*#__PURE__*/_jsx(w,_objectSpread({},a))}logActionRequired(a);var t=deprecatedTypeMap[q]||q,u=e[t],v=n?/*#__PURE__*/cloneElement(n,{size:24}):/*#__PURE__*/_jsxs("span",{className:"alert-sentiment-icon-and-background",children:[function(a){return d?/*#__PURE__*/_jsx("span",{className:classNames("alert-sentiment-icon-background",a)}):/*#__PURE__*/_jsx(_Fragment,{})}("warning"===t?"black":"white"),/*#__PURE__*/_jsx(u,{className:"alert-sentiment-icon",size:24})]});return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(t),m),onTouchStart:function handleTouchStart(){return i(!0)},onTouchEnd:function handleTouchEnd(a){h&&k&&null!==s&&void 0!==s&&s.current&&!s.current.contains(a.target)&&("_blank"===(null===k||void 0===k?void 0:k.target)?window.top.open(k.href):window.top.location.assign(k.href)),i(!1)},onTouchMove:function handleTouchMove(){return i(!1)},children:[/*#__PURE__*/_jsxs("div",{className:classNames("alert__content","d-flex","flex-grow-1",r),"data-testid":r,children:[v,/*#__PURE__*/_jsxs("div",{className:"alert__message",children:[/*#__PURE__*/_jsx(Body,{className:"d-block",type:Typography.BODY_LARGE,children:l||/*#__PURE__*/_jsx(InlineMarkdown,{children:p})}),k&&/*#__PURE__*/_jsx(Link,{href:k.href,className:"m-t-1
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_deprecatedTypeMapMes;import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{InfoCircle,InfoCircleFill,Warning as AlertTriangle,AlertCircleFill,CrossCircle,CrossCircleFill,CheckCircle,CheckCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement,useState,useRef}from"react";import requiredIf from"react-required-if";import Body from"../body/Body";import{Sentiment,Typography,Variant}from"../common";import CloseButton from"../common/closeButton";import Link from"../link";import{logActionRequiredIf,deprecated}from"../utilities";import InlineMarkdown from"./inlineMarkdown";import withArrow from"./withArrow";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Sentiment.SUCCESS,Sentiment.POSITIVE),_defineProperty(_deprecatedTypeMap,Sentiment.INFO,Sentiment.NEUTRAL),_defineProperty(_deprecatedTypeMap,Sentiment.ERROR,Sentiment.NEGATIVE),_deprecatedTypeMap),Alert=function(a){var b,c=useTheme(),d=c.isModern,e=(b={},_defineProperty(b,Sentiment.POSITIVE,d?CheckCircleFill:CheckCircle),_defineProperty(b,Sentiment.NEUTRAL,d?InfoCircleFill:InfoCircle),_defineProperty(b,Sentiment.WARNING,d?AlertCircleFill:AlertTriangle),_defineProperty(b,Sentiment.NEGATIVE,d?CrossCircleFill:CrossCircle),b),f=useState(!1),g=_slicedToArray(f,2),h=g[0],i=g[1],j=a.arrow,k=a.action,l=a.children,m=a.className,n=a.icon,o=a.onDismiss,p=a.message,q=a.type,r=a.variant,s=useRef(null);if(j){var w=withArrow(Alert,j);return/*#__PURE__*/_jsx(w,_objectSpread({},a))}logActionRequired(a);var t=deprecatedTypeMap[q]||q,u=e[t],v=n?/*#__PURE__*/cloneElement(n,{size:24}):/*#__PURE__*/_jsxs("span",{className:"alert-sentiment-icon-and-background",children:[function(a){return d?/*#__PURE__*/_jsx("span",{className:classNames("alert-sentiment-icon-background",a)}):/*#__PURE__*/_jsx(_Fragment,{})}("warning"===t?"black":"white"),/*#__PURE__*/_jsx(u,{className:"alert-sentiment-icon",size:24})]});return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(t),m),onTouchStart:function handleTouchStart(){return i(!0)},onTouchEnd:function handleTouchEnd(a){h&&k&&null!==s&&void 0!==s&&s.current&&!s.current.contains(a.target)&&("_blank"===(null===k||void 0===k?void 0:k.target)?window.top.open(k.href):window.top.location.assign(k.href)),i(!1)},onTouchMove:function handleTouchMove(){return i(!1)},children:[/*#__PURE__*/_jsxs("div",{className:classNames("alert__content","d-flex","flex-grow-1",r),"data-testid":r,children:[v,/*#__PURE__*/_jsxs("div",{className:"alert__message",children:[/*#__PURE__*/_jsx(Body,{className:"d-block",type:Typography.BODY_LARGE,children:l||/*#__PURE__*/_jsx(InlineMarkdown,{children:p})}),k&&/*#__PURE__*/_jsx(Link,{href:k.href,className:"m-t-1","aria-label":k["aria-label"],target:k.target,type:Typography.LINK_LARGE,children:k.text})]})]}),o&&/*#__PURE__*/_jsx(CloseButton,{ref:s,size:24,className:"m-l-2",onClick:o})]})},deprecatedTypeMapMessage=(_deprecatedTypeMapMes={},_defineProperty(_deprecatedTypeMapMes,Sentiment.SUCCESS,"Sentiment.POSITIVE"),_defineProperty(_deprecatedTypeMapMes,Sentiment.INFO,"Sentiment.NEUTRAL"),_defineProperty(_deprecatedTypeMapMes,Sentiment.ERROR,"Sentiment.NEGATIVE"),_deprecatedTypeMapMes),deprecatedTypes=Object.keys(deprecatedTypeMap);function logActionRequired(a){var b=a.size,c=a.type;logActionRequiredIf("Alert no longer supports any possible variations in size. Please remove the `size` prop.",!!b),logActionRequiredIf("Alert has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))}Alert.propTypes={/** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */action:PropTypes.shape({"aria-label":PropTypes.string,href:PropTypes.string.isRequired,target:PropTypes.string,text:PropTypes.node.isRequired}),className:PropTypes.string,/** An optional icon. If not provided, we will default the icon to something appropriate for the type */icon:PropTypes.element,/** The main body of the alert. Accepts plain text and bold words specified with **double stars*/message:requiredIf(PropTypes.node,function(a){var b=a.children;return!b}),/** The presence of the onDismiss handler will trigger the visibility of the close button */onDismiss:PropTypes.func,/** The type dictates which icon and colour will be used */type:PropTypes.oneOf(["negative","neutral","positive","warning","info","error","success"]),variant:PropTypes.oneOf(["desktop","mobile"]),/** @deprecated no arrow for `Alert` component anymore, consider to use [`InlineAlert`](https://transferwise.github.io/neptune-web/components/alerts/InlineAlert) component */arrow:deprecated(PropTypes.oneOf(["up-left","up-center","up-right","down-left","down-center","down-right"]),{component:"Alert",expiryDate:new Date("03-01-2021")}),/** @deprecated use `message` property instead */children:deprecated(requiredIf(PropTypes.node,function(a){var b=a.message;return!b}),{component:"Alert",message:"You should now use the `message` prop. Be aware `message` only accepts plain text or text with **bold** markdown.",expiryDate:new Date("03-01-2021")}),/** @deprecated use `onDismiss` instead */dismissible:deprecated(PropTypes.bool,{component:"Alert",message:"The Alert will now be considered dismissible if an `onDismiss` hander is present.",expiryDate:new Date("03-01-2021")})},Alert.defaultProps={action:void 0,arrow:void 0,className:void 0,dismissible:void 0,icon:void 0,type:Sentiment.NEUTRAL,variant:Variant.DESKTOP};export default Alert;
|