@wise/art 2.24.7 → 2.25.0

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 (76) hide show
  1. package/README.md +2 -2
  2. package/dist/{CheckMark-BtQ62PMc.esm.js → CheckMark-C7SPkQjr.esm.js} +2 -2
  3. package/dist/{CheckMark-BtQ62PMc.esm.js.map → CheckMark-C7SPkQjr.esm.js.map} +1 -1
  4. package/dist/{CheckMark-cJyvL7T_.js → CheckMark-DbWrBNtH.js} +2 -2
  5. package/dist/{CheckMark-cJyvL7T_.js.map → CheckMark-DbWrBNtH.js.map} +1 -1
  6. package/dist/{Confetti-C40zBSVo.js → Confetti-BbPKLCpN.js} +2 -2
  7. package/dist/{Confetti-C40zBSVo.js.map → Confetti-BbPKLCpN.js.map} +1 -1
  8. package/dist/{Confetti-toiSCAzv.esm.js → Confetti-DPMBG56o.esm.js} +2 -2
  9. package/dist/{Confetti-toiSCAzv.esm.js.map → Confetti-DPMBG56o.esm.js.map} +1 -1
  10. package/dist/{Flower-DSs4bhC_.esm.js → Flower-Dhjb1Y6Z.esm.js} +2 -2
  11. package/dist/{Flower-DSs4bhC_.esm.js.map → Flower-Dhjb1Y6Z.esm.js.map} +1 -1
  12. package/dist/{Flower-3lV6PO6i.js → Flower-I053ey4H.js} +2 -2
  13. package/dist/{Flower-3lV6PO6i.js.map → Flower-I053ey4H.js.map} +1 -1
  14. package/dist/{Globe-Cv2CH4Ls.esm.js → Globe-CJDK9wR6.esm.js} +2 -2
  15. package/dist/{Globe-Cv2CH4Ls.esm.js.map → Globe-CJDK9wR6.esm.js.map} +1 -1
  16. package/dist/{Globe-BamoY0MH.js → Globe-DD_Ybugr.js} +2 -2
  17. package/dist/{Globe-BamoY0MH.js.map → Globe-DD_Ybugr.js.map} +1 -1
  18. package/dist/{Graph-BAkJZsOh.esm.js → Graph-D1M4JGez.esm.js} +2 -2
  19. package/dist/{Graph-BAkJZsOh.esm.js.map → Graph-D1M4JGez.esm.js.map} +1 -1
  20. package/dist/{Graph-CfDPRUXG.js → Graph-DrtwCTeB.js} +2 -2
  21. package/dist/{Graph-CfDPRUXG.js.map → Graph-DrtwCTeB.js.map} +1 -1
  22. package/dist/{Interest-DaRnXsAT.js → Interest-5AzhwfRZ.js} +2 -2
  23. package/dist/{Interest-DaRnXsAT.js.map → Interest-5AzhwfRZ.js.map} +1 -1
  24. package/dist/{Interest-BfKUEAGg.esm.js → Interest-d9YRzYsQ.esm.js} +2 -2
  25. package/dist/{Interest-BfKUEAGg.esm.js.map → Interest-d9YRzYsQ.esm.js.map} +1 -1
  26. package/dist/{Jars-DabN9mhk.esm.js → Jars-Bj5zryIy.esm.js} +2 -2
  27. package/dist/{Jars-DabN9mhk.esm.js.map → Jars-Bj5zryIy.esm.js.map} +1 -1
  28. package/dist/{Jars-Cf7IwTSO.js → Jars-DTpuM002.js} +2 -2
  29. package/dist/{Jars-Cf7IwTSO.js.map → Jars-DTpuM002.js.map} +1 -1
  30. package/dist/{Lock-DJ9PshsO.js → Lock-Ca-LEge7.js} +2 -2
  31. package/dist/{Lock-DJ9PshsO.js.map → Lock-Ca-LEge7.js.map} +1 -1
  32. package/dist/{Lock--uH5fhTv.esm.js → Lock-xy_KoW2g.esm.js} +2 -2
  33. package/dist/{Lock--uH5fhTv.esm.js.map → Lock-xy_KoW2g.esm.js.map} +1 -1
  34. package/dist/{MagnifyingGlass-D9sR6O8H.esm.js → MagnifyingGlass-CR0nvKTo.esm.js} +2 -2
  35. package/dist/{MagnifyingGlass-D9sR6O8H.esm.js.map → MagnifyingGlass-CR0nvKTo.esm.js.map} +1 -1
  36. package/dist/{MagnifyingGlass-BknYcSY6.js → MagnifyingGlass-DFASWsdn.js} +2 -2
  37. package/dist/{MagnifyingGlass-BknYcSY6.js.map → MagnifyingGlass-DFASWsdn.js.map} +1 -1
  38. package/dist/{Marble-izXyHYEg.js → Marble-BZIHD9uw.js} +2 -2
  39. package/dist/{Marble-izXyHYEg.js.map → Marble-BZIHD9uw.js.map} +1 -1
  40. package/dist/{Marble-B5fY-cxX.esm.js → Marble-Dn1NhVNa.esm.js} +2 -2
  41. package/dist/{Marble-B5fY-cxX.esm.js.map → Marble-Dn1NhVNa.esm.js.map} +1 -1
  42. package/dist/{MarbleCard-Ce25_axJ.esm.js → MarbleCard-CLq_nDBM.esm.js} +2 -2
  43. package/dist/{MarbleCard-Ce25_axJ.esm.js.map → MarbleCard-CLq_nDBM.esm.js.map} +1 -1
  44. package/dist/{MarbleCard-W3jCbP-I.js → MarbleCard-CtjGjEPp.js} +2 -2
  45. package/dist/{MarbleCard-W3jCbP-I.js.map → MarbleCard-CtjGjEPp.js.map} +1 -1
  46. package/dist/{MultiCurrency-BAow9cCQ.esm.js → MultiCurrency-B5HtZfTG.esm.js} +2 -2
  47. package/dist/{MultiCurrency-BAow9cCQ.esm.js.map → MultiCurrency-B5HtZfTG.esm.js.map} +1 -1
  48. package/dist/{MultiCurrency-xvG1foRM.js → MultiCurrency-Bh-7t3nH.js} +2 -2
  49. package/dist/{MultiCurrency-xvG1foRM.js.map → MultiCurrency-Bh-7t3nH.js.map} +1 -1
  50. package/dist/{Plane-BXQPImui.js → Plane-D-NW6i-O.js} +2 -2
  51. package/dist/{Plane-BXQPImui.js.map → Plane-D-NW6i-O.js.map} +1 -1
  52. package/dist/{Plane-bUZ-3ZDf.esm.js → Plane-aYcLKAhf.esm.js} +2 -2
  53. package/dist/{Plane-bUZ-3ZDf.esm.js.map → Plane-aYcLKAhf.esm.js.map} +1 -1
  54. package/dist/{Scene-K-_5SWQB.esm.js → Scene-ClmxQ_BP.esm.js} +2 -2
  55. package/dist/{Scene-K-_5SWQB.esm.js.map → Scene-ClmxQ_BP.esm.js.map} +1 -1
  56. package/dist/{Scene-D9b70d7t.js → Scene-DNB5gL2m.js} +2 -2
  57. package/dist/{Scene-D9b70d7t.js.map → Scene-DNB5gL2m.js.map} +1 -1
  58. package/dist/flags/Flag.d.ts +1 -1
  59. package/dist/flags/Flag.spec.d.ts +1 -1
  60. package/dist/illustrations/metadata.d.ts +38 -2
  61. package/dist/illustrations/metadata.d.ts.map +1 -1
  62. package/dist/{index-DragVnFs.esm.js → index-ApMK-TMV.esm.js} +56 -20
  63. package/dist/index-ApMK-TMV.esm.js.map +1 -0
  64. package/dist/{index-0zgfxQZX.js → index-CeTVmx_6.js} +56 -20
  65. package/dist/index-CeTVmx_6.js.map +1 -0
  66. package/dist/index.esm.js +1 -1
  67. package/dist/index.js +1 -1
  68. package/package.json +35 -35
  69. package/src/flags/AllFlagsAndSizes.stories.tsx +131 -0
  70. package/src/flags/Flag.spec.tsx +13 -13
  71. package/src/flags/Flag.stories.tsx +5 -89
  72. package/src/flags/Flag.tsx +13 -13
  73. package/src/illustrations/Illustration.stories.tsx +42 -25
  74. package/src/illustrations/metadata.ts +2 -2
  75. package/dist/index-0zgfxQZX.js.map +0 -1
  76. package/dist/index-DragVnFs.esm.js.map +0 -1
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Assets, F as Flag, I as Illustration, a as Illustration3D, i as isIllustrationSupport3D } from './index-DragVnFs.esm.js';
1
+ export { A as Assets, F as Flag, I as Illustration, a as Illustration3D, i as isIllustrationSupport3D } from './index-ApMK-TMV.esm.js';
2
2
  export { S as Sizes } from './common-DBpCdW70.esm.js';
