@transferwise/components 0.0.0-experimental-0c9f5bb → 0.0.0-experimental-238cf3d

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.
@@ -3,59 +3,32 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var clsx = require('clsx');
6
- var logoAssets$1 = require('./logo-assets.js');
7
- require('../common/theme.js');
8
- require('../common/direction.js');
9
- require('../common/propsValues/control.js');
10
- var breakpoint = require('../common/propsValues/breakpoint.js');
11
- require('../common/propsValues/size.js');
12
- require('../common/propsValues/typography.js');
13
- require('../common/propsValues/width.js');
14
- require('../common/propsValues/type.js');
15
- require('../common/propsValues/dateMode.js');
16
- require('../common/propsValues/monthFormat.js');
17
- require('../common/propsValues/position.js');
18
- require('../common/propsValues/layouts.js');
19
- require('../common/propsValues/status.js');
20
- require('../common/propsValues/sentiment.js');
21
- require('../common/propsValues/profileType.js');
22
- require('../common/propsValues/variant.js');
23
- require('../common/propsValues/scroll.js');
24
- require('../common/propsValues/markdownNodeType.js');
25
- require('../common/fileType.js');
26
- require('@transferwise/formatting');
27
- require('@transferwise/icons');
28
- require('react');
29
- require('react-intl');
30
- require('../common/closeButton/CloseButton.messages.js');
6
+ var logoAssets = require('./logo-assets.js');
31
7
  var jsxRuntime = require('react/jsx-runtime');
32
- var useScreenSize = require('../common/hooks/useScreenSize.js');
33
8
 
9
+ const svgPaths = {
10
+ WISE: logoAssets.LogoWise,
11
+ WISE_BUSINESS: logoAssets.LogoWise,
12
+ WISE_INVERSE: logoAssets.LogoWiseInverse,
13
+ WISE_BUSINESS_INVERSE: logoAssets.LogoWiseInverse,
14
+ WISE_PLATFORM: logoAssets.LogoWisePlatform,
15
+ WISE_PLATFORM_INVERSE: logoAssets.LogoWisePlatformInverse,
16
+ WISE_FLAG: logoAssets.LogoFlag,
17
+ WISE_FLAG_INVERSE: logoAssets.LogoFlagInverse,
18
+ WISE_FLAG_PLATFORM: logoAssets.LogoFlagPlatform,
19
+ WISE_FLAG_PLATFORM_INVERSE: logoAssets.LogoFlagPlatformInverse
20
+ };
34
21
  exports.LogoType = void 0;
35
22
  (function (LogoType) {
36
23
  LogoType["WISE"] = "WISE";
37
24
  LogoType["WISE_BUSINESS"] = "WISE_BUSINESS";
38
25
  LogoType["WISE_PLATFORM"] = "WISE_PLATFORM";
39
26
  })(exports.LogoType || (exports.LogoType = {}));
40
- exports.LogoDisplay = void 0;
41
- (function (LogoDisplay) {
42
- LogoDisplay["RESPONSIVE"] = "responsive";
43
- LogoDisplay["COMPACT"] = "compact";
44
- LogoDisplay["FULL"] = "full";
45
- })(exports.LogoDisplay || (exports.LogoDisplay = {}));
46
27
  const labelByType = {
47
28
  WISE: 'Wise',
48
29
  WISE_BUSINESS: 'Wise Business',
49
30
  WISE_PLATFORM: 'Wise Platform'
50
31
  };
51
- const logoAssets = {
52
- FastFlag: logoAssets$1.FastFlag,
53
- WiseLogo: logoAssets$1.WiseLogo,
54
- WiseBusinessPrimary: logoAssets$1.WiseBusinessPrimary,
55
- WiseBusinessSecondary: logoAssets$1.WiseBusinessSecondary,
56
- WisePlatformPrimary: logoAssets$1.WisePlatformPrimary,
57
- WisePlatformSecondary: logoAssets$1.WisePlatformSecondary
58
- };
59
32
  /**
60
33
  * Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports
61
34
  * and the full wordmark on ≥576px (small breakpoint and above).
@@ -64,40 +37,22 @@ const logoAssets = {
64
37
  */
