@transferwise/components 0.0.0-experimental-e813f6c → 0.0.0-experimental-0852cd9

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/main.css CHANGED
@@ -34,10 +34,6 @@
34
34
  margin-left: var(--padding-small);
35
35
  }
36
36
  }
37
- .tw-date-lookup-calendar > tbody > tr > td.weekend button {
38
- font-size: 0.875rem;
39
- font-size: var(--font-size-14);line-height: 155%;letter-spacing: -0.006em;font-weight: 400;font-weight: var(--font-weight-regular);
40
- }
41
37
  @media (min-width: 768px) {
42
38
  }
43
39
  @media (min-width: 768px) {
@@ -4,8 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var icons = require('@transferwise/icons');
6
6
  var clsx = require('clsx');
7
- var avatarTypes = require('../avatar/avatarTypes.js');
8
- var Avatar = require('../avatar/Avatar.js');
9
7
  var Body = require('../body/Body.js');
10
8
  require('../common/theme.js');
11
9
  require('../common/direction.js');
@@ -30,6 +28,7 @@ require('react');
30
28
  require('react-intl');
31
29
  require('../common/closeButton/CloseButton.messages.js');
32
30
  var jsxRuntime = require('react/jsx-runtime');
31
+ var AvatarView = require('../avatarView/AvatarView.js');
33
32
 
34
33
  const PromoCardIndicator = ({
35
34
  className,
@@ -55,10 +54,12 @@ const PromoCardIndicator = ({
55
54
  type: typography.Typography.BODY_LARGE_BOLD,
56
55
  className: "np-Card-indicatorText",
57
56
  children: label
58
- }), icon && /*#__PURE__*/jsxRuntime.jsx(Avatar.default, {
59
- type: avatarTypes.AvatarType.ICON,
57
+ }), icon && /*#__PURE__*/jsxRuntime.jsx(AvatarView.default, {
58
+ interactive: true,
60
59
  size: isSmall ? 40 : 56,
61
- backgroundColor: "var(--Card-indicator-icon-background-color)",
60
+ style: {
61
+ backgroundColor: 'var(--Card-indicator-icon-background-color)'
62
+ },
62
63
  className: "np-Card-indicatorIcon",
63
64
  children: IconComponent ? /*#__PURE__*/jsxRuntime.jsx(IconComponent, {
64
65
  size: 24,
@@ -1 +1 @@
1
- {"version":3,"file":"PromoCardIndicator.js","sources":["../../src/promoCard/PromoCardIndicator.tsx"],"sourcesContent":["import { ArrowRight, Check, Download } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ReactElement, ReactNode } from 'react';\n\nimport Avatar, { AvatarType } from '../avatar';\nimport Body from '../body';\nimport { Typography } from '../common';\n\nexport type PromoCardIndicatorProps = {\n /** Optional class name(s) to add to the indicator container. */\n className?: string;\n\n /** Optional label to display next to the indicator. */\n label?: string;\n\n /** Optional icon to display in the indicator. */\n icon?: 'check' | 'arrow' | 'download' | ReactElement;\n\n /** Optional prop to specify whether the indicator is sized small or not. */\n isSmall?: boolean;\n\n /** Optional ID to add to the indicator container for testing purposes. */\n testid?: string;\n\n /** Optional children to display inside the indicator. */\n children?: ReactNode;\n};\n\n/**\n * PromoCardIndicator component.\n *\n * A PromoCardIndicator is a small component that can be used to display\n * additional information or actions related to a PromoCard. It can be\n * customized with various props to suit different use cases.\n *\n * @param {string} className - Optional class name(s) to add to the indicator container.\n * @param {string} label - Optional label to display next to the indicator.\n * @param {string | ReactElement} icon - Optional icon to display in the indicator.\n * @param {string} testid - Optional ID to add to the indicator container for testing purposes.\n * @param {ReactNode} children - Optional children to display inside the indicator.\n * @returns {React.JSX.Element} - The PromoCardIndicator component.\n * @example\n * <PromoCardIndicator label=\"Download\" icon=\"download\" />\n */\nconst PromoCardIndicator: React.FC<PromoCardIndicatorProps> = ({\n className,\n children,\n label,\n icon,\n isSmall = false,\n testid,\n ...rest\n}) => {\n const isIconString = icon && typeof icon === 'string';\n\n const IconComponent =\n isIconString &&\n {\n check: Check,\n arrow: ArrowRight,\n download: Download,\n }[icon];\n\n return (\n <div className={clsx('np-Card-indicator', className)} data-testid={testid} {...rest}>\n {label && (\n <Body as=\"span\" type={Typography.BODY_LARGE_BOLD} className=\"np-Card-indicatorText\">\n {label}\n </Body>\n )}\n {icon && (\n <Avatar\n type={AvatarType.ICON}\n size={isSmall ? 40 : 56}\n backgroundColor=\"var(--Card-indicator-icon-background-color)\"\n className=\"np-Card-indicatorIcon\"\n >\n {IconComponent ? <IconComponent size={24} aria-hidden=\"true\" /> : icon}\n </Avatar>\n )}\n {children}\n </div>\n );\n};\n\nexport default PromoCardIndicator;\n"],"names":["PromoCardIndicator","className","children","label","icon","isSmall","testid","rest","isIconString","IconComponent","check","Check","arrow","ArrowRight","download","Download","_jsxs","clsx","_jsx","Body","as","type","Typography","BODY_LARGE_BOLD","Avatar","AvatarType","ICON","size","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CMA,MAAAA,kBAAkB,GAAsCA,CAAC;EAC7DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,IAAI;AACJC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;EACN,GAAGC,IAAAA;AACJ,CAAA,KAAI;AACH,EAAA,MAAMC,YAAY,GAAGJ,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,CAAA;EAErD,MAAMK,aAAa,GACjBD,YAAY,IACZ;AACEE,IAAAA,KAAK,EAAEC,WAAK;AACZC,IAAAA,KAAK,EAAEC,gBAAU;AACjBC,IAAAA,QAAQ,EAAEC,cAAAA;GACX,CAACX,IAAI,CAAC,CAAA;AAET,EAAA,oBACEY,eAAA,CAAA,KAAA,EAAA;AAAKf,IAAAA,SAAS,EAAEgB,SAAI,CAAC,mBAAmB,EAAEhB,SAAS,CAAE;AAAC,IAAA,aAAA,EAAaK,MAAO;AAAA,IAAA,GAAKC,IAAI;AAAAL,IAAAA,QAAA,EAChFC,CAAAA,KAAK,iBACJe,cAAA,CAACC,YAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACC,IAAI,EAAEC,qBAAU,CAACC,eAAgB;AAACtB,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAChFC,KAAAA;AAAK,KACF,CACP,EACAC,IAAI,iBACHc,cAAA,CAACM,cAAM,EAAA;MACLH,IAAI,EAAEI,sBAAU,CAACC,IAAK;AACtBC,MAAAA,IAAI,EAAEtB,OAAO,GAAG,EAAE,GAAG,EAAG;AACxBuB,MAAAA,eAAe,EAAC,6CAA6C;AAC7D3B,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAEhCO,aAAa,gBAAGS,cAAA,CAACT,aAAa,EAAA;AAACkB,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAY,EAAA,MAAA;AAAM,QAAG,GAAGvB,IAAAA;KAC5D,CACT,EACAF,QAAQ,CAAA;AAAA,GACN,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"PromoCardIndicator.js","sources":["../../src/promoCard/PromoCardIndicator.tsx"],"sourcesContent":["import { ArrowRight, Check, Download } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ReactElement, ReactNode } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\nimport AvatarView from '../avatarView';\n\nexport type PromoCardIndicatorProps = {\n /** Optional class name(s) to add to the indicator container. */\n className?: string;\n\n /** Optional label to display next to the indicator. */\n label?: string;\n\n /** Optional icon to display in the indicator. */\n icon?: 'check' | 'arrow' | 'download' | ReactElement;\n\n /** Optional prop to specify whether the indicator is sized small or not. */\n isSmall?: boolean;\n\n /** Optional ID to add to the indicator container for testing purposes. */\n testid?: string;\n\n /** Optional children to display inside the indicator. */\n children?: ReactNode;\n};\n\n/**\n * PromoCardIndicator component.\n *\n * A PromoCardIndicator is a small component that can be used to display\n * additional information or actions related to a PromoCard. It can be\n * customized with various props to suit different use cases.\n *\n * @param {string} className - Optional class name(s) to add to the indicator container.\n * @param {string} label - Optional label to display next to the indicator.\n * @param {string | ReactElement} icon - Optional icon to display in the indicator.\n * @param {string} testid - Optional ID to add to the indicator container for testing purposes.\n * @param {ReactNode} children - Optional children to display inside the indicator.\n * @returns {React.JSX.Element} - The PromoCardIndicator component.\n * @example\n * <PromoCardIndicator label=\"Download\" icon=\"download\" />\n */\nconst PromoCardIndicator: React.FC<PromoCardIndicatorProps> = ({\n className,\n children,\n label,\n icon,\n isSmall = false,\n testid,\n ...rest\n}) => {\n const isIconString = icon && typeof icon === 'string';\n\n const IconComponent =\n isIconString &&\n {\n check: Check,\n arrow: ArrowRight,\n download: Download,\n }[icon];\n\n return (\n <div className={clsx('np-Card-indicator', className)} data-testid={testid} {...rest}>\n {label && (\n <Body as=\"span\" type={Typography.BODY_LARGE_BOLD} className=\"np-Card-indicatorText\">\n {label}\n </Body>\n )}\n {icon && (\n <AvatarView\n interactive\n size={isSmall ? 40 : 56}\n style={{ backgroundColor: 'var(--Card-indicator-icon-background-color)' }}\n className=\"np-Card-indicatorIcon\"\n >\n {IconComponent ? <IconComponent size={24} aria-hidden=\"true\" /> : icon}\n </AvatarView>\n )}\n {children}\n </div>\n );\n};\n\nexport default PromoCardIndicator;\n"],"names":["PromoCardIndicator","className","children","label","icon","isSmall","testid","rest","isIconString","IconComponent","check","Check","arrow","ArrowRight","download","Download","_jsxs","clsx","_jsx","Body","as","type","Typography","BODY_LARGE_BOLD","AvatarView","interactive","size","style","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CMA,MAAAA,kBAAkB,GAAsCA,CAAC;EAC7DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,IAAI;AACJC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;EACN,GAAGC,IAAAA;AACJ,CAAA,KAAI;AACH,EAAA,MAAMC,YAAY,GAAGJ,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,CAAA;EAErD,MAAMK,aAAa,GACjBD,YAAY,IACZ;AACEE,IAAAA,KAAK,EAAEC,WAAK;AACZC,IAAAA,KAAK,EAAEC,gBAAU;AACjBC,IAAAA,QAAQ,EAAEC,cAAAA;GACX,CAACX,IAAI,CAAC,CAAA;AAET,EAAA,oBACEY,eAAA,CAAA,KAAA,EAAA;AAAKf,IAAAA,SAAS,EAAEgB,SAAI,CAAC,mBAAmB,EAAEhB,SAAS,CAAE;AAAC,IAAA,aAAA,EAAaK,MAAO;AAAA,IAAA,GAAKC,IAAI;AAAAL,IAAAA,QAAA,EAChFC,CAAAA,KAAK,iBACJe,cAAA,CAACC,YAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACC,IAAI,EAAEC,qBAAU,CAACC,eAAgB;AAACtB,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAChFC,KAAAA;AAAK,KACF,CACP,EACAC,IAAI,iBACHc,cAAA,CAACM,kBAAU,EAAA;MACTC,WAAW,EAAA,IAAA;AACXC,MAAAA,IAAI,EAAErB,OAAO,GAAG,EAAE,GAAG,EAAG;AACxBsB,MAAAA,KAAK,EAAE;AAAEC,QAAAA,eAAe,EAAE,6CAAA;OAAgD;AAC1E3B,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAEhCO,aAAa,gBAAGS,cAAA,CAACT,aAAa,EAAA;AAACiB,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAY,EAAA,MAAA;AAAM,QAAG,GAAGtB,IAAAA;KACxD,CACb,EACAF,QAAQ,CAAA;AAAA,GACN,CAAC,CAAA;AAEV;;;;"}
@@ -1,7 +1,5 @@
1
1
  import { Check, ArrowRight, Download } from '@transferwise/icons';
2
2
  import { clsx } from 'clsx';
3
- import { AvatarType } from '../avatar/avatarTypes.mjs';
4
- import Avatar from '../avatar/Avatar.mjs';
5
3
  import Body from '../body/Body.mjs';
6
4
  import '../common/theme.mjs';
7
5
  import '../common/direction.mjs';
@@ -26,6 +24,7 @@ import 'react';
26
24
  import 'react-intl';
27
25
  import '../common/closeButton/CloseButton.messages.mjs';
28
26
  import { jsxs, jsx } from 'react/jsx-runtime';
27
+ import AvatarView from '../avatarView/AvatarView.mjs';
29
28
 
30
29
  const PromoCardIndicator = ({
31
30
  className,
@@ -51,10 +50,12 @@ const PromoCardIndicator = ({
51
50
  type: Typography.BODY_LARGE_BOLD,
52
51
  className: "np-Card-indicatorText",
53
52
  children: label
54
- }), icon && /*#__PURE__*/jsx(Avatar, {
55
- type: AvatarType.ICON,
53
+ }), icon && /*#__PURE__*/jsx(AvatarView, {
54
+ interactive: true,
56
55
  size: isSmall ? 40 : 56,
57
- backgroundColor: "var(--Card-indicator-icon-background-color)",
56
+ style: {
57
+ backgroundColor: 'var(--Card-indicator-icon-background-color)'
58
+ },
58
59
  className: "np-Card-indicatorIcon",
59
60
  children: IconComponent ? /*#__PURE__*/jsx(IconComponent, {
60
61
  size: 24,
@@ -1 +1 @@
1
- {"version":3,"file":"PromoCardIndicator.mjs","sources":["../../src/promoCard/PromoCardIndicator.tsx"],"sourcesContent":["import { ArrowRight, Check, Download } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ReactElement, ReactNode } from 'react';\n\nimport Avatar, { AvatarType } from '../avatar';\nimport Body from '../body';\nimport { Typography } from '../common';\n\nexport type PromoCardIndicatorProps = {\n /** Optional class name(s) to add to the indicator container. */\n className?: string;\n\n /** Optional label to display next to the indicator. */\n label?: string;\n\n /** Optional icon to display in the indicator. */\n icon?: 'check' | 'arrow' | 'download' | ReactElement;\n\n /** Optional prop to specify whether the indicator is sized small or not. */\n isSmall?: boolean;\n\n /** Optional ID to add to the indicator container for testing purposes. */\n testid?: string;\n\n /** Optional children to display inside the indicator. */\n children?: ReactNode;\n};\n\n/**\n * PromoCardIndicator component.\n *\n * A PromoCardIndicator is a small component that can be used to display\n * additional information or actions related to a PromoCard. It can be\n * customized with various props to suit different use cases.\n *\n * @param {string} className - Optional class name(s) to add to the indicator container.\n * @param {string} label - Optional label to display next to the indicator.\n * @param {string | ReactElement} icon - Optional icon to display in the indicator.\n * @param {string} testid - Optional ID to add to the indicator container for testing purposes.\n * @param {ReactNode} children - Optional children to display inside the indicator.\n * @returns {React.JSX.Element} - The PromoCardIndicator component.\n * @example\n * <PromoCardIndicator label=\"Download\" icon=\"download\" />\n */\nconst PromoCardIndicator: React.FC<PromoCardIndicatorProps> = ({\n className,\n children,\n label,\n icon,\n isSmall = false,\n testid,\n ...rest\n}) => {\n const isIconString = icon && typeof icon === 'string';\n\n const IconComponent =\n isIconString &&\n {\n check: Check,\n arrow: ArrowRight,\n download: Download,\n }[icon];\n\n return (\n <div className={clsx('np-Card-indicator', className)} data-testid={testid} {...rest}>\n {label && (\n <Body as=\"span\" type={Typography.BODY_LARGE_BOLD} className=\"np-Card-indicatorText\">\n {label}\n </Body>\n )}\n {icon && (\n <Avatar\n type={AvatarType.ICON}\n size={isSmall ? 40 : 56}\n backgroundColor=\"var(--Card-indicator-icon-background-color)\"\n className=\"np-Card-indicatorIcon\"\n >\n {IconComponent ? <IconComponent size={24} aria-hidden=\"true\" /> : icon}\n </Avatar>\n )}\n {children}\n </div>\n );\n};\n\nexport default PromoCardIndicator;\n"],"names":["PromoCardIndicator","className","children","label","icon","isSmall","testid","rest","isIconString","IconComponent","check","Check","arrow","ArrowRight","download","Download","_jsxs","clsx","_jsx","Body","as","type","Typography","BODY_LARGE_BOLD","Avatar","AvatarType","ICON","size","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CMA,MAAAA,kBAAkB,GAAsCA,CAAC;EAC7DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,IAAI;AACJC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;EACN,GAAGC,IAAAA;AACJ,CAAA,KAAI;AACH,EAAA,MAAMC,YAAY,GAAGJ,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,CAAA;EAErD,MAAMK,aAAa,GACjBD,YAAY,IACZ;AACEE,IAAAA,KAAK,EAAEC,KAAK;AACZC,IAAAA,KAAK,EAAEC,UAAU;AACjBC,IAAAA,QAAQ,EAAEC,QAAAA;GACX,CAACX,IAAI,CAAC,CAAA;AAET,EAAA,oBACEY,IAAA,CAAA,KAAA,EAAA;AAAKf,IAAAA,SAAS,EAAEgB,IAAI,CAAC,mBAAmB,EAAEhB,SAAS,CAAE;AAAC,IAAA,aAAA,EAAaK,MAAO;AAAA,IAAA,GAAKC,IAAI;AAAAL,IAAAA,QAAA,EAChFC,CAAAA,KAAK,iBACJe,GAAA,CAACC,IAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACC,IAAI,EAAEC,UAAU,CAACC,eAAgB;AAACtB,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAChFC,KAAAA;AAAK,KACF,CACP,EACAC,IAAI,iBACHc,GAAA,CAACM,MAAM,EAAA;MACLH,IAAI,EAAEI,UAAU,CAACC,IAAK;AACtBC,MAAAA,IAAI,EAAEtB,OAAO,GAAG,EAAE,GAAG,EAAG;AACxBuB,MAAAA,eAAe,EAAC,6CAA6C;AAC7D3B,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAEhCO,aAAa,gBAAGS,GAAA,CAACT,aAAa,EAAA;AAACkB,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAY,EAAA,MAAA;AAAM,QAAG,GAAGvB,IAAAA;KAC5D,CACT,EACAF,QAAQ,CAAA;AAAA,GACN,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"PromoCardIndicator.mjs","sources":["../../src/promoCard/PromoCardIndicator.tsx"],"sourcesContent":["import { ArrowRight, Check, Download } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ReactElement, ReactNode } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\nimport AvatarView from '../avatarView';\n\nexport type PromoCardIndicatorProps = {\n /** Optional class name(s) to add to the indicator container. */\n className?: string;\n\n /** Optional label to display next to the indicator. */\n label?: string;\n\n /** Optional icon to display in the indicator. */\n icon?: 'check' | 'arrow' | 'download' | ReactElement;\n\n /** Optional prop to specify whether the indicator is sized small or not. */\n isSmall?: boolean;\n\n /** Optional ID to add to the indicator container for testing purposes. */\n testid?: string;\n\n /** Optional children to display inside the indicator. */\n children?: ReactNode;\n};\n\n/**\n * PromoCardIndicator component.\n *\n * A PromoCardIndicator is a small component that can be used to display\n * additional information or actions related to a PromoCard. It can be\n * customized with various props to suit different use cases.\n *\n * @param {string} className - Optional class name(s) to add to the indicator container.\n * @param {string} label - Optional label to display next to the indicator.\n * @param {string | ReactElement} icon - Optional icon to display in the indicator.\n * @param {string} testid - Optional ID to add to the indicator container for testing purposes.\n * @param {ReactNode} children - Optional children to display inside the indicator.\n * @returns {React.JSX.Element} - The PromoCardIndicator component.\n * @example\n * <PromoCardIndicator label=\"Download\" icon=\"download\" />\n */\nconst PromoCardIndicator: React.FC<PromoCardIndicatorProps> = ({\n className,\n children,\n label,\n icon,\n isSmall = false,\n testid,\n ...rest\n}) => {\n const isIconString = icon && typeof icon === 'string';\n\n const IconComponent =\n isIconString &&\n {\n check: Check,\n arrow: ArrowRight,\n download: Download,\n }[icon];\n\n return (\n <div className={clsx('np-Card-indicator', className)} data-testid={testid} {...rest}>\n {label && (\n <Body as=\"span\" type={Typography.BODY_LARGE_BOLD} className=\"np-Card-indicatorText\">\n {label}\n </Body>\n )}\n {icon && (\n <AvatarView\n interactive\n size={isSmall ? 40 : 56}\n style={{ backgroundColor: 'var(--Card-indicator-icon-background-color)' }}\n className=\"np-Card-indicatorIcon\"\n >\n {IconComponent ? <IconComponent size={24} aria-hidden=\"true\" /> : icon}\n </AvatarView>\n )}\n {children}\n </div>\n );\n};\n\nexport default PromoCardIndicator;\n"],"names":["PromoCardIndicator","className","children","label","icon","isSmall","testid","rest","isIconString","IconComponent","check","Check","arrow","ArrowRight","download","Download","_jsxs","clsx","_jsx","Body","as","type","Typography","BODY_LARGE_BOLD","AvatarView","interactive","size","style","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CMA,MAAAA,kBAAkB,GAAsCA,CAAC;EAC7DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,IAAI;AACJC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;EACN,GAAGC,IAAAA;AACJ,CAAA,KAAI;AACH,EAAA,MAAMC,YAAY,GAAGJ,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,CAAA;EAErD,MAAMK,aAAa,GACjBD,YAAY,IACZ;AACEE,IAAAA,KAAK,EAAEC,KAAK;AACZC,IAAAA,KAAK,EAAEC,UAAU;AACjBC,IAAAA,QAAQ,EAAEC,QAAAA;GACX,CAACX,IAAI,CAAC,CAAA;AAET,EAAA,oBACEY,IAAA,CAAA,KAAA,EAAA;AAAKf,IAAAA,SAAS,EAAEgB,IAAI,CAAC,mBAAmB,EAAEhB,SAAS,CAAE;AAAC,IAAA,aAAA,EAAaK,MAAO;AAAA,IAAA,GAAKC,IAAI;AAAAL,IAAAA,QAAA,EAChFC,CAAAA,KAAK,iBACJe,GAAA,CAACC,IAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACC,IAAI,EAAEC,UAAU,CAACC,eAAgB;AAACtB,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAChFC,KAAAA;AAAK,KACF,CACP,EACAC,IAAI,iBACHc,GAAA,CAACM,UAAU,EAAA;MACTC,WAAW,EAAA,IAAA;AACXC,MAAAA,IAAI,EAAErB,OAAO,GAAG,EAAE,GAAG,EAAG;AACxBsB,MAAAA,KAAK,EAAE;AAAEC,QAAAA,eAAe,EAAE,6CAAA;OAAgD;AAC1E3B,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAEhCO,aAAa,gBAAGS,GAAA,CAACT,aAAa,EAAA;AAACiB,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAY,EAAA,MAAA;AAAM,QAAG,GAAGtB,IAAAA;KACxD,CACb,EACAF,QAAQ,CAAA;AAAA,GACN,CAAC,CAAA;AAEV;;;;"}
@@ -34,10 +34,6 @@
34
34
  margin-left: var(--padding-small);
35
35
  }
36
36
  }
37
- .tw-date-lookup-calendar > tbody > tr > td.weekend button {
38
- font-size: 0.875rem;
39
- font-size: var(--font-size-14);line-height: 155%;letter-spacing: -0.006em;font-weight: 400;font-weight: var(--font-weight-regular);
40
- }
41
37
  @media (min-width: 768px) {
42
38
  }
43
39
  @media (min-width: 768px) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-e813f6c",
3
+ "version": "0.0.0-experimental-0852cd9",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -11,7 +11,6 @@
11
11
 
12
12
  > tbody > tr > td.weekend button {
13
13
  color: var(--color-content-secondary);
14
- &:extend(.np-text-body-default);
15
14
  }
16
15
 
17
16
  > tbody > tr > td {
@@ -1,10 +1,10 @@
1
- import Avatar from '../avatar';
2
1
  import { Breakpoint, Size } from '../common';
3
2
  import { mockMatchMedia } from '../mocks';
4
3
  import { render, screen } from '../test-utils';
5
4
 
6
5
  import Decision, { DecisionPresentation, DecisionType } from '.';
7
6
  import { DecisionProps } from './Decision';
7
+ import AvatarView from '../avatarView';
8
8
 
9
9
  mockMatchMedia(jest);
10
10
 
@@ -13,7 +13,7 @@ describe('Decision', () => {
13
13
  options: [
14
14
  {
15
15
  media: {
16
- list: <Avatar type="initials">HM</Avatar>,
16
+ list: <AvatarView profileName="Henry Mike" />,
17
17
  block: <img src="img.jpg" alt="alt" />,
18
18
  },
19
19
  href: '#href',
@@ -2,10 +2,10 @@ import { action } from '@storybook/addon-actions';
2
2
  import { boolean, select } from '@storybook/addon-knobs';
3
3
  import { Illustration } from '@wise/art';
4
4
 
5
- import Avatar from '../avatar';
6
5
  import { Size } from '../common';
7
6
 
8
7
  import Decision, { DecisionPresentation, DecisionType } from '.';
8
+ import AvatarView from '../avatarView';
9
9
 
10
10
  export default {
11
11
  component: Decision,
@@ -33,11 +33,7 @@ export const Basic = () => {
33
33
  disabled,
34
34
  media: {
35
35
  block: <Illustration name="globe" alt="" disablePadding />,
36
- list: (
37
- <Avatar size="md" type="initials">
38
- HM
39
- </Avatar>
40
- ),
36
+ list: <AvatarView profileName="Henry Mike" />,
41
37
  },
42
38
  'aria-label': 'Click to see something',
43
39
  title: 'Hank Miller',
@@ -50,11 +46,7 @@ export const Basic = () => {
50
46
  href: '#href2',
51
47
  media: {
52
48
  block: <Illustration name="confetti" alt="" disablePadding />,
53
- list: (
54
- <Avatar size="md" type="initials">
55
- HM
56
- </Avatar>
57
- ),
49
+ list: <AvatarView profileName="Henry Mike" />,
58
50
  },
59
51
  'aria-label': 'Click here to send money to Hank Miller.',
60
52
  title: 'Hank Miller',
@@ -109,11 +101,7 @@ export const grid = () => {
109
101
  alt=""
110
102
  />
111
103
  ),
112
- list: (
113
- <Avatar size="md" type="initials">
114
- HM
115
- </Avatar>
116
- ),
104
+ list: <AvatarView profileName="Henry Mike" />,
117
105
  },
118
106
  'aria-label': 'Click to see something',
119
107
  title: 'Hank Miller',
@@ -131,11 +119,7 @@ export const grid = () => {
131
119
  alt=""
132
120
  />
133
121
  ),
134
- list: (
135
- <Avatar size="md" type="initials">
136
- HM
137
- </Avatar>
138
- ),
122
+ list: <AvatarView profileName="Henry Mike" />,
139
123
  },
140
124
  'aria-label': 'Click here to send money to Hank Miller.',
141
125
  title: 'Hank Miller',
@@ -152,11 +136,7 @@ export const grid = () => {
152
136
  alt=""
153
137
  />
154
138
  ),
155
- list: (
156
- <Avatar size="md" type="initials">
157
- HM
158
- </Avatar>
159
- ),
139
+ list: <AvatarView profileName="Henry Mike" />,
160
140
  },
161
141
  'aria-label': 'Click here to send money to Hank Miller.',
162
142
  disabled,
@@ -175,11 +155,7 @@ export const grid = () => {
175
155
  alt=""
176
156
  />
177
157
  ),
178
- list: (
179
- <Avatar size="md" type="initials">
180
- HM
181
- </Avatar>
182
- ),
158
+ list: <AvatarView profileName="Henry Mike" />,
183
159
  },
184
160
  'aria-label': 'Click here to send money to Hank Miller.',
185
161
  title: 'Hank Miller',
@@ -197,11 +173,7 @@ export const grid = () => {
197
173
  alt=""
198
174
  />
199
175
  ),
200
- list: (
201
- <Avatar size="md" type="initials">
202
- HM
203
- </Avatar>
204
- ),
176
+ list: <AvatarView profileName="Henry Mike" />,
205
177
  },
206
178
  'aria-label': 'Click here to send money to Hank Miller.',
207
179
  title: 'Hank Miller',
@@ -219,11 +191,7 @@ export const grid = () => {
219
191
  alt=""
220
192
  />
221
193
  ),
222
- list: (
223
- <Avatar size="md" type="initials">
224
- HM
225
- </Avatar>
226
- ),
194
+ list: <AvatarView profileName="Henry Mike" />,
227
195
  },
228
196
  'aria-label': 'Click here to send money to Hank Miller.',
229
197
  title: 'Hank Miller',
@@ -241,11 +209,7 @@ export const grid = () => {
241
209
  alt=""
242
210
  />
243
211
  ),
244
- list: (
245
- <Avatar size="md" type="initials">
246
- HM
247
- </Avatar>
248
- ),
212
+ list: <AvatarView profileName="Henry Mike" />,
249
213
  },
250
214
  'aria-label': 'Click here to send money to Hank Miller.',
251
215
  title: 'Hank Miller',
@@ -1,5 +1,5 @@
1
- import Avatar, { AvatarType } from '../avatar';
2
- import { Breakpoint, Size } from '../common';
1
+ import AvatarView from '../avatarView';
2
+ import { Breakpoint } from '../common';
3
3
  import { mockMatchMedia, render, screen } from '../test-utils';
4
4
 
5
5
  import FlowNavigation from './FlowNavigation';
@@ -22,11 +22,7 @@ describe('FlowNavigation', () => {
22
22
  });
23
23
 
24
24
  const props = {
25
- avatar: (
26
- <Avatar type={AvatarType.INITIALS} size={Size.MEDIUM}>
27
- TM
28
- </Avatar>
29
- ),
25
+ avatar: <AvatarView profileName="Tim Mike" />,
30
26
  logo: <img alt="logo" src="logo.svg" width="138" height="24" />,
31
27
  onClose: jest.fn(),
32
28
  steps: [
@@ -46,10 +46,12 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
46
46
  class="np-flow-header__right d-flex align-items-center justify-content-end order-2--lg"
47
47
  >
48
48
  <div
49
- class="tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
49
+ class="np-circle d-flex align-items-center justify-content-center np-avatar-view np-avatar-view-non-interactive"
50
+ style="--circle-size: 48px; --circle-icon-size: 24px; --circle-font-size: 22px;"
50
51
  >
51
52
  <div
52
- class="tw-avatar__content"
53
+ class="np-circle np-circle-border d-flex align-items-center justify-content-center np-avatar-view-content"
54
+ style="--circle-size: 48px; --circle-icon-size: 24px; --circle-font-size: 22px;"
53
55
  >
54
56
  TM
55
57
  </div>
@@ -162,10 +164,12 @@ exports[`FlowNavigation renders as expected 1`] = `
162
164
  class="np-flow-header__right d-flex align-items-center justify-content-end order-2--lg"
163
165
  >
164
166
  <div
165
- class="tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
167
+ class="np-circle d-flex align-items-center justify-content-center np-avatar-view np-avatar-view-non-interactive"
168
+ style="--circle-size: 48px; --circle-icon-size: 24px; --circle-font-size: 22px;"
166
169
  >
167
170
  <div
168
- class="tw-avatar__content"
171
+ class="np-circle np-circle-border d-flex align-items-center justify-content-center np-avatar-view-content"
172
+ style="--circle-size: 48px; --circle-icon-size: 24px; --circle-font-size: 22px;"
169
173
  >
170
174
  TM
171
175
  </div>
package/src/main.css CHANGED
@@ -34,10 +34,6 @@
34
34
  margin-left: var(--padding-small);
35
35
  }
36
36
  }
37
- .tw-date-lookup-calendar > tbody > tr > td.weekend button {
38
- font-size: 0.875rem;
39
- font-size: var(--font-size-14);line-height: 155%;letter-spacing: -0.006em;font-weight: 400;font-weight: var(--font-weight-regular);
40
- }
41
37
  @media (min-width: 768px) {
42
38
  }
43
39
  @media (min-width: 768px) {
@@ -7,10 +7,11 @@ import {
7
7
  PlusCircle,
8
8
  Profile,
9
9
  UpwardGraph as UpwardGraphIcon,
10
+ FastFlag,
10
11
  } from '@transferwise/icons';
11
12
  import { Illustration, Assets, Flag } from '@wise/art';
12
13
 
13
- import { Badge, Nudge, Avatar, Header, Title, Typography } from '..';
14
+ import { Nudge, Header, Title, Typography, AvatarView } from '..';
14
15
 
15
16
  import NavigationOption from './NavigationOption';
16
17
 
@@ -85,11 +86,9 @@ export const Variants = () => (
85
86
  <Template
86
87
  showMediaCircle={false}
87
88
  media={
88
- <Badge badge={<PlusCircle className="tw-contacts__new-contact-badge" />}>
89
- <Avatar type="icon">
90
- <Profile size="24" />
91
- </Avatar>
92
- </Badge>
89
+ <AvatarView badge={{ type: 'reference' }}>
90
+ <Profile />
91
+ </AvatarView>
93
92
  }
94
93
  />
95
94
  </div>
@@ -98,20 +97,13 @@ export const Variants = () => (
98
97
  <Template
99
98
  showMediaCircle={false}
100
99
  media={
101
- <Badge
102
- badge={
103
- <img
104
- src="https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg"
105
- alt=""
106
- height="24px"
107
- width="24px"
108
- />
109
- }
110
- >
111
- <Avatar type="initials" size="md">
112
- <span aria-hidden>SP</span>
113
- </Avatar>
114
- </Badge>
100
+ <AvatarView
101
+ badge={{
102
+ icon: <FastFlag />,
103
+ type: 'action',
104
+ }}
105
+ profileName="Spencer Penn"
106
+ />
115
107
  }
116
108
  />
117
109
  </div>
@@ -125,20 +117,13 @@ export const Variants = () => (
125
117
  <Template
126
118
  showMediaCircle
127
119
  media={
128
- <Badge
129
- badge={
130
- <img
131
- src="https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg"
132
- alt=""
133
- height="24px"
134
- width="24px"
135
- />
136
- }
137
- >
138
- <Avatar type="initials" size="md">
139
- <span aria-hidden>SP</span>
140
- </Avatar>
141
- </Badge>
120
+ <AvatarView
121
+ badge={{
122
+ icon: <FastFlag />,
123
+ type: 'action',
124
+ }}
125
+ profileName="Spencer Penn"
126
+ />
142
127
  }
143
128
  />
144
129
  </div>
@@ -222,9 +207,9 @@ export const BalanceContent = () => (
222
207
  content="British pound"
223
208
  showMediaCircle={false}
224
209
  media={
225
- <Avatar type="icon">
210
+ <AvatarView>
226
211
  <Flag code="GBP" />
227
- </Avatar>
212
+ </AvatarView>
228
213
  }
229
214
  />
230
215
  );
@@ -234,11 +219,9 @@ export const NewContactContent = () => (
234
219
  title="New Contact"
235
220
  showMediaCircle={false}
236
221
  media={
237
- <Badge badge={<PlusCircle className="tw-contacts__new-contact-badge" />}>
238
- <Avatar type="icon">
239
- <Profile size="24" />
240
- </Avatar>
241
- </Badge>
222
+ <AvatarView badge={{ type: 'reference' }}>
223
+ <Profile size="24" />
224
+ </AvatarView>
242
225
  }
243
226
  />
244
227
  );
@@ -248,13 +231,7 @@ export const ExistingContactContent = () => (
248
231
  title="Wise Customer"
249
232
  content="EUR account ending in 1111"
250
233
  showMediaCircle={false}
251
- media={
252
- <Badge badge={<Flag code="EUR" />}>
253
- <Avatar type="initials" size="md">
254
- <span aria-hidden>WS</span>
255
- </Avatar>
256
- </Badge>
257
- }
234
+ media={<AvatarView profileName="Walter Smith" badge={{ flagCode: 'EUR' }} />}
258
235
  />
259
236
  );
260
237
 
@@ -280,9 +257,9 @@ export const ManageAccountContent = () => (
280
257
  content="View and share your account details to get paid."
281
258
  showMediaCircle={false}
282
259
  media={
283
- <Avatar type="icon">
284
- <BankIcon size={24} />
285
- </Avatar>
260
+ <AvatarView>
261
+ <BankIcon />
262
+ </AvatarView>
286
263
  }
287
264
  />
288
265
  <NavigationOptionTemplate
@@ -290,9 +267,9 @@ export const ManageAccountContent = () => (
290
267
  content="Convert money between your balances at your desired exchange rate."
291
268
  showMediaCircle={false}
292
269
  media={
293
- <Avatar type="icon">
270
+ <AvatarView>
294
271
  <UpwardGraphIcon size={24} />
295
- </Avatar>
272
+ </AvatarView>
296
273
  }
297
274
  />
298
275
  </>
@@ -1,16 +1,13 @@
1
- import Avatar, { AvatarType } from '../avatar';
2
- import { Size } from '../common';
3
- import { render } from '../test-utils';
1
+ import { render, mockMatchMedia } from '../test-utils';
4
2
 
5
3
  import OverlayHeader from '.';
4
+ import AvatarView from '../avatarView';
5
+
6
+ mockMatchMedia();
6
7
 
7
8
  describe('OverlayHeader', () => {
8
9
  const props = {
9
- avatar: (
10
- <Avatar type={AvatarType.INITIALS} size={Size.MEDIUM}>
11
- TM
12
- </Avatar>
13
- ),
10
+ avatar: <AvatarView profileName="Tim Morris" />,
14
11
  logo: <img alt="logo_desktop" src="img_desktop" width="138" height="24" />,
15
12
  onClose: jest.fn(),
16
13
  };
@@ -18,10 +18,12 @@ exports[`OverlayHeader renders as expected 1`] = `
18
18
  class="d-flex align-items-center order-2"
19
19
  >
20
20
  <div
21
- class="tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
21
+ class="np-circle d-flex align-items-center justify-content-center np-avatar-view np-avatar-view-non-interactive"
22
+ style="--circle-size: 48px; --circle-icon-size: 24px; --circle-font-size: 22px;"
22
23
  >
23
24
  <div
24
- class="tw-avatar__content"
25
+ class="np-circle np-circle-border d-flex align-items-center justify-content-center np-avatar-view-content"
26
+ style="--circle-size: 48px; --circle-icon-size: 24px; --circle-font-size: 22px;"
25
27
  >
26
28
  TM
27
29
  </div>
@@ -1,8 +1,10 @@
1
- import { render, fireEvent, screen } from '../test-utils';
1
+ import { render, fireEvent, screen, mockMatchMedia } from '../test-utils';
2
2
  import React from 'react';
3
3
 
4
4
  import PromoCard, { PromoCardProps, PromoCardCheckedProps, PromoCardLinkProps } from './PromoCard';
5
5
 
6
+ mockMatchMedia();
7
+
6
8
  describe('PromoCard', () => {
7
9
  const defaultProps = {
8
10
  title: 'Test Title',
@@ -2,9 +2,9 @@ import { ArrowRight, Check, Download } from '@transferwise/icons';
2
2
  import { clsx } from 'clsx';
3
3
  import { ReactElement, ReactNode } from 'react';
4
4
 
5
- import Avatar, { AvatarType } from '../avatar';
6
5
  import Body from '../body';
7
6
  import { Typography } from '../common';
7
+ import AvatarView from '../avatarView';
8
8
 
9
9
  export type PromoCardIndicatorProps = {
10
10
  /** Optional class name(s) to add to the indicator container. */
@@ -69,14 +69,14 @@ const PromoCardIndicator: React.FC<PromoCardIndicatorProps> = ({
69
69
  </Body>
70
70
  )}
71
71
  {icon && (
72
- <Avatar
73
- type={AvatarType.ICON}
72
+ <AvatarView
73
+ interactive
74
74
  size={isSmall ? 40 : 56}
75
- backgroundColor="var(--Card-indicator-icon-background-color)"
75
+ style={{ backgroundColor: 'var(--Card-indicator-icon-background-color)' }}
76
76
  className="np-Card-indicatorIcon"
77
77
  >
78
78
  {IconComponent ? <IconComponent size={24} aria-hidden="true" /> : icon}
79
- </Avatar>
79
+ </AvatarView>
80
80
  )}
81
81
  {children}
82
82
  </div>
@@ -1,10 +1,10 @@
1
1
  import { action } from '@storybook/addon-actions';
2
2
  import { text, boolean } from '@storybook/addon-knobs';
3
3
 
4
- import Avatar from '../avatar';
5
4
  import { Size } from '../common';
6
5
 
7
6
  import Tile from '.';
7
+ import AvatarView from '../avatarView';
8
8
 
9
9
  export default {
10
10
  component: Tile,
@@ -41,11 +41,7 @@ export const Basic = () => {
41
41
  description={description}
42
42
  disabled={disabled}
43
43
  href="#href1"
44
- media={
45
- <Avatar size="md" type="initials">
46
- HM
47
- </Avatar>
48
- }
44
+ media={<AvatarView profileName="Henry Morris" />}
49
45
  size={medium ? Size.MEDIUM : Size.SMALL}
50
46
  title={title}
51
47
  onClick={action('onClick')}