3
3
  import 'clsx';
4
4
  import 'react';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-0zgfxQZX.js');
3
+ var index = require('./index-CeTVmx_6.js');
4
4
  var common = require('./common-H4L6Hbbh.js');
5
5
  require('clsx');
6
6
  require('react');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/art",
3
- "version": "2.24.7",
3
+ "version": "2.25.0",
4
4
  "license": "MIT",
5
5
  "description": "React library for art elements in UI",
6
6
  "homepage": "https://github.com/transferwise/web-art#readme",
@@ -21,65 +21,65 @@
21
21
  "!**/*.tsbuildinfo"
22
22
  ],
23
23
  "dependencies": {
24
- "@babel/runtime": "^7.28.3",
24
+ "@babel/runtime": "^7.28.4",
25
25
  "@react-three/drei": "9.122.0",
26
26
  "@react-three/fiber": "8.18.0",
27
- "@rive-app/react-webgl2": "^4.23.1",
27
+ "@rive-app/react-webgl2": "^4.25.0",
28
28
  "@types/three": "0.164.0",
29
29
  "clsx": "^2.1.1",
30
30
  "three": "0.164.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@babel/core": "^7.28.3",
34
- "@babel/plugin-transform-runtime": "^7.28.3",
35
- "@babel/preset-env": "^7.28.3",
36
- "@babel/preset-react": "^7.27.1",
37
- "@babel/preset-typescript": "^7.27.1",
33
+ "@babel/core": "^7.28.5",
34
+ "@babel/plugin-transform-runtime": "^7.28.5",
35
+ "@babel/preset-env": "^7.28.5",
36
+ "@babel/preset-react": "^7.28.5",
37
+ "@babel/preset-typescript": "^7.28.5",
38
38
  "@csstools/postcss-minify": "^2.0.4",
39
- "@rollup/plugin-babel": "^6.0.4",
40
- "@rollup/plugin-typescript": "^12.1.4",
41
- "@storybook/react-vite": "^9.1.2",
42
- "@testing-library/jest-dom": "^6.7.0",
43
- "@testing-library/react": "^16.3.0",
44
- "@transferwise/neptune-css": "^14.24.5",
45
- "@tsconfig/recommended": "^1.0.10",
39
+ "@rollup/plugin-babel": "^6.1.0",
40
+ "@rollup/plugin-typescript": "^12.3.0",
41
+ "@storybook/react-vite": "^10.1.10",
42
+ "@testing-library/jest-dom": "^6.9.1",
43
+ "@testing-library/react": "^16.3.1",
44
+ "@transferwise/neptune-css": "^14.25.2",
45
+ "@tsconfig/recommended": "^1.0.13",
46
46
  "@types/babel__core": "^7.20.5",
47
47
  "@types/imagemin": "^9.0.1",
48
48
  "@types/imagemin-webp": "^7.0.3",
49
49
  "@types/jest": "^30.0.0",
50
- "@types/jsdom": "^21.1.7",
50
+ "@types/jsdom": "^27.0.0",
51
51
  "@types/react": "^18.3.23",
52
52
  "@types/react-dom": "^18.3.7",
53
- "@vitejs/plugin-react": "^4.6.0",
54
- "@wise/eslint-config": "^13.1.0",
53
+ "@vitejs/plugin-react": "^5.1.2",
54
+ "@wise/eslint-config": "^13.3.0",
55
55
  "babel-plugin-optimize-clsx": "^2.6.2",
56
56
  "copyfiles": "^2.4.1",
57
- "eslint": "^9.33.0",
58
- "glob": "^11.0.3",
57
+ "eslint": "^9.39.2",
58
+ "glob": "^13.0.0",
59
59
  "gltf-pipeline": "^4.3.0",
60
60
  "imagemin": "^9.0.1",
61
61
  "imagemin-webp": "^8.0.0",
62
- "jest": "^30.0.5",
63
- "jest-environment-jsdom": "^30.0.5",
64
- "jsdom": "~26.1.0",
62
+ "jest": "^30.2.0",
63
+ "jest-environment-jsdom": "^30.2.0",
64
+ "jsdom": "^27.3.0",
65
65
  "postcss": "^8.5.6",
66
66
  "postcss-cli": "^11.0.1",
67
67
  "postcss-import": "^16.1.1",
68
- "prettier": "^3.6.2",
68
+ "prettier": "^3.7.4",
69
69
  "react": "^18.3.1",
70
70
  "react-dom": "^18.3.1",
71
- "rollup": "^4.46.3",
72
- "sharp": "^0.32.5",
73
- "storybook": "^9.1.2",
74
- "typescript": "^5.9.2",
75
- "vite": "^7.1.2",
76
- "wise-atoms": "git+https://github.com/transferwise/wise-atoms.git#84fc36d9f1b1a57a1bc98e547d2e226bb2ed2e55",
77
- "@storybook/addon-docs": "^9.1.2",
78
- "@changesets/cli": "^2.29.7",
79
- "@changesets/changelog-github": "0.5.1"
71
+ "rollup": "^4.53.5",
72
+ "sharp": "^0.34.5",
73
+ "storybook": "^10.1.10",
74
+ "typescript": "^5.9.3",
75
+ "vite": "^7.3.0",
76
+ "wise-atoms": "git+https://github.com/transferwise/wise-atoms.git#8afba508f461e91d458d4312600cb279b3f47086",
77
+ "@storybook/addon-docs": "^10.1.10",
78
+ "@changesets/cli": "^2.29.8",
79
+ "@changesets/changelog-github": "0.5.2"
80
80
  },