65
38
  function Logo({
66
39
  className,
67
- type = 'WISE',
68
- lockup = false,
69
- secondary = false,
70
- display = 'responsive',
71
- 'aria-label': ariaLabel
40
+ inverse,
41
+ type = 'WISE'
72
42
  }) {
73
- const isScreenSm = !useScreenSize.useScreenSize(breakpoint.Breakpoint.SMALL);
74
- const compact = display === 'compact' || display === 'responsive' && isScreenSm;
75
- const assetName = compact ? 'FastFlag' : getAssetName(type, lockup, secondary);
76
- const Asset = logoAssets[assetName];
77
- const {
78
- width,
79
- height
80
- } = logoAssets$1.logoAssetsDimensions[assetName];
81
- return /*#__PURE__*/jsxRuntime.jsx("span", {
82
- className: clsx.clsx('np-logo', className),
43
+ const LogoSm = svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];
44
+ const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];
45
+ return /*#__PURE__*/jsxRuntime.jsxs("span", {
46
+ "aria-label": labelByType[type],
83
47
  role: "img",
84
- "aria-label": ariaLabel ?? labelByType[type],
85
- style: {
86
- '--wds-logo-width': `${width}px`,
87
- '--wds-logo-height': `${height}px`
88
- },
89
- children: /*#__PURE__*/jsxRuntime.jsx(Asset, {})
48
+ className: clsx.clsx(className, 'np-logo'),
49
+ children: [/*#__PURE__*/jsxRuntime.jsx(LogoSm, {
50
+ className: "np-logo-svg np-logo-svg--size-sm"
51
+ }), /*#__PURE__*/jsxRuntime.jsx(LogoMd, {
52
+ className: "np-logo-svg np-logo-svg--size-md"
53
+ })]
90
54
  });
91
55
  }
92
- function getAssetName(type, lockup, secondary) {
93
- if (type === 'WISE_BUSINESS' && lockup) {
94
- return secondary ? 'WiseBusinessSecondary' : 'WiseBusinessPrimary';
95
- }
96
- if (type === 'WISE_PLATFORM' && lockup) {
97
- return secondary ? 'WisePlatformSecondary' : 'WisePlatformPrimary';
98
- }
99
- return 'WiseLogo';
100
- }
101
56
 
102
57
  exports.default = Logo;
