@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.
Files changed (53) hide show
  1. package/build/i18n/es.json +2 -2
  2. package/build/index.esm.js +59 -98
  3. package/build/index.esm.js.map +1 -1
  4. package/build/index.js +61 -100
  5. package/build/index.js.map +1 -1
  6. package/build/types/dateInput/DateInput.d.ts.map +1 -1
  7. package/build/types/emphasis/Emphasis.d.ts +1 -1
  8. package/build/types/emphasis/Emphasis.d.ts.map +1 -1
  9. package/build/types/emphasis/EmphasisHtmlTransformer.d.ts +1 -1
  10. package/build/types/emphasis/EmphasisHtmlTransformer.d.ts.map +1 -1
  11. package/build/types/emphasis/index.d.ts +1 -0
  12. package/build/types/emphasis/index.d.ts.map +1 -1
  13. package/build/types/i18n/index.d.ts.map +1 -1
  14. package/build/types/index.d.ts +5 -0
  15. package/build/types/index.d.ts.map +1 -1
  16. package/build/types/loader/Loader.d.ts +3 -3
  17. package/build/types/loader/Loader.d.ts.map +1 -1
  18. package/build/types/loader/index.d.ts +2 -2
  19. package/build/types/loader/index.d.ts.map +1 -1
  20. package/build/types/money/Money.d.ts +8 -11
  21. package/build/types/money/Money.d.ts.map +1 -1
  22. package/build/types/money/index.d.ts +2 -1
  23. package/build/types/money/index.d.ts.map +1 -1
  24. package/build/types/navigationOptionsList/NavigationOptionsList.d.ts +7 -10
  25. package/build/types/navigationOptionsList/NavigationOptionsList.d.ts.map +1 -1
  26. package/build/types/navigationOptionsList/index.d.ts +2 -1
  27. package/build/types/navigationOptionsList/index.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/src/avatar/{Avatar.spec.js → Avatar.spec.tsx} +6 -13
  30. package/src/dateInput/DateInput.spec.js +9 -29
  31. package/src/dateInput/DateInput.tsx +49 -94
  32. package/src/emphasis/{Emphasis.spec.js → Emphasis.spec.tsx} +2 -1
  33. package/src/emphasis/Emphasis.tsx +1 -1
  34. package/src/emphasis/{EmphasisHtmlTransformer.spec.js → EmphasisHtmlTransformer.spec.tsx} +0 -12
  35. package/src/emphasis/EmphasisHtmlTransformer.ts +1 -1
  36. package/src/emphasis/index.ts +1 -0
  37. package/src/i18n/es.json +2 -2
  38. package/src/i18n/index.ts +1 -2
  39. package/src/index.ts +5 -0
  40. package/src/loader/Loader.tsx +3 -3
  41. package/src/loader/index.ts +2 -0
  42. package/src/money/{Money.spec.js → Money.spec.tsx} +1 -1
  43. package/src/money/{Money.js → Money.tsx} +6 -7
  44. package/src/money/index.ts +2 -0
  45. package/src/navigationOptionsList/NavigationOptionsList.tsx +20 -0
  46. package/src/navigationOptionsList/index.ts +2 -0
  47. package/src/loader/index.js +0 -3
  48. package/src/money/index.js +0 -1
  49. package/src/navigationOptionsList/NavigationOptionsList.js +0 -20
  50. package/src/navigationOptionsList/index.js +0 -1
  51. /package/src/loader/{Loader.spec.js → Loader.spec.tsx} +0 -0
  52. /package/src/navigationOptionsList/{NavigationOptionsList.spec.js → NavigationOptionsList.spec.tsx} +0 -0
  53. /package/src/navigationOptionsList/{NavigationOptionsList.story.js → NavigationOptionsList.story.tsx} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { useTheme } from '@wise/components-theming';
2
2
  import classnames from 'classnames';
3
- import { ReactElement, useEffect, useState } from 'react';
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 Props = {
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
- }: Props): ReactElement => {
40
+ }: LoaderProps) => {
41
41
  const { theme } = useTheme();
42
42
  const [hasDebounced, setHasDebounced] = useState(displayInstantly);
43
43
 
@@ -0,0 +1,2 @@
1
+ export { default } from './Loader';
2
+ export type { LoaderProps } from './Loader';
@@ -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
- const Money = ({ amount, currency }) => {
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,2 @@
1
+ export { default } from './Money';
2
+ export type { MoneyProps } from './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;
@@ -0,0 +1,2 @@
1
+ export { default } from './NavigationOptionsList';
2
+ export type { NavigationOptionListProps } from './NavigationOptionsList';
@@ -1,3 +0,0 @@
1
- import Loader from './Loader';
2
-
3
- export default Loader;
@@ -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