81
81
  "peerDependencies": {
82
- "@transferwise/neptune-css": "^14.24.5",
82
+ "@transferwise/neptune-css": "^14.25.2",
83
83
  "react": ">=18",
84
84
  "react-dom": ">=18"
85
85
  },
@@ -112,7 +112,7 @@
112
112
  "test:watch": "jest --watch",
113
113
  "lint": "eslint 'src/**/*.{js,ts,tsx}' 'scripts/*.{mjs,js,ts,tsx}'",
114
114
  "lint-fix": "eslint 'src/**/*.{js,ts,tsx}' 'scripts/*.{mjs,js,ts,tsx}' --fix",
115
- "build-docs": "storybook build -o docs && touch ./docs/.nojekyll",
115
+ "build-docs": "storybook build --stats-json -o docs && touch ./docs/.nojekyll",
116
116
  "build-styles": "postcss src/index.css -o dist/Illustration.css",
117
117
  "changeset": "changeset",
118
118
  "release": "changeset publish"
@@ -0,0 +1,131 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+
3
+ import flagRawMetaData from '../../node_modules/wise-atoms/flags/.metadata.json';
4
+ import { Flag } from './Flag';
5
+
6
+ const meta: Meta<typeof Flag> = {
7
+ component: Flag,
8
+ title: 'Flag/All Flags and Sizes',
9
+ };
10
+ export default meta;
11
+
12
+ type Story = StoryObj<typeof Flag>;
13
+
14
+ // Helper function to render all flags and sizes for a given region
15
+ const AllFlagsAndSizes = (region: string) => {
16
+ const regionFlags = Object.entries(flagRawMetaData)
17
+ .filter(([r]) => r === region)
18
+ .flatMap(([, flags]) => flags);
19
+
20
+ return (
21
+ <>
22
+ <div
23
+ style={{
24
+ display: 'flex',
25
+ flexDirection: 'column',
26
+ marginBottom: 'var(--padding-medium)',
27
+ }}
28
+ >
29
+ <span className="np-text-title-section">{region}</span>
30
+ <span className="np-text-body-large-bold">
31
+ Total number of flags in category: {regionFlags.length}
32
+ </span>
33
+ </div>
34
+ <div
35
+ style={{
36
+ display: 'grid',
37
+ gridTemplateColumns: 'repeat(auto-fill, minmax(350px, 1fr))',
38
+ gap: 'var(--padding-small)',
39
+ }}
40
+ >
41
+ {regionFlags.map((flag) => {
42
+ const countryCode = flag.country[0]?.toUpperCase();
43
+ const currencyCode = flag.currency[0]?.toUpperCase();
44
+ const flagCode = countryCode ?? currencyCode;
45
+
46
+ // Covers cases where there's just a currency code and no country (e.g. Euro)
47
+ const flagName = countryCode
48
+ ? flag.country.at(-1)
49
+ : flag.currency?.at(-1);
50
+
51
+ return (
52
+ <div
53
+ key={flagName}
54
+ style={{
55
+ display: 'grid',
56
+ gridTemplateColumns: 'minmax(auto, 1fr) auto 1fr',
57
+ gap: 'var(--padding-small)',
58
+ alignItems: 'center',
59
+ }}
60
+ >
61
+ <div
62
+ style={{
63
+ display: 'flex',
64
+ flexWrap: 'wrap',
65
+ flexDirection: 'column',
66
+ alignItems: 'flex-start',
67
+ gap: 'var(--padding-small)',
68
+ }}
69
+ >
70
+ {flagName}
71
+ <span>
72
+ {countryCode && (
73
+ <>
74
+ Country: <code>{countryCode}</code>
75
+ </>
76
+ )}
77
+ {currencyCode && countryCode && <br />}
78
+ {currencyCode && (
79
+ <>
80
+ Currency: <code>{currencyCode}</code>
81
+ </>
82
+ )}
83
+ </span>
84
+ {currencyCode && <span />}
85
+ </div>
86
+ <Flag code={flagCode} />
87
+ <Flag code={flagCode} intrinsicSize={150} />
88
+ </div>
89
+ );
90
+ })}
91
+ </div>
92
+ </>
93
+ );
94
+ };
95
+
96
+ // Stories for each region
97
+ export const Africa: Story = {
98
+ render: () => AllFlagsAndSizes('Africa'),
99
+ };
100
+
101
+ export const Antarctic: Story = {
102
+ render: () => AllFlagsAndSizes('Antarctic'),
103
+ };
104
+
105
+ export const Asia: Story = {
106
+ render: () => AllFlagsAndSizes('Asia'),
107
+ };
108
+
109
+ export const CentralAmerica: Story = {
110
+ render: () => AllFlagsAndSizes('Central America'),
111
+ };
112
+
113
+ export const Europe: Story = {
114
+ render: () => AllFlagsAndSizes('Europe'),
115
+ };
116
+
117
+ export const NorthAmerica: Story = {
118
+ render: () => AllFlagsAndSizes('North America'),
119
+ };
120
+
121
+ export const Oceania: Story = {
122
+ render: () => AllFlagsAndSizes('Oceania'),
123
+ };
124
+
125
+ export const SouthAmerica: Story = {
126
+ render: () => AllFlagsAndSizes('South America'),
127
+ };
128
+
129
+ export const Fallback: Story = {
130
+ render: () => AllFlagsAndSizes('Fallback'),
131
+ };
@@ -1,31 +1,31 @@
1
- import "@testing-library/jest-dom";
1
+ import '@testing-library/jest-dom';
2
2
 