103
58
  //# sourceMappingURL=Logo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Logo.js","sources":["../../src/logo/Logo.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport {\n WiseLogo,\n WiseBusinessPrimary,\n WiseBusinessSecondary,\n WisePlatformPrimary,\n WisePlatformSecondary,\n FastFlag,\n logoAssetsDimensions,\n} from './logo-assets';\nimport type { LogoAssetName } from './logo-assets';\nimport { Breakpoint } from '../common';\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport { AriaAttributes } from 'react';\n\nexport enum LogoType {\n WISE = 'WISE',\n WISE_BUSINESS = 'WISE_BUSINESS',\n WISE_PLATFORM = 'WISE_PLATFORM',\n}\n\nexport enum LogoDisplay {\n RESPONSIVE = 'responsive',\n COMPACT = 'compact',\n FULL = 'full',\n}\n\nexport interface LogoProps {\n /** Extra classes applied to Logo */\n className?: string;\n /**\n * Renders a light-coloured version suited for dark backgrounds.\n * @default false\n * @deprecated dark mode comes out of the box, this property has no effect\n */\n inverse?: boolean;\n /**\n * What type of logo to display\n * @default 'WISE'\n */\n type?: `${LogoType}`;\n /**\n * Controls which logo variant is shown.\n * - `\"responsive\"` (default): full wordmark on large screens, fast-flag mark on small screens (<600 px).\n * - `\"compact\"`: always renders the fast-flag mark regardless of screen size.\n * - `\"full\"`: always renders the full wordmark/lockup regardless of screen size.\n * @default 'responsive'\n */\n display?: `${LogoDisplay}`;\n /**\n * Show the product name alongside the Wise wordmark (e.g. \"Wise Business\", \"Wise Platform\").\n * @default false\n */\n lockup?: boolean;\n /**\n * Use the stacked (two-line) logo variant. Requires `lockup` to be true.\n * @default false\n */\n secondary?: boolean;\n /**\n * Override default ({@link labelByType}) screen reader messages\n */\n 'aria-label'?: AriaAttributes['aria-label'];\n}\n\nconst labelByType = {\n WISE: 'Wise',\n WISE_BUSINESS: 'Wise Business',\n WISE_PLATFORM: 'Wise Platform',\n} satisfies Record<`${LogoType}`, string>;\n\nconst logoAssets: Record<LogoAssetName, () => JSX.Element> = {\n FastFlag,\n WiseLogo,\n WiseBusinessPrimary,\n WiseBusinessSecondary,\n WisePlatformPrimary,\n WisePlatformSecondary,\n};\n\n/**\n * Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports\n * and the full wordmark on ≥576px (small breakpoint and above).\n *\n * @see {@link https://wise.design/foundations/logo Design Spec}\n */\nexport default function Logo({\n className,\n type = 'WISE',\n lockup = false,\n secondary = false,\n display = 'responsive',\n 'aria-label': ariaLabel,\n}: LogoProps) {\n const isScreenSm = !useScreenSize(Breakpoint.SMALL);\n const compact = display === 'compact' || (display === 'responsive' && isScreenSm);\n\n const assetName = compact ? 'FastFlag' : getAssetName(type, lockup, secondary);\n const Asset = logoAssets[assetName];\n const { width, height } = logoAssetsDimensions[assetName];\n\n return (\n <span\n className={clsx('np-logo', className)}\n role=\"img\"\n aria-label={ariaLabel ?? labelByType[type]}\n style={\n {\n '--wds-logo-width': `${width}px`,\n '--wds-logo-height': `${height}px`,\n } as React.CSSProperties\n }\n >\n <Asset />\n </span>\n );\n}\n\nfunction getAssetName(type: `${LogoType}`, lockup: boolean, secondary: boolean): LogoAssetName {\n if (type === 'WISE_BUSINESS' && lockup) {\n return secondary ? 'WiseBusinessSecondary' : 'WiseBusinessPrimary';\n }\n if (type === 'WISE_PLATFORM' && lockup) {\n return secondary ? 'WisePlatformSecondary' : 'WisePlatformPrimary';\n }\n return 'WiseLogo';\n}\n"],"names":["LogoType","LogoDisplay","labelByType","WISE","WISE_BUSINESS","WISE_PLATFORM","logoAssets","FastFlag","WiseLogo","WiseBusinessPrimary","WiseBusinessSecondary","WisePlatformPrimary","WisePlatformSecondary","Logo","className","type","lockup","secondary","display","ariaLabel","isScreenSm","useScreenSize","Breakpoint","SMALL","compact","assetName","getAssetName","Asset","width","height","logoAssetsDimensions","_jsx","clsx","role","style","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBYA;AAAZ,CAAA,UAAYA,QAAQ,EAAA;AAClBA,EAAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACbA,EAAAA,QAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/BA,EAAAA,QAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AACjC,CAAC,EAJWA,gBAAQ,KAARA,gBAAQ,GAAA,EAAA,CAAA,CAAA;AAMRC;AAAZ,CAAA,UAAYA,WAAW,EAAA;AACrBA,EAAAA,WAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzBA,EAAAA,WAA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,CAAE;AAC3CmB,IAAAA,KAAK,EACH;MACE,kBAAkB,EAAE,CAAA,EAAGN,KAAK,CAAA,EAAA,CAAI;MAChC,mBAAmB,EAAE,GAAGC,MAAM,CAAA,EAAA;KAEjC;AAAAM,IAAAA,QAAA,eAEDJ,cAAA,CAACJ,KAAK,EAAA,EAAA;AACR,GAAM,CAAC;AAEX;AAEA,SAASD,YAAYA,CAACX,IAAmB,EAAEC,MAAe,EAAEC,SAAkB,EAAA;AAC5E,EAAA,IAAIF,IAAI,KAAK,eAAe,IAAIC,MAAM,EAAE;AACtC,IAAA,OAAOC,SAAS,GAAG,uBAAuB,GAAG,qBAAqB;AACpE,EAAA;AACA,EAAA,IAAIF,IAAI,KAAK,eAAe,IAAIC,MAAM,EAAE;AACtC,IAAA,OAAOC,SAAS,GAAG,uBAAuB,GAAG,qBAAqB;AACpE,EAAA;AACA,EAAA,OAAO,UAAU;AACnB;;;;"}
