@transferwise/components 0.0.0-experimental-b87be66 → 0.0.0-experimental-cbd2a4c
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/build/index.js +19 -34
- package/build/index.js.map +1 -1
- package/build/index.mjs +18 -33
- package/build/index.mjs.map +1 -1
- package/build/types/alert/inlineMarkdown/InlineMarkdown.d.ts +11 -5
- package/build/types/alert/inlineMarkdown/InlineMarkdown.d.ts.map +1 -1
- package/build/types/alert/inlineMarkdown/index.d.ts +1 -2
- package/build/types/alert/inlineMarkdown/index.d.ts.map +1 -1
- package/build/types/decision/Decision.d.ts +1 -1
- package/build/types/decision/Decision.d.ts.map +1 -1
- package/build/types/tile/Tile.d.ts +17 -37
- package/build/types/tile/Tile.d.ts.map +1 -1
- package/build/types/tile/index.d.ts +1 -1
- package/build/types/tile/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/alert/inlineMarkdown/InlineMarkdown.js +21 -0
- package/src/alert/inlineMarkdown/index.js +1 -0
- package/src/decision/Decision.tsx +1 -1
- package/src/tile/{Tile.spec.js → Tile.spec.tsx} +1 -1
- package/src/tile/{Tile.js → Tile.tsx} +24 -35
- package/src/alert/inlineMarkdown/InlineMarkdown.tsx +0 -13
- package/src/alert/inlineMarkdown/index.ts +0 -2
- /package/src/tile/{Tile.story.js → Tile.story.tsx} +0 -0
- /package/src/tile/__snapshots__/{Tile.spec.js.snap → Tile.spec.tsx.snap} +0 -0
- /package/src/tile/{index.js → index.ts} +0 -0
package/build/index.js
CHANGED
|
@@ -5,13 +5,13 @@ var classNames = require('classnames');
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var icons = require('@transferwise/icons');
|
|
7
7
|
var reactIntl = require('react-intl');
|
|
8
|
+
var PropTypes = require('prop-types');
|
|
8
9
|
var commonmark = require('commonmark');
|
|
9
10
|
var componentsTheming = require('@wise/components-theming');
|
|
10
11
|
var reactTransitionGroup = require('react-transition-group');
|
|
11
12
|
var focus = require('@react-aria/focus');
|
|
12
13
|
var reactDom = require('react-dom');
|
|
13
14
|
var neptuneValidation = require('@transferwise/neptune-validation');
|
|
14
|
-
var PropTypes = require('prop-types');
|
|
15
15
|
var formatting = require('@transferwise/formatting');
|
|
16
16
|
var react$1 = require('@headlessui/react');
|
|
17
17
|
var mergeProps = require('merge-props');
|
|
@@ -46,8 +46,8 @@ function _interopNamespace(e) {
|
|
|
46
46
|
|
|
47
47
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
48
48
|
var classNames__default = /*#__PURE__*/_interopDefault(classNames);
|
|
49
|
-
var commonmark__default = /*#__PURE__*/_interopDefault(commonmark);
|
|
50
49
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
50
|
+
var commonmark__default = /*#__PURE__*/_interopDefault(commonmark);
|
|
51
51
|
var mergeProps__default = /*#__PURE__*/_interopDefault(mergeProps);
|
|
52
52
|
var clamp__default = /*#__PURE__*/_interopDefault(clamp$2);
|
|
53
53
|
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
@@ -860,14 +860,21 @@ function stripNodes({
|
|
|
860
860
|
}
|
|
861
861
|
|
|
862
862
|
const allowList = [exports.MarkdownNodeType.STRONG];
|
|
863
|
-
|
|
863
|
+
const InlineMarkdown = props => {
|
|
864
864
|
return /*#__PURE__*/jsxRuntime.jsx(Markdown, {
|
|
865
865
|
...props,
|
|
866
866
|
as: "span",
|
|
867
867
|
allowList: allowList,
|
|
868
868
|
blockList: undefined
|
|
869
869
|
});
|
|
870
|
-
}
|
|
870
|
+
};
|
|
871
|
+
InlineMarkdown.propTypes = {
|
|
872
|
+
children: PropTypes__default.default.string.isRequired,
|
|
873
|
+
className: PropTypes__default.default.string
|
|
874
|
+
};
|
|
875
|
+
InlineMarkdown.defaultProps = {
|
|
876
|
+
className: undefined
|
|
877
|
+
};
|
|
871
878
|
|
|
872
879
|
var messages$c = reactIntl.defineMessages({
|
|
873
880
|
opensInNewTab: {
|
|
@@ -4644,7 +4651,7 @@ const NavigationOption = /*#__PURE__*/React.forwardRef(({
|
|
|
4644
4651
|
});
|
|
4645
4652
|
});
|
|
4646
4653
|
|
|
4647
|
-
|
|
4654
|
+
function Tile({
|
|
4648
4655
|
className,
|
|
4649
4656
|
description,
|
|
4650
4657
|
disabled,
|
|
@@ -4652,10 +4659,10 @@ const Tile = ({
|
|
|
4652
4659
|
target,
|
|
4653
4660
|
media,
|
|
4654
4661
|
onClick,
|
|
4655
|
-
size,
|
|
4662
|
+
size = 'md',
|
|
4656
4663
|
title
|
|
4657
|
-
})
|
|
4658
|
-
const isSmall = size ===
|
|
4664
|
+
}) {
|
|
4665
|
+
const isSmall = size === 'sm';
|
|
4659
4666
|
const Element = href ? 'a' : 'button';
|
|
4660
4667
|
return /*#__PURE__*/jsxRuntime.jsxs(Element, {
|
|
4661
4668
|
className: classNames__default.default('decision', 'flex-column', 'np-tile', 'text-no-decoration', 'text-xs-center', className, {
|
|
@@ -4664,12 +4671,12 @@ const Tile = ({
|
|
|
4664
4671
|
}, disabled && 'disabled'),
|
|
4665
4672
|
href: href,
|
|
4666
4673
|
target: target,
|
|
4667
|
-
onClick: disabled ?
|
|
4668
|
-
onKeyDown: disabled ?
|
|
4674
|
+
onClick: disabled ? undefined : onClick,
|
|
4675
|
+
onKeyDown: disabled ? undefined : ({
|
|
4669
4676
|
key
|
|
4670
4677
|
}) => {
|
|
4671
4678
|
if (key === 'Enter' || key === ' ') {
|
|
4672
|
-
onClick();
|
|
4679
|
+
onClick?.();
|
|
4673
4680
|
}
|
|
4674
4681
|
},
|
|
4675
4682
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -4686,29 +4693,7 @@ const Tile = ({
|
|
|
4686
4693
|
children: description
|
|
4687
4694
|
}) : null]
|
|
4688
4695
|
});
|
|
4689
|
-
}
|
|
4690
|
-
Tile.propTypes = {
|
|
4691
|
-
/** Classes to apply to the Tile container */
|
|
4692
|
-
className: PropTypes__default.default.string,
|
|
4693
|
-
description: PropTypes__default.default.node,
|
|
4694
|
-
disabled: PropTypes__default.default.bool,
|
|
4695
|
-
href: PropTypes__default.default.string,
|
|
4696
|
-
target: PropTypes__default.default.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
4697
|
-
/** Accepts only Avatar and images */
|
|
4698
|
-
media: PropTypes__default.default.node.isRequired,
|
|
4699
|
-
/** Function called onClick or onKeyDown */
|
|
4700
|
-
onClick: PropTypes__default.default.func,
|
|
4701
|
-
/** The size applied to Tile */
|
|
4702
|
-
size: PropTypes__default.default.oneOf(['sm', 'md']),
|
|
4703
|
-
title: PropTypes__default.default.node.isRequired
|
|
4704
|
-
};
|
|
4705
|
-
Tile.defaultProps = {
|
|
4706
|
-
className: '',
|
|
4707
|
-
description: null,
|
|
4708
|
-
disabled: false,
|
|
4709
|
-
size: exports.Size.MEDIUM,
|
|
4710
|
-
target: undefined
|
|
4711
|
-
};
|
|
4696
|
+
}
|
|
4712
4697
|
|
|
4713
4698
|
exports.DecisionPresentation = void 0;
|
|
4714
4699
|
(function (DecisionPresentation) {
|