@transferwise/components 0.0.0-experimental-1d96fa0 → 0.0.0-experimental-2d2d0d9
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/i18n/es.json +2 -2
- package/build/index.esm.js +59 -98
- package/build/index.esm.js.map +1 -1
- package/build/index.js +61 -100
- package/build/index.js.map +1 -1
- package/build/types/dateInput/DateInput.d.ts.map +1 -1
- package/build/types/emphasis/Emphasis.d.ts +1 -1
- package/build/types/emphasis/Emphasis.d.ts.map +1 -1
- package/build/types/emphasis/EmphasisHtmlTransformer.d.ts +1 -1
- package/build/types/emphasis/EmphasisHtmlTransformer.d.ts.map +1 -1
- package/build/types/emphasis/index.d.ts +1 -0
- package/build/types/emphasis/index.d.ts.map +1 -1
- package/build/types/i18n/index.d.ts.map +1 -1
- package/build/types/index.d.ts +5 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/loader/Loader.d.ts +3 -3
- package/build/types/loader/Loader.d.ts.map +1 -1
- package/build/types/loader/index.d.ts +2 -2
- package/build/types/loader/index.d.ts.map +1 -1
- package/build/types/money/Money.d.ts +8 -11
- package/build/types/money/Money.d.ts.map +1 -1
- package/build/types/money/index.d.ts +2 -1
- package/build/types/money/index.d.ts.map +1 -1
- package/build/types/navigationOptionsList/NavigationOptionsList.d.ts +7 -10
- package/build/types/navigationOptionsList/NavigationOptionsList.d.ts.map +1 -1
- package/build/types/navigationOptionsList/index.d.ts +2 -1
- package/build/types/navigationOptionsList/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/avatar/{Avatar.spec.js → Avatar.spec.tsx} +6 -13
- package/src/dateInput/DateInput.spec.js +9 -29
- package/src/dateInput/DateInput.tsx +49 -94
- package/src/emphasis/{Emphasis.spec.js → Emphasis.spec.tsx} +2 -1
- package/src/emphasis/Emphasis.tsx +1 -1
- package/src/emphasis/{EmphasisHtmlTransformer.spec.js → EmphasisHtmlTransformer.spec.tsx} +0 -12
- package/src/emphasis/EmphasisHtmlTransformer.ts +1 -1
- package/src/emphasis/index.ts +1 -0
- package/src/i18n/es.json +2 -2
- package/src/i18n/index.ts +1 -2
- package/src/index.ts +5 -0
- package/src/loader/Loader.tsx +3 -3
- package/src/loader/index.ts +2 -0
- package/src/money/{Money.spec.js → Money.spec.tsx} +1 -1
- package/src/money/{Money.js → Money.tsx} +6 -7
- package/src/money/index.ts +2 -0
- package/src/navigationOptionsList/NavigationOptionsList.tsx +20 -0
- package/src/navigationOptionsList/index.ts +2 -0
- package/src/loader/index.js +0 -3
- package/src/money/index.js +0 -1
- package/src/navigationOptionsList/NavigationOptionsList.js +0 -20
- package/src/navigationOptionsList/index.js +0 -1
- /package/src/loader/{Loader.spec.js → Loader.spec.tsx} +0 -0
- /package/src/navigationOptionsList/{NavigationOptionsList.spec.js → NavigationOptionsList.spec.tsx} +0 -0
- /package/src/navigationOptionsList/{NavigationOptionsList.story.js → NavigationOptionsList.story.tsx} +0 -0
package/src/loader/Loader.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTheme } from '@wise/components-theming';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import {
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import { Size, SizeExtraSmall, SizeSmall, SizeMedium, SizeLarge, SizeExtraLarge } from '../common';
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ type DeprecatedSize = SizeExtraSmall | SizeLarge | SizeExtraLarge;
|
|
|
9
9
|
|
|
10
10
|
type SizeType = SizeSmall | SizeMedium;
|
|
11
11
|
|
|
12
|
-
type
|
|
12
|
+
export type LoaderProps = {
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated use `size` instead
|
|
15
15
|
*/
|
|
@@ -37,7 +37,7 @@ const Loader = ({
|
|
|
37
37
|
displayInstantly = false,
|
|
38
38
|
classNames = {},
|
|
39
39
|
...restProps
|
|
40
|
-
}:
|
|
40
|
+
}: LoaderProps) => {
|
|
41
41
|
const { theme } = useTheme();
|
|
42
42
|
const [hasDebounced, setHasDebounced] = useState(displayInstantly);
|
|
43
43
|
|
|
@@ -11,7 +11,7 @@ describe('Money', () => {
|
|
|
11
11
|
it('formats the string with amount, currency & the passed in locale', () => {
|
|
12
12
|
const { container } = render(<Money amount={4.98} currency="GBP" />, {
|
|
13
13
|
locale: 'fr',
|
|
14
|
-
messages:
|
|
14
|
+
messages: undefined,
|
|
15
15
|
});
|
|
16
16
|
expect(container).toHaveTextContent('4,98 GBP');
|
|
17
17
|
});
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { formatMoney } from '@transferwise/formatting';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { useIntl } from 'react-intl';
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
export interface MoneyProps {
|
|
5
|
+
amount: number;
|
|
6
|
+
currency: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Money = ({ amount, currency }: MoneyProps) => {
|
|
6
10
|
const { locale } = useIntl();
|
|
7
11
|
return <>{formatMoney(amount, currency, locale)}</>;
|
|
8
12
|
};
|
|
9
13
|
|
|
10
|
-
Money.propTypes = {
|
|
11
|
-
amount: PropTypes.number.isRequired,
|
|
12
|
-
currency: PropTypes.string.isRequired,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
14
|
export default Money;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Children } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface NavigationOptionListProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const NavigationOptionList = ({ children }: NavigationOptionListProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<ul className="np-navigation-options-list">
|
|
11
|
+
{Children.map(children, (child) => (
|
|
12
|
+
<li key={child?.toString()} className="np-navigation-options-list__item">
|
|
13
|
+
{child}
|
|
14
|
+
</li>
|
|
15
|
+
))}
|
|
16
|
+
</ul>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default NavigationOptionList;
|
package/src/loader/index.js
DELETED
package/src/money/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Money';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import { Children } from 'react';
|
|
3
|
-
|
|
4
|
-
const NavigationOptionList = ({ children }) => {
|
|
5
|
-
return (
|
|
6
|
-
<ul className="np-navigation-options-list">
|
|
7
|
-
{Children.map(children, (child) => (
|
|
8
|
-
<li key={child.key} className="np-navigation-options-list__item">
|
|
9
|
-
{child}
|
|
10
|
-
</li>
|
|
11
|
-
))}
|
|
12
|
-
</ul>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
NavigationOptionList.propTypes = {
|
|
17
|
-
children: PropTypes.node.isRequired,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default NavigationOptionList;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './NavigationOptionsList';
|
|
File without changes
|
/package/src/navigationOptionsList/{NavigationOptionsList.spec.js → NavigationOptionsList.spec.tsx}
RENAMED
|
File without changes
|
|
File without changes
|