1
+ {"version":3,"file":"Logo.js","sources":["../../src/logo/Logo.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport {\n LogoWise,\n LogoWiseInverse,\n LogoWisePlatform,\n LogoWisePlatformInverse,\n LogoFlag,\n LogoFlagInverse,\n LogoFlagPlatform,\n LogoFlagPlatformInverse,\n} from './logo-assets';\n\nconst svgPaths = {\n WISE: LogoWise,\n WISE_BUSINESS: LogoWise,\n WISE_INVERSE: LogoWiseInverse,\n WISE_BUSINESS_INVERSE: LogoWiseInverse,\n WISE_PLATFORM: LogoWisePlatform,\n WISE_PLATFORM_INVERSE: LogoWisePlatformInverse,\n WISE_FLAG: LogoFlag,\n WISE_FLAG_INVERSE: LogoFlagInverse,\n WISE_FLAG_PLATFORM: LogoFlagPlatform,\n WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse,\n};\n\nexport enum LogoType {\n WISE = 'WISE',\n WISE_BUSINESS = 'WISE_BUSINESS',\n WISE_PLATFORM = 'WISE_PLATFORM',\n}\n\nexport interface LogoProps {\n /** Extra classes applied to Logo */\n className?: string;\n /**\n * Renders a light-coloured version suited for dark backgrounds.\n * @default false\n */\n inverse?: boolean;\n /**\n * What type of logo to display\n * @default 'WISE'\n */\n type?: `${LogoType}`;\n}\n\nconst labelByType = {\n WISE: 'Wise',\n WISE_BUSINESS: 'Wise Business',\n WISE_PLATFORM: 'Wise Platform',\n} satisfies Record<`${LogoType}`, string>;\n\n/**\n * Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports\n * and the full wordmark on ≥576px (small breakpoint and above).\n *\n * @see {@link https://wise.design/foundations/logo Design Spec}\n */\nexport default function Logo({ className, inverse, type = 'WISE' }: LogoProps) {\n const LogoSm =\n svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];\n const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];\n\n return (\n <span aria-label={labelByType[type]} role=\"img\" className={clsx(className, 'np-logo')}>\n <LogoSm className=\"np-logo-svg np-logo-svg--size-sm\" />\n <LogoMd className=\"np-logo-svg np-logo-svg--size-md\" />\n </span>\n );\n}\n"],"names":["svgPaths","WISE","LogoWise","WISE_BUSINESS","WISE_INVERSE","LogoWiseInverse","WISE_BUSINESS_INVERSE","WISE_PLATFORM","LogoWisePlatform","WISE_PLATFORM_INVERSE","LogoWisePlatformInverse","WISE_FLAG","LogoFlag","WISE_FLAG_INVERSE","LogoFlagInverse","WISE_FLAG_PLATFORM","LogoFlagPlatform","WISE_FLAG_PLATFORM_INVERSE","LogoFlagPlatformInverse","LogoType","labelByType","Logo","className","inverse","type","LogoSm","LogoMd","_jsxs","role","clsx","children","_jsx"],"mappings":";;;;;;;;AAaA,MAAMA,QAAQ,GAAG;AACfC,EAAAA,IAAI,EAAEC,mBAAQ;AACdC,EAAAA,aAAa,EAAED,mBAAQ;AACvBE,EAAAA,YAAY,EAAEC,0BAAe;AAC7BC,EAAAA,qBAAqB,EAAED,0BAAe;AACtCE,EAAAA,aAAa,EAA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SAAS,EAAC;AAAkC,KAAA,CACpD,eAAAS,cAAA,CAACL,MAAM,EAAA;AAACJ,MAAAA,SAAS,EAAC;AAAkC,KAAA,CACtD;AAAA,GAAM,CAAC;AAEX;;;;"}
@@ -1,57 +1,30 @@
1
1
  import { clsx } from 'clsx';