3
- import { render, renderHook, screen, waitFor } from "@testing-library/react";
3
+ import { render } from '@testing-library/react';
4
4
 
5
- import { Flag } from "./Flag";
5
+ import { Flag } from './Flag';
6
6
 
7
- describe("Flag", () => {
8
- it("use default image when < 150px", () => {
7
+ describe('Flag', () => {
8
+ it('use default image when < 150px', () => {
9
9
  const { container } = render(<Flag code="es" />);
10
10
 
11
11
  // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
12
- const flag = container.querySelector("img");
13
- expect(flag?.src.includes("detailed")).toBe(false);
12
+ const flag = container.querySelector('img');
13
+ expect(flag?.src.includes('detailed')).toBe(false);
14
14
  });
15
15
 
16
- it("use detailed image when available and >= 150px", () => {
16
+ it('use detailed image when available and >= 150px', () => {
17
17
  const { container } = render(<Flag code="es" intrinsicSize={150} />);
18
18
 
19
19
  // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
20
- const flag = container.querySelector("img");
21
- expect(flag?.src.includes("detailed")).toBe(true);
20
+ const flag = container.querySelector('img');
21
+ expect(flag?.src.includes('detailed')).toBe(true);
22
22
  });
23
23
 
24
- it("don't use try to use detailed image if not available", () => {
24
+ it("don't try to use detailed image if not available", () => {
25
25
  const { container } = render(<Flag code="fr" />);
26
26
 
27
27
  // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
28
- const flag = container.querySelector("img");
29
- expect(flag?.src.includes("detailed")).toBe(false);
28
+ const flag = container.querySelector('img');
29
+ expect(flag?.src.includes('detailed')).toBe(false);
30
30
  });
31
31
  });
@@ -1,11 +1,10 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
 
3
- import flagRawMetaData from "../../node_modules/wise-atoms/flags/.metadata.json";
4
- import { Flag } from "./Flag";
3
+ import { Flag } from './Flag';
5
4
 
6
5
  const meta: Meta<typeof Flag> = {
7
6
  component: Flag,
8
- title: "Flag",
7
+ title: 'Flag',
9
8
  };
10
9
  export default meta;
11
10
 
@@ -13,92 +12,9 @@ type Story = StoryObj<typeof Flag>;
13
12
 
14
13
  export const Basic: Story = {
15
14
  render: (args) => <Flag {...args} />,
16
- tags: ["autodocs"],
15
+ tags: ['autodocs'],
17
16
  args: {
18
- code: "GBP",
17
+ code: 'GBP',
19
18
  intrinsicSize: 64,
20
19
  },
21
20
  };
22
-
23
- export const AllFlagsAndSizes = () => {
24
- const regions = Object.entries(flagRawMetaData);
25
-
26
- return (
27
- <>
28
- <span className="np-text-body-large-bold">
29
- Total number of flags: {regions.flatMap(([_, flags]) => flags).length}
30
- </span>
31
- <div
32
- style={{
33
- display: "grid",
34
- gap: "var(--padding-large)",
35
- marginTop: "var(--padding-medium)",
36
- }}
37
- >
38
- {regions.map(([region, flags]) => (
39
- <div key={region}>
40
- <span className="np-text-title-section">{region}</span>
41
- <div
42
- style={{
43
- display: "grid",
44
- gridTemplateColumns: "repeat(auto-fill, minmax(450px, 1fr))",
45
- gap: "var(--padding-small)",
46
- }}
47
- >
48
- {flags.map((flag) => {
49
- const countryCode = flag.country[0]?.toUpperCase();
50
- const currencyCode = flag.currency[0]?.toUpperCase();
51
- const flagCode = countryCode ?? currencyCode;
52
-
53
- // Covers cases where there's just a currency code and no country (e.g. Euro)
54
- const flagName = countryCode
55
- ? flag.country.at(-1)
56
- : flag.currency?.at(-1);
57
-
58
- return (
59
- <div
60
- key={flagName}
61
- style={{
62
- display: "grid",
63
- gridTemplateColumns: "minmax(auto, 1fr) auto 1fr",
64
- gap: "var(--padding-small)",
65
- alignItems: "center",
66
- }}
67
- >
68
- <div
69
- style={{
70
- display: "flex",
71
- flexWrap: "wrap",
72
- flexDirection: "column",
73
- alignItems: "flex-start",
74
- gap: "var(--padding-small)",
75
- }}
76
- >
77
- {flagName}
78
- <span>
79
- {countryCode && (
80
- <>
81
- Country: <code>{countryCode}</code>
82
- </>
83
- )}
84
- {currencyCode && countryCode && <br />}
85
- {currencyCode && (
86
- <>
87
- Currency: <code>{currencyCode}</code>
88
- </>
89
- )}
90
- </span>
91
- {currencyCode && <span />}
92
- </div>
93
- <Flag code={flagCode} />
94
- <Flag code={flagCode} intrinsicSize={150} />
95
- </div>
96
- );
97
- })}
98
- </div>
99
- </div>
100
- ))}
101
- </div>
102
- </>
103
- );
104
- };
@@ -1,7 +1,7 @@
1
- import { clsx } from "clsx";
2
- import { useEffect, useState } from "react";
1
+ import { clsx } from 'clsx';
2
+ import { useEffect, useState } from 'react';
3
3
 
4
- import { DETAILED_FLAG_CODES } from "./metadata";
4
+ import { DETAILED_FLAG_CODES } from './metadata';
5
5
 
6
6
  export interface FlagProps {
7
7
  /**
@@ -14,18 +14,18 @@ export interface FlagProps {
14
14
  */
15
15
  intrinsicSize?: number;
16
16
  className?: string;
17
- loading?: "lazy" | "eager";
17
+ loading?: 'lazy' | 'eager';
18
18
  }
19
19
 
20
- const unknownFlagName = "wise";
20
+ const unknownFlagName = 'wise';
21
21
 
22
22
  export const Flag = ({
23
23
  code,
24
24
  intrinsicSize = 64,
25
25
  className = undefined,
26
- loading = "lazy",
26
+ loading = 'lazy',
27
27
  }: FlagProps) => {
28
- const [fallback, setFallback] = useState<"simple" | "unknown" | null>(null);
28
+ const [fallback, setFallback] = useState<'simple' | 'unknown' | null>(null);
29
29
  useEffect(() => {
30
30
  setFallback(null);
31
31
  }, [code]);
@@ -33,21 +33,21 @@ export const Flag = ({
33
33
  const detailed = intrinsicSize >= 150;
34
34
  // Only get detailed svg if we know it exists, to avoid the performance hit of failing requests
35
35
  const name =
36
- fallback !== "unknown"
36
+ fallback !== 'unknown'
37
37
  ? `${code.toLowerCase()}${
38
38
  fallback == null &&
39
39
  detailed &&
40
40
  DETAILED_FLAG_CODES.includes(code.toLowerCase())
41
- ? "-detailed"
42
- : ""
41
+ ? '-detailed'
42
+ : ''
43
43
  }`
44
44
  : unknownFlagName;
45
45
 
46
46
  return (
47
47
  <img
48
- className={clsx("wds-flag", `wds-flag-${name}`, className)}
48
+ className={clsx('wds-flag', `wds-flag-${name}`, className)}
49
49
  src={
50
- process.env.NODE_ENV === "web-art-dev"
50
+ process.env.NODE_ENV === 'web-art-dev'
51
51
  ? `${name}.svg`
52
52
  : `https://wise.com/web-art/assets/flags/${name}.svg`
53
53
  }
@@ -57,7 +57,7 @@ export const Flag = ({
57
57
  height={intrinsicSize}
58
58
  onError={() => {
59
59
  setFallback((prev) =>
60
- prev == null && detailed ? "simple" : "unknown",
60
+ prev == null && detailed ? 'simple' : 'unknown',
61
61
  );
62
62
  }}
63
63
  />
@@ -1,41 +1,58 @@
1
+ import type { StoryObj } from "@storybook/react-vite";
1
2
 
2
- import type {StoryObj} from '@storybook/react-vite';
3
- import React from 'react';
4
-
5
- import Illustration, { type Props as IllustrationProps } from './Illustration';
6
- import { Assets, type IllustrationNames } from './metadata';
7
-
3
+ import Illustration, { type Props as IllustrationProps } from "./Illustration";
4
+ import { Assets, type IllustrationNames } from "./metadata";
8
5
 
9
6
  export default {
10
7
  component: Illustration,
11
- title: 'Illustration',
8
+ title: "Illustration",
12
9
  };
13
10
 
14
11
  type Story = StoryObj<typeof Illustration>;
15
12
 
16
- export const Individual: Story = {
17
- tags: ['autodocs'],
18
- render: function Render (
19
- { name = Assets.CHECK_MARK, ...props }: IllustrationProps
20
- ) {
21
- return (
22
- <Illustration name={name} {...props} />
23
- );
24
- }
25
- }
13
+ export const Basic: Story = {
14
+ tags: ["autodocs"],
15
+ render: function Render({
16
+ name = Assets.CHECK_MARK,
17
+ ...props
18
+ }: IllustrationProps) {
19
+ return <Illustration name={name} {...props} />;
20
+ },
21
+ };
26
22
 
27
23
  export const All = () => {
28
24
  const assetNames = Object.values(Assets);
29
25
  return (
30
26
  <>
31
- <div>Total number of illustrations: {assetNames.length}</div>
32
- {Object.values(Assets).map((assetName) => (
33
- <p key={assetName}>
34
- Asset: <code>{assetName}</code>
35
- <Illustration key={assetName} alt={assetName} name={assetName as IllustrationNames} />
36
- </p>
37
- ))}
27
+ <span className="np-text-body-large-bold">
28
+ Total number of illustrations: {assetNames.length}
29
+ </span>
30
+ <div
31
+ style={{
32
+ display: "grid",
33
+ gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))",
34
+ gap: "var(--padding-small)",
35
+ }}
36
+ >
37
+ {Object.values(Assets).map((assetName) => (
38
+ <div
39
+ key={assetName}
40
+ style={{
41
+ display: "grid",
42
+ alignItems: "center",
43
+ justifyItems: "center",
44
+ }}
45
+ >
46
+ <Illustration
47
+ alt={assetName}
48
+ name={assetName as IllustrationNames}
49
+ />
50
+ <span>
51
+ <code>{assetName}</code>
52
+ </span>
53
+ </div>
54
+ ))}
55
+ </div>
38
56
  </>
39
57
  );
40
58
  };
41
-
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
  export enum Assets {
10
- WALLET = 'wallet',TWO_INVITE_LETTERS_OPENED = 'two-invite-letters-opened',TOOL = 'tool',TARGET_PLATFORM = 'target-platform',STOPWATCH_PLATFORM = 'stopwatch-platform',SPEECH_BUBBLE = 'speech-bubble',SKIP_AUTHENTICATION = 'skip-authentication',SHOPPING_BAG = 'shopping-bag',SATELLITE_PLATFORM = 'satellite-platform',SAND_TIMER = 'sand-timer',REMINDER_LETTER = 'reminder-letter',RECEIVE = 'receive',QUESTION_MARK = 'question-mark',PUZZLE_PIECES = 'puzzle-pieces',PLANE_2 = 'plane-2',PLANE = 'plane',PIE_CHART = 'pie-chart',PHONES = 'phones',PERSONAL_CARD = 'personal-card',PERCENTAGE = 'percentage',PALM_TREE = 'palm-tree',ONE_INVITE_LETTER_OPENED = 'one-invite-letter-opened',MULTI_CURRENCY = 'multi-currency',MEGAPHONE = 'megaphone',MARBLE_CARD_FLAG_ONLY = 'marble-card-flag-only',MARBLE_CARD_BUSINESS_FLAG_ONLY = 'marble-card-business-flag-only',MARBLE_CARD_BUSINESS = 'marble-card-business',MARBLE_CARD = 'marble-card',MARBLE = 'marble',MAP = 'map',MAGNIFYING_GLASS = 'magnifying-glass',LOCK_PLATFORM = 'lock-platform',LOCK = 'lock',LIGHT_BULB = 'light-bulb',KEY = 'key',JARS = 'jars',INVITE_LETTER = 'invite-letter',INTEREST = 'interest',INFINITE = 'infinite',ID_CARD = 'id-card',HOUSE = 'house',HEART_5 = 'heart-5',HEART_4 = 'heart-4',HEART_3 = 'heart-3',HEART_2 = 'heart-2',HEART = 'heart',GRAPH = 'graph',GLOBE = 'globe',GEAR = 'gear',FLOWER = 'flower',FLAG = 'flag',EXCLAMATION_MARK = 'exclamation-mark',EMAIL_SUCCESS = 'email-success',EMAIL = 'email',ELECTRIC_PLUG = 'electric-plug',ECO_CARD = 'eco-card',DOOR = 'door',DOCUMENTS = 'documents',DIGITAL_CARD_2 = 'digital-card-2',DIGITAL_CARD = 'digital-card',COOKIE = 'cookie',CONVERT = 'convert',CONSTRUCTION_FENCE = 'construction-fence',CONFETTI = 'confetti',COIN_PILE_UP = 'coin-pile-up',COIN_PILE_DOWN = 'coin-pile-down',CLOSED_WINDOW = 'closed-window',CHECK_MARK = 'check-mark',CALENDAR = 'calendar',BUSINESS_CARD = 'business-card',BRIEFCASE = 'briefcase',BELL = 'bell',BACKPACK = 'backpack'
10
+ WALLET = 'wallet',TWO_INVITE_LETTERS_OPENED = 'two-invite-letters-opened',TOOL = 'tool',TARGET_PLATFORM = 'target-platform',STOPWATCH_PLATFORM = 'stopwatch-platform',SPEECH_BUBBLE = 'speech-bubble',SKIP_AUTHENTICATION = 'skip-authentication',SHOPPING_BAG = 'shopping-bag',SATELLITE_PLATFORM = 'satellite-platform',SAND_TIMER_BUSINESS = 'sand-timer-business',SAND_TIMER = 'sand-timer',REMINDER_LETTER = 'reminder-letter',RECEIVE_BUSINESS = 'receive-business',RECEIVE = 'receive',QUESTION_MARK_BUSINESS = 'question-mark-business',QUESTION_MARK = 'question-mark',PUZZLE_PIECES_BUSINESS = 'puzzle-pieces-business',PUZZLE_PIECES = 'puzzle-pieces',PLANE_BUSINESS = 'plane-business',PLANE_2 = 'plane-2',PLANE = 'plane',PIE_CHART_BUSINESS = 'pie-chart-business',PIE_CHART = 'pie-chart',PHONES = 'phones',PERSONAL_CARD = 'personal-card',PERCENTAGE_BUSINESS = 'percentage-business',PERCENTAGE = 'percentage',PALM_TREE = 'palm-tree',ONE_INVITE_LETTER_OPENED = 'one-invite-letter-opened',MULTI_CURRENCY_BUSINESS = 'multi-currency-business',MULTI_CURRENCY = 'multi-currency',MEGAPHONE = 'megaphone',MARBLE_CARD_FLAG_ONLY_BUSINESS = 'marble-card-flag-only-business',MARBLE_CARD_FLAG_ONLY = 'marble-card-flag-only',MARBLE_CARD_BUSINESS_FLAG_ONLY = 'marble-card-business-flag-only',MARBLE_CARD_BUSINESS = 'marble-card-business',MARBLE_CARD = 'marble-card',MARBLE_BUSINESS = 'marble-business',MARBLE = 'marble',MAP = 'map',MAGNIFYING_GLASS_BUSINESS = 'magnifying-glass-business',MAGNIFYING_GLASS = 'magnifying-glass',LOCK_PLATFORM = 'lock-platform',LOCK_BUSINESS = 'lock-business',LOCK = 'lock',LIGHT_BULB_BUSINESS = 'light-bulb-business',LIGHT_BULB = 'light-bulb',KEY_BUSINESS = 'key-business',KEY = 'key',JARS = 'jars',INVITE_LETTER = 'invite-letter',INTEREST = 'interest',INFINITE = 'infinite',ID_CARD = 'id-card',HOUSE = 'house',HEART_5 = 'heart-5',HEART_4 = 'heart-4',HEART_3 = 'heart-3',HEART_2 = 'heart-2',HEART = 'heart',HEADSET_BUSINESS = 'headset-business',HEADSET = 'headset',GRAPH_BUSINESS = 'graph-business',GRAPH = 'graph',GLOBE = 'globe',GET_PAID_WITH_CARD_BUSINESS = 'get-paid-with-card-business',GEAR_BUSINESS = 'gear-business',GEAR = 'gear',FLOWER = 'flower',FLAG = 'flag',EXCLAMATION_MARK_BUSINESS = 'exclamation-mark-business',EXCLAMATION_MARK = 'exclamation-mark',EMAIL_SUCCESS_BUSINESS = 'email-success-business',EMAIL_SUCCESS = 'email-success',EMAIL = 'email',ELECTRIC_PLUG = 'electric-plug',ECO_CARD = 'eco-card',DOOR = 'door',DOCUMENTS_FOLDER_BUSINESS = 'documents-folder-business',DOCUMENTS = 'documents',DIGITAL_CARD_BUSINESS = 'digital-card-business',DIGITAL_CARD_2 = 'digital-card-2',DIGITAL_CARD = 'digital-card',COOKIE = 'cookie',CONVERT_BUSINESS = 'convert-business',CONVERT = 'convert',CONSTRUCTION_FENCE = 'construction-fence',CONFETTI_BUSINESS = 'confetti-business',CONFETTI = 'confetti',COIN_PILE_UP_BUSINESS = 'coin-pile-up-business',COIN_PILE_UP = 'coin-pile-up',COIN_PILE_DOWN_BUSINESS = 'coin-pile-down-business',COIN_PILE_DOWN = 'coin-pile-down',CLOSED_WINDOW = 'closed-window',CHECK_MARK_BUSINESS = 'check-mark-business',CHECK_MARK = 'check-mark',CALENDAR_BUSINESS = 'calendar-business',CALENDAR = 'calendar',CALCULATOR_BUSINESS = 'calculator-business',BUSINESS_CARD_BUSINESS = 'business-card-business',BUSINESS_CARD = 'business-card',BRIEFCASE_BUSINESS = 'briefcase-business',BRIEFCASE = 'briefcase',BELL_BUSINESS = 'bell-business',BELL = 'bell',BATCH_PAYMENTS_BUSINESS = 'batch-payments-business',BACKPACK = 'backpack',APP_MARKETPLACE_BUSINESS = 'app-marketplace-business',API_INTEGRATIONS_BUSINESS = 'api-integrations-business'
11
11
  }
12
12
 
13
- export type IllustrationNames = 'wallet' | 'two-invite-letters-opened' | 'tool' | 'target-platform' | 'stopwatch-platform' | 'speech-bubble' | 'skip-authentication' | 'shopping-bag' | 'satellite-platform' | 'sand-timer' | 'reminder-letter' | 'receive' | 'question-mark' | 'puzzle-pieces' | 'plane-2' | 'plane' | 'pie-chart' | 'phones' | 'personal-card' | 'percentage' | 'palm-tree' | 'one-invite-letter-opened' | 'multi-currency' | 'megaphone' | 'marble-card-flag-only' | 'marble-card-business-flag-only' | 'marble-card-business' | 'marble-card' | 'marble' | 'map' | 'magnifying-glass' | 'lock-platform' | 'lock' | 'light-bulb' | 'key' | 'jars' | 'invite-letter' | 'interest' | 'infinite' | 'id-card' | 'house' | 'heart-5' | 'heart-4' | 'heart-3' | 'heart-2' | 'heart' | 'graph' | 'globe' | 'gear' | 'flower' | 'flag' | 'exclamation-mark' | 'email-success' | 'email' | 'electric-plug' | 'eco-card' | 'door' | 'documents' | 'digital-card-2' | 'digital-card' | 'cookie' | 'convert' | 'construction-fence' | 'confetti' | 'coin-pile-up' | 'coin-pile-down' | 'closed-window' | 'check-mark' | 'calendar' | 'business-card' | 'briefcase' | 'bell' | 'backpack'
13
+ export type IllustrationNames = 'wallet' | 'two-invite-letters-opened' | 'tool' | 'target-platform' | 'stopwatch-platform' | 'speech-bubble' | 'skip-authentication' | 'shopping-bag' | 'satellite-platform' | 'sand-timer-business' | 'sand-timer' | 'reminder-letter' | 'receive-business' | 'receive' | 'question-mark-business' | 'question-mark' | 'puzzle-pieces-business' | 'puzzle-pieces' | 'plane-business' | 'plane-2' | 'plane' | 'pie-chart-business' | 'pie-chart' | 'phones' | 'personal-card' | 'percentage-business' | 'percentage' | 'palm-tree' | 'one-invite-letter-opened' | 'multi-currency-business' | 'multi-currency' | 'megaphone' | 'marble-card-flag-only-business' | 'marble-card-flag-only' | 'marble-card-business-flag-only' | 'marble-card-business' | 'marble-card' | 'marble-business' | 'marble' | 'map' | 'magnifying-glass-business' | 'magnifying-glass' | 'lock-platform' | 'lock-business' | 'lock' | 'light-bulb-business' | 'light-bulb' | 'key-business' | 'key' | 'jars' | 'invite-letter' | 'interest' | 'infinite' | 'id-card' | 'house' | 'heart-5' | 'heart-4' | 'heart-3' | 'heart-2' | 'heart' | 'headset-business' | 'headset' | 'graph-business' | 'graph' | 'globe' | 'get-paid-with-card-business' | 'gear-business' | 'gear' | 'flower' | 'flag' | 'exclamation-mark-business' | 'exclamation-mark' | 'email-success-business' | 'email-success' | 'email' | 'electric-plug' | 'eco-card' | 'door' | 'documents-folder-business' | 'documents' | 'digital-card-business' | 'digital-card-2' | 'digital-card' | 'cookie' | 'convert-business' | 'convert' | 'construction-fence' | 'confetti-business' | 'confetti' | 'coin-pile-up-business' | 'coin-pile-up' | 'coin-pile-down-business' | 'coin-pile-down' | 'closed-window' | 'check-mark-business' | 'check-mark' | 'calendar-business' | 'calendar' | 'calculator-business' | 'business-card-business' | 'business-card' | 'briefcase-business' | 'briefcase' | 'bell-business' | 'bell' | 'batch-payments-business' | 'backpack' | 'app-marketplace-business' | 'api-integrations-business'