2
- import { logoAssetsDimensions, WisePlatformSecondary, WisePlatformPrimary, WiseBusinessSecondary, WiseBusinessPrimary, WiseLogo, FastFlag } from './logo-assets.mjs';
3
- import '../common/theme.mjs';
4
- import '../common/direction.mjs';
5
- import '../common/propsValues/control.mjs';
6
- import { Breakpoint } from '../common/propsValues/breakpoint.mjs';
7
- import '../common/propsValues/size.mjs';
8
- import '../common/propsValues/typography.mjs';
9
- import '../common/propsValues/width.mjs';
10
- import '../common/propsValues/type.mjs';
11
- import '../common/propsValues/dateMode.mjs';
12
- import '../common/propsValues/monthFormat.mjs';
13
- import '../common/propsValues/position.mjs';
14
- import '../common/propsValues/layouts.mjs';
15
- import '../common/propsValues/status.mjs';
16
- import '../common/propsValues/sentiment.mjs';
17
- import '../common/propsValues/profileType.mjs';
18
- import '../common/propsValues/variant.mjs';
19
- import '../common/propsValues/scroll.mjs';
20
- import '../common/propsValues/markdownNodeType.mjs';
21
- import '../common/fileType.mjs';
22
- import '@transferwise/formatting';
23
- import '@transferwise/icons';
24
- import 'react';
25
- import 'react-intl';
26
- import '../common/closeButton/CloseButton.messages.mjs';
27
- import { jsx } from 'react/jsx-runtime';
28
- import { useScreenSize } from '../common/hooks/useScreenSize.mjs';
2
+ import { LogoFlagPlatformInverse, LogoFlagPlatform, LogoFlagInverse, LogoFlag, LogoWisePlatformInverse, LogoWisePlatform, LogoWiseInverse, LogoWise } from './logo-assets.mjs';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
29
4
 
5
+ const svgPaths = {
6
+ WISE: LogoWise,
7
+ WISE_BUSINESS: LogoWise,
8
+ WISE_INVERSE: LogoWiseInverse,
9
+ WISE_BUSINESS_INVERSE: LogoWiseInverse,
10
+ WISE_PLATFORM: LogoWisePlatform,
11
+ WISE_PLATFORM_INVERSE: LogoWisePlatformInverse,
12
+ WISE_FLAG: LogoFlag,
13
+ WISE_FLAG_INVERSE: LogoFlagInverse,
14
+ WISE_FLAG_PLATFORM: LogoFlagPlatform,
15
+ WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse
16
+ };
30
17
  var LogoType;
31
18
  (function (LogoType) {
32
19
  LogoType["WISE"] = "WISE";
33
20
  LogoType["WISE_BUSINESS"] = "WISE_BUSINESS";
34
21
  LogoType["WISE_PLATFORM"] = "WISE_PLATFORM";
35
22
  })(LogoType || (LogoType = {}));
36
- var LogoDisplay;
37
- (function (LogoDisplay) {
38
- LogoDisplay["RESPONSIVE"] = "responsive";
39
- LogoDisplay["COMPACT"] = "compact";
40
- LogoDisplay["FULL"] = "full";
41
- })(LogoDisplay || (LogoDisplay = {}));
42
23
  const labelByType = {
43
24
  WISE: 'Wise',
44
25
  WISE_BUSINESS: 'Wise Business',
45
26
  WISE_PLATFORM: 'Wise Platform'
46
27
  };
47
- const logoAssets = {
48
- FastFlag,
49
- WiseLogo,
50
- WiseBusinessPrimary,
51
- WiseBusinessSecondary,
52
- WisePlatformPrimary,
53
- WisePlatformSecondary
54
- };
55
28
  /**
56
29
  * Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports
57
30
  * and the full wordmark on ≥576px (small breakpoint and above).
@@ -60,40 +33,22 @@ const logoAssets = {
60
33
  */
61
34
  function Logo({
62
35
  className,
63
- type = 'WISE',
64
- lockup = false,
65
- secondary = false,
66
- display = 'responsive',
67
- 'aria-label': ariaLabel
36
+ inverse,
37
+ type = 'WISE'
68
38
  }) {
69
- const isScreenSm = !useScreenSize(Breakpoint.SMALL);
70
- const compact = display === 'compact' || display === 'responsive' && isScreenSm;
71
- const assetName = compact ? 'FastFlag' : getAssetName(type, lockup, secondary);
72
- const Asset = logoAssets[assetName];
73
- const {
74
- width,
75
- height
76
- } = logoAssetsDimensions[assetName];
77
- return /*#__PURE__*/jsx("span", {
78
- className: clsx('np-logo', className),
39
+ const LogoSm = svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];
40
+ const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];
41
+ return /*#__PURE__*/jsxs("span", {
42
+ "aria-label": labelByType[type],
79
43
  role: "img",
80
- "aria-label": ariaLabel ?? labelByType[type],
81
- style: {
82
- '--wds-logo-width': `${width}px`,
83
- '--wds-logo-height': `${height}px`
84
- },
85
- children: /*#__PURE__*/jsx(Asset, {})
44
+ className: clsx(className, 'np-logo'),
45
+ children: [/*#__PURE__*/jsx(LogoSm, {
46
+ className: "np-logo-svg np-logo-svg--size-sm"
47
+ }), /*#__PURE__*/jsx(LogoMd, {
48
+ className: "np-logo-svg np-logo-svg--size-md"
49
+ })]
86
50
  });
87
51
  }
88
- function getAssetName(type, lockup, secondary) {
89
- if (type === 'WISE_BUSINESS' && lockup) {
90
- return secondary ? 'WiseBusinessSecondary' : 'WiseBusinessPrimary';
91
- }
92
- if (type === 'WISE_PLATFORM' && lockup) {
93
- return secondary ? 'WisePlatformSecondary' : 'WisePlatformPrimary';
94
- }
95
- return 'WiseLogo';
96
- }
97
52
 
98
- export { LogoDisplay, LogoType, Logo as default };
53
+ export { LogoType, Logo as default };
99
54
  //# sourceMappingURL=Logo.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Logo.mjs","sources":["../../src/logo/Logo.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport {\n WiseLogo,\n WiseBusinessPrimary,\n WiseBusinessSecondary,\n WisePlatformPrimary,\n WisePlatformSecondary,\n FastFlag,\n logoAssetsDimensions,\n} from './logo-assets';\nimport type { LogoAssetName } from './logo-assets';\nimport { Breakpoint } from '../common';\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport { AriaAttributes } from 'react';\n\nexport enum LogoType {\n WISE = 'WISE',\n WISE_BUSINESS = 'WISE_BUSINESS',\n WISE_PLATFORM = 'WISE_PLATFORM',\n}\n\nexport enum LogoDisplay {\n RESPONSIVE = 'responsive',\n COMPACT = 'compact',\n FULL = 'full',\n}\n\nexport interface LogoProps {\n /** Extra classes applied to Logo */\n className?: string;\n /**\n * Renders a light-coloured version suited for dark backgrounds.\n * @default false\n * @deprecated dark mode comes out of the box, this property has no effect\n */\n inverse?: boolean;\n /**\n * What type of logo to display\n * @default 'WISE'\n */\n type?: `${LogoType}`;\n /**\n * Controls which logo variant is shown.\n * - `\"responsive\"` (default): full wordmark on large screens, fast-flag mark on small screens (<600 px).\n * - `\"compact\"`: always renders the fast-flag mark regardless of screen size.\n * - `\"full\"`: always renders the full wordmark/lockup regardless of screen size.\n * @default 'responsive'\n */\n display?: `${LogoDisplay}`;\n /**\n * Show the product name alongside the Wise wordmark (e.g. \"Wise Business\", \"Wise Platform\").\n * @default false\n */\n lockup?: boolean;\n /**\n * Use the stacked (two-line) logo variant. Requires `lockup` to be true.\n * @default false\n */\n secondary?: boolean;\n /**\n * Override default ({@link labelByType}) screen reader messages\n */\n 'aria-label'?: AriaAttributes['aria-label'];\n}\n\nconst labelByType = {\n WISE: 'Wise',\n WISE_BUSINESS: 'Wise Business',\n WISE_PLATFORM: 'Wise Platform',\n} satisfies Record<`${LogoType}`, string>;\n\nconst logoAssets: Record<LogoAssetName, () => JSX.Element> = {\n FastFlag,\n WiseLogo,\n WiseBusinessPrimary,\n WiseBusinessSecondary,\n WisePlatformPrimary,\n WisePlatformSecondary,\n};\n\n/**\n * Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports\n * and the full wordmark on ≥576px (small breakpoint and above).\n *\n * @see {@link https://wise.design/foundations/logo Design Spec}\n */\nexport default function Logo({\n className,\n type = 'WISE',\n lockup = false,\n secondary = false,\n display = 'responsive',\n 'aria-label': ariaLabel,\n}: LogoProps) {\n const isScreenSm = !useScreenSize(Breakpoint.SMALL);\n const compact = display === 'compact' || (display === 'responsive' && isScreenSm);\n\n const assetName = compact ? 'FastFlag' : getAssetName(type, lockup, secondary);\n const Asset = logoAssets[assetName];\n const { width, height } = logoAssetsDimensions[assetName];\n\n return (\n <span\n className={clsx('np-logo', className)}\n role=\"img\"\n aria-label={ariaLabel ?? labelByType[type]}\n style={\n {\n '--wds-logo-width': `${width}px`,\n '--wds-logo-height': `${height}px`,\n } as React.CSSProperties\n }\n >\n <Asset />\n </span>\n );\n}\n\nfunction getAssetName(type: `${LogoType}`, lockup: boolean, secondary: boolean): LogoAssetName {\n if (type === 'WISE_BUSINESS' && lockup) {\n return secondary ? 'WiseBusinessSecondary' : 'WiseBusinessPrimary';\n }\n if (type === 'WISE_PLATFORM' && lockup) {\n return secondary ? 'WisePlatformSecondary' : 'WisePlatformPrimary';\n }\n return 'WiseLogo';\n}\n"],"names":["LogoType","LogoDisplay","labelByType","WISE","WISE_BUSINESS","WISE_PLATFORM","logoAssets","FastFlag","WiseLogo","WiseBusinessPrimary","WiseBusinessSecondary","WisePlatformPrimary","WisePlatformSecondary","Logo","className","type","lockup","secondary","display","ariaLabel","isScreenSm","useScreenSize","Breakpoint","SMALL","compact","assetName","getAssetName","Asset","width","height","logoAssetsDimensions","_jsx","clsx","role","style","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgBYA;AAAZ,CAAA,UAAYA,QAAQ,EAAA;AAClBA,EAAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACbA,EAAAA,QAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/BA,EAAAA,QAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AACjC,CAAC,EAJWA,QAAQ,KAARA,QAAQ,GAAA,EAAA,CAAA,CAAA;IAMRC;AAAZ,CAAA,UAAYA,WAAW,EAAA;AACrBA,EAAAA,WAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzBA,EAAAA,WAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnBA,EAAAA,WAAA,CAAA,M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CAAA,EAAA,CAAI;MAChC,mBAAmB,EAAE,GAAGC,MAAM,CAAA,EAAA;KAEjC;AAAAM,IAAAA,QAAA,eAEDJ,GAAA,CAACJ,KAAK,EAAA,EAAA;AACR,GAAM,CAAC;AAEX;AAEA,SAASD,YAAYA,CAACX,IAAmB,EAAEC,MAAe,EAAEC,SAAkB,EAAA;AAC5E,EAAA,IAAIF,IAAI,KAAK,eAAe,IAAIC,MAAM,EAAE;AACtC,IAAA,OAAOC,SAAS,GAAG,uBAAuB,GAAG,qBAAqB;AACpE,EAAA;AACA,EAAA,IAAIF,IAAI,KAAK,eAAe,IAAIC,MAAM,EAAE;AACtC,IAAA,OAAOC,SAAS,GAAG,uBAAuB,GAAG,qBAAqB;AACpE,EAAA;AACA,EAAA,OAAO,UAAU;AACnB;;;;"}
1
+ {"version":3,"file":"Logo.mjs","sources":["../../src/logo/Logo.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport {\n LogoWise,\n LogoWiseInverse,\n LogoWisePlatform,\n LogoWisePlatformInverse,\n LogoFlag,\n LogoFlagInverse,\n LogoFlagPlatform,\n LogoFlagPlatformInverse,\n} from './logo-assets';\n\nconst svgPaths = {\n WISE: LogoWise,\n WISE_BUSINESS: LogoWise,\n WISE_INVERSE: LogoWiseInverse,\n WISE_BUSINESS_INVERSE: LogoWiseInverse,\n WISE_PLATFORM: LogoWisePlatform,\n WISE_PLATFORM_INVERSE: LogoWisePlatformInverse,\n WISE_FLAG: LogoFlag,\n WISE_FLAG_INVERSE: LogoFlagInverse,\n WISE_FLAG_PLATFORM: LogoFlagPlatform,\n WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse,\n};\n\nexport enum LogoType {\n WISE = 'WISE',\n WISE_BUSINESS = 'WISE_BUSINESS',\n WISE_PLATFORM = 'WISE_PLATFORM',\n}\n\nexport interface LogoProps {\n /** Extra classes applied to Logo */\n className?: string;\n /**\n * Renders a light-coloured version suited for dark backgrounds.\n * @default false\n */\n inverse?: boolean;\n /**\n * What type of logo to display\n * @default 'WISE'\n */\n type?: `${LogoType}`;\n}\n\nconst labelByType = {\n WISE: 'Wise',\n WISE_BUSINESS: 'Wise Business',\n WISE_PLATFORM: 'Wise Platform',\n} satisfies Record<`${LogoType}`, string>;\n\n/**\n * Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports\n * and the full wordmark on ≥576px (small breakpoint and above).\n *\n * @see {@link https://wise.design/foundations/logo Design Spec}\n */\nexport default function Logo({ className, inverse, type = 'WISE' }: LogoProps) {\n const LogoSm =\n svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];\n const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];\n\n return (\n <span aria-label={labelByType[type]} role=\"img\" className={clsx(className, 'np-logo')}>\n <LogoSm className=\"np-logo-svg np-logo-svg--size-sm\" />\n <LogoMd className=\"np-logo-svg np-logo-svg--size-md\" />\n </span>\n );\n}\n"],"names":["svgPaths","WISE","LogoWise","WISE_BUSINESS","WISE_INVERSE","LogoWiseInverse","WISE_BUSINESS_INVERSE","WISE_PLATFORM","LogoWisePlatform","WISE_PLATFORM_INVERSE","LogoWisePlatformInverse","WISE_FLAG","LogoFlag","WISE_FLAG_INVERSE","LogoFlagInverse","WISE_FLAG_PLATFORM","LogoFlagPlatform","WISE_FLAG_PLATFORM_INVERSE","LogoFlagPlatformInverse","LogoType","labelByType","Logo","className","inverse","type","LogoSm","LogoMd","_jsxs","role","clsx","children","_jsx"],"mappings":";;;;AAaA,MAAMA,QAAQ,GAAG;AACfC,EAAAA,IAAI,EAAEC,QAAQ;AACdC,EAAAA,aAAa,EAAED,QAAQ;AACvBE,EAAAA,YAAY,EAAEC,eAAe;AAC7BC,EAAAA,qBAAqB,EAAED,eAAe;AACtCE,EAAAA,aAAa,EAAEC,gBAAgB;AAC/BC,EAAAA,qBAAqB,EAAEC,uBAAuB;AAC9CC,EAAAA,SAAS,EAAEC,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