@wise/art 0.0.0-experimental-7f4f66a → 0.0.0-experimental-b088eec

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 (141) hide show
  1. package/README.md +16 -2
  2. package/dist/CheckMark-B4apF00o.js +40 -0
  3. package/dist/CheckMark-B4apF00o.js.map +1 -0
  4. package/dist/CheckMark-C6Gr_xXL.esm.js +38 -0
  5. package/dist/CheckMark-C6Gr_xXL.esm.js.map +1 -0
  6. package/dist/Confetti-C67U1Zdj.esm.js +35 -0
  7. package/dist/Confetti-C67U1Zdj.esm.js.map +1 -0
  8. package/dist/Confetti-DdxGAp4I.js +37 -0
  9. package/dist/Confetti-DdxGAp4I.js.map +1 -0
  10. package/dist/Flower-DasfcRBT.esm.js +28 -0
  11. package/dist/Flower-DasfcRBT.esm.js.map +1 -0
  12. package/dist/Flower-yjqCXxp6.js +30 -0
  13. package/dist/Flower-yjqCXxp6.js.map +1 -0
  14. package/dist/Globe-BqDlwkJm.js +46 -0
  15. package/dist/Globe-BqDlwkJm.js.map +1 -0
  16. package/dist/Globe-C9AZxd2Y.esm.js +44 -0
  17. package/dist/Globe-C9AZxd2Y.esm.js.map +1 -0
  18. package/dist/Graph-6nvvJntC.js +34 -0
  19. package/dist/Graph-6nvvJntC.js.map +1 -0
  20. package/dist/Graph-DVJ38E1p.esm.js +32 -0
  21. package/dist/Graph-DVJ38E1p.esm.js.map +1 -0
  22. package/dist/Illustration.css +1 -0
  23. package/dist/Interest-2Yff_wDq.js +53 -0
  24. package/dist/Interest-2Yff_wDq.js.map +1 -0
  25. package/dist/Interest-DjOcyx9v.esm.js +51 -0
  26. package/dist/Interest-DjOcyx9v.esm.js.map +1 -0
  27. package/dist/Jars-C7KdBy9e.js +53 -0
  28. package/dist/Jars-C7KdBy9e.js.map +1 -0
  29. package/dist/Jars-CHh_FiCl.esm.js +51 -0
  30. package/dist/Jars-CHh_FiCl.esm.js.map +1 -0
  31. package/dist/Lock-B7bG1MNN.js +44 -0
  32. package/dist/Lock-B7bG1MNN.js.map +1 -0
  33. package/dist/Lock-DddccsYd.esm.js +42 -0
  34. package/dist/Lock-DddccsYd.esm.js.map +1 -0
  35. package/dist/MagnifyingGlass-D3ECziZC.js +33 -0
  36. package/dist/MagnifyingGlass-D3ECziZC.js.map +1 -0
  37. package/dist/MagnifyingGlass-Dzg9rQC8.esm.js +31 -0
  38. package/dist/MagnifyingGlass-Dzg9rQC8.esm.js.map +1 -0
  39. package/dist/Marble-Befsfifz.esm.js +43 -0
  40. package/dist/Marble-Befsfifz.esm.js.map +1 -0
  41. package/dist/Marble-DSYM97l5.js +45 -0
  42. package/dist/Marble-DSYM97l5.js.map +1 -0
  43. package/dist/MarbleCard-DHWslCVG.esm.js +46 -0
  44. package/dist/MarbleCard-DHWslCVG.esm.js.map +1 -0
  45. package/dist/MarbleCard-kOCCz1Qh.js +48 -0
  46. package/dist/MarbleCard-kOCCz1Qh.js.map +1 -0
  47. package/dist/MultiCurrency-B6mXCM3m.esm.js +62 -0
  48. package/dist/MultiCurrency-B6mXCM3m.esm.js.map +1 -0
  49. package/dist/MultiCurrency-DP_lAn0S.js +64 -0
  50. package/dist/MultiCurrency-DP_lAn0S.js.map +1 -0
  51. package/dist/Plane-CIIUv-R9.js +40 -0
  52. package/dist/Plane-CIIUv-R9.js.map +1 -0
  53. package/dist/Plane-sDsU8h_j.esm.js +38 -0
  54. package/dist/Plane-sDsU8h_j.esm.js.map +1 -0
  55. package/dist/Scene-BIEwR0Eq.esm.js +54 -0
  56. package/dist/Scene-BIEwR0Eq.esm.js.map +1 -0
  57. package/dist/Scene-JIaToh60.js +56 -0
  58. package/dist/Scene-JIaToh60.js.map +1 -0
  59. package/dist/common-DBpCdW70.esm.js +14 -0
  60. package/dist/common-DBpCdW70.esm.js.map +1 -0
  61. package/dist/common-H4L6Hbbh.js +16 -0
  62. package/dist/common-H4L6Hbbh.js.map +1 -0
  63. package/dist/common.d.ts +15 -0
  64. package/dist/common.d.ts.map +1 -0
  65. package/dist/flags/Flag.d.ts +14 -0
  66. package/dist/flags/Flag.d.ts.map +1 -0
  67. package/dist/flags/Flag.spec.d.ts +2 -0
  68. package/dist/flags/Flag.spec.d.ts.map +1 -0
  69. package/dist/flags/index.d.ts +3 -0
  70. package/dist/flags/index.d.ts.map +1 -0
  71. package/dist/flags/metadata.d.ts +2 -0
  72. package/dist/flags/metadata.d.ts.map +1 -0
  73. package/dist/illustrations/Illustration.d.ts +20 -0
  74. package/dist/illustrations/Illustration.d.ts.map +1 -0
  75. package/dist/illustrations/Illustration.spec.d.ts +2 -0
  76. package/dist/illustrations/Illustration.spec.d.ts.map +1 -0
  77. package/dist/illustrations/index.d.ts +5 -0
  78. package/dist/illustrations/index.d.ts.map +1 -0
  79. package/dist/illustrations/metadata.d.ts +128 -0
  80. package/dist/illustrations/metadata.d.ts.map +1 -0
  81. package/dist/illustrations3d/Illustration3D.d.ts +11 -0
  82. package/dist/illustrations3d/Illustration3D.d.ts.map +1 -0
  83. package/dist/illustrations3d/Scene.d.ts +10 -0
  84. package/dist/illustrations3d/Scene.d.ts.map +1 -0
  85. package/dist/illustrations3d/index.d.ts +5 -0
  86. package/dist/illustrations3d/index.d.ts.map +1 -0
  87. package/dist/illustrations3d/models/CheckMark.d.ts +3 -0
  88. package/dist/illustrations3d/models/CheckMark.d.ts.map +1 -0
  89. package/dist/illustrations3d/models/Confetti.d.ts +3 -0
  90. package/dist/illustrations3d/models/Confetti.d.ts.map +1 -0
  91. package/dist/illustrations3d/models/Flower.d.ts +3 -0
  92. package/dist/illustrations3d/models/Flower.d.ts.map +1 -0
  93. package/dist/illustrations3d/models/Globe.d.ts +3 -0
  94. package/dist/illustrations3d/models/Globe.d.ts.map +1 -0
  95. package/dist/illustrations3d/models/Graph.d.ts +3 -0
  96. package/dist/illustrations3d/models/Graph.d.ts.map +1 -0
  97. package/dist/illustrations3d/models/Interest.d.ts +3 -0
  98. package/dist/illustrations3d/models/Interest.d.ts.map +1 -0
  99. package/dist/illustrations3d/models/Jars.d.ts +3 -0
  100. package/dist/illustrations3d/models/Jars.d.ts.map +1 -0
  101. package/dist/illustrations3d/models/Lock.d.ts +3 -0
  102. package/dist/illustrations3d/models/Lock.d.ts.map +1 -0
  103. package/dist/illustrations3d/models/MagnifyingGlass.d.ts +3 -0
  104. package/dist/illustrations3d/models/MagnifyingGlass.d.ts.map +1 -0
  105. package/dist/illustrations3d/models/Marble.d.ts +3 -0
  106. package/dist/illustrations3d/models/Marble.d.ts.map +1 -0
  107. package/dist/illustrations3d/models/MarbleCard.d.ts +3 -0
  108. package/dist/illustrations3d/models/MarbleCard.d.ts.map +1 -0
  109. package/dist/illustrations3d/models/MultiCurrency.d.ts +3 -0
  110. package/dist/illustrations3d/models/MultiCurrency.d.ts.map +1 -0
  111. package/dist/illustrations3d/models/Plane.d.ts +3 -0
  112. package/dist/illustrations3d/models/Plane.d.ts.map +1 -0
  113. package/dist/illustrations3d/utils.d.ts +10 -0
  114. package/dist/illustrations3d/utils.d.ts.map +1 -0
  115. package/dist/illustrations3d/utils.spec.d.ts +2 -0
  116. package/dist/illustrations3d/utils.spec.d.ts.map +1 -0
  117. package/dist/index-B8dsCxbf.js +405 -0
  118. package/dist/index-B8dsCxbf.js.map +1 -0
  119. package/dist/index-BLcCygw5.esm.js +399 -0
  120. package/dist/index-BLcCygw5.esm.js.map +1 -0
  121. package/dist/index.d.ts +10 -0
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.esm.js +6 -0
  124. package/dist/index.esm.js.map +1 -0
  125. package/dist/index.js +23 -0
  126. package/dist/index.js.map +1 -0
  127. package/dist/rive/RiveIllustration.d.ts +13 -0
  128. package/dist/rive/RiveIllustration.d.ts.map +1 -0
  129. package/dist/rive/index.d.ts +3 -0
  130. package/dist/rive/index.d.ts.map +1 -0
  131. package/dist/rive/index.esm.js +47 -0
  132. package/dist/rive/index.esm.js.map +1 -0
  133. package/dist/rive/index.js +53 -0
  134. package/dist/rive/index.js.map +1 -0
  135. package/package.json +6 -8
  136. package/src/flags/AllFlagsAndSizes.stories.tsx +48 -49
  137. package/src/illustrations/Illustration.stories.tsx +38 -35
  138. package/src/illustrations/metadata.ts +267 -5
  139. package/src/illustrations3d/Illustration3D.stories.tsx +34 -1
  140. package/src/illustrations3d/Illustration3D.tsx +2 -15
  141. package/src/illustrations3d/utils.ts +3 -17
@@ -0,0 +1,13 @@
1
+ import type { Illustration3DProps } from "../illustrations3d";
2
+ export interface RiveProps {
3
+ src: string;
4
+ animationNames?: string | string[];
5
+ }
6
+ export type Props = {
7
+ name: 'document-scan';
8
+ size?: Illustration3DProps["size"];
9
+ className?: Illustration3DProps["className"];
10
+ };
11
+ declare const RiveIllustrationExperimental: ({ name, size: sizeProp, className }: Props) => import("react").JSX.Element;
12
+ export default RiveIllustrationExperimental;
13
+ //# sourceMappingURL=RiveIllustration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiveIllustration.d.ts","sourceRoot":"","sources":["../../src/rive/RiveIllustration.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACpC;AAYD,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;CAC9C,CAAC;AAEF,QAAA,MAAM,4BAA4B,GAAI,qCAAoD,KAAK,gCAuB9F,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { Props as RiveIllustrationExperimentalProps } from './RiveIllustration';
2
+ export { default as RiveIllustrationExperimental } from './RiveIllustration';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rive/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,IAAI,iCAAiC,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { useRive } from '@rive-app/react-webgl2';
2
+ import clsx from 'clsx';
3
+ import { useState, useEffect } from 'react';
4
+ import { S as Sizes } from '../common-DBpCdW70.esm.js';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ const Rive = ({
8
+ src,
9
+ animationNames
10
+ }) => {
11
+ const {
12
+ RiveComponent
13
+ } = useRive({
14
+ src,
15
+ animations: animationNames,
16
+ autoplay: true
17
+ });
18
+ return /*#__PURE__*/jsx(RiveComponent, {});
19
+ };
20
+ const RiveIllustrationExperimental = ({
21
+ name,
22
+ size: sizeProp = Sizes.MEDIUM,
23
+ className
24
+ }) => {
25
+ const [size, setSize] = useState(sizeProp);
26
+ useEffect(() => {
27
+ const isMobile = (typeof window !== "undefined" && window?.matchMedia('(max-width: 575px)')?.matches) ?? false;
28
+ if (isMobile) {
29
+ setSize(Sizes.SMALL);
30
+ }
31
+ }, []);
32
+ return /*#__PURE__*/jsx("div", {
33
+ className: clsx(`wds-illustration-rive wds-illustration-rive-${name} wds-illustration-rive-${size}`, className),
34
+ children: (() => {
35
+ if (name === 'document-scan') {
36
+ return /*#__PURE__*/jsx(Rive, {
37
+ src: "https://wise.com/web-art/assets/illustrations3d/rive/doc-scan.riv",
38
+ animationNames: ["Scan Line Appearing", "Scan Line Moving"]
39
+ });
40
+ }
41
+ return null;
42
+ })()
43
+ });
44
+ };
45
+
46
+ export { RiveIllustrationExperimental };
47
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/rive/RiveIllustration.tsx"],"sourcesContent":["import { useRive } from \"@rive-app/react-webgl2\";\nimport clsx from \"clsx\";\nimport { useEffect, useState } from \"react\";\n\nimport { Sizes } from \"../common\";\nimport type { Illustration3DProps } from \"../illustrations3d\";\n\nexport interface RiveProps {\n src: string;\n animationNames?: string | string[];\n}\n\nconst Rive = ({ src, animationNames }: RiveProps) => {\n const { RiveComponent } = useRive({\n src,\n animations: animationNames,\n autoplay: true,\n });\n\n return (<RiveComponent />);\n};\n\nexport type Props = {\n name: 'document-scan';\n size?: Illustration3DProps[\"size\"];\n className?: Illustration3DProps[\"className\"];\n};\n\nconst RiveIllustrationExperimental = ({ name, size: sizeProp = Sizes.MEDIUM, className }: Props) => {\n const [size, setSize] = useState<Props['size']>(sizeProp);\n useEffect(() => {\n const isMobile: boolean =\n (typeof window !== \"undefined\" && window?.matchMedia('(max-width: 575px)')?.matches) ?? false;\n if (isMobile) {\n setSize(Sizes.SMALL);\n }\n }, []);\n return (\n <div className={clsx('wds-illustration-rive', `wds-illustration-rive-${name}`, `wds-illustration-rive-${size}`, className)}>\n {(() => {\n if (name === 'document-scan') {\n return (\n <Rive\n src=\"https://wise.com/web-art/assets/illustrations3d/rive/doc-scan.riv\"\n animationNames={[\"Scan Line Appearing\", \"Scan Line Moving\"]}\n />);\n }\n return null;\n })()}\n </div>\n );\n};\n\nexport default RiveIllustrationExperimental;\n"],"names":["Rive","src","animationNames","RiveComponent","useRive","animations","autoplay","_jsx","RiveIllustrationExperimental","name","size","sizeProp","Sizes","MEDIUM","className","setSize","useState","useEffect","isMobile","window","matchMedia","matches","SMALL","clsx","children"],"mappings":";;;;;;AAYA,MAAMA,IAAI,GAAGA,CAAC;EAAEC,GAAG;AAAEC,EAAAA;AAAc,CAAa,KAAI;EAClD,MAAM;AAAEC,IAAAA;GAAe,GAAGC,OAAO,CAAC;IAChCH,GAAG;AACHI,IAAAA,UAAU,EAAEH,cAAc;AAC1BI,IAAAA,QAAQ,EAAE;AACX,GAAA,CAAC;AAEF,EAAA,oBAAQC,GAAA,CAACJ,aAAa,EAAA,EAAA,CAAG;AAC3B,CAAC;AAQD,MAAMK,4BAA4B,GAAGA,CAAC;EAAEC,IAAI;AAAEC,EAAAA,IAAI,EAAEC,QAAQ,GAAGC,KAAK,CAACC,MAAM;AAAEC,EAAAA;AAAS,CAAS,KAAI;EACjG,MAAM,CAACJ,IAAI,EAAEK,OAAO,CAAC,GAAGC,QAAQ,CAAgBL,QAAQ,CAAC;AACzDM,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,MAAMC,QAAQ,GACZ,CAAC,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,EAAEC,UAAU,CAAC,oBAAoB,CAAC,EAAEC,OAAO,KAAK,KAAK;AAC/F,IAAA,IAAIH,QAAQ,EAAE;AACZH,MAAAA,OAAO,CAACH,KAAK,CAACU,KAAK,CAAC;AACtB,IAAA;EACF,CAAC,EAAE,EAAE,CAAC;AACN,EAAA,oBACEf,GAAA,CAAA,KAAA,EAAA;IAAKO,SAAS,EAAES,IAAI,CAAA,CAAA,4CAAA,EAAmDd,IAAI,0BAA6BC,IAAI,CAAA,CAAA,EAAII,SAAS,CAAE;IAAAU,QAAA,EACxH,CAAC,MAAK;MACL,IAAIf,IAAI,KAAK,eAAe,EAAE;QAC5B,oBACEF,GAAA,CAACP,IAAI,EAAA;AACHC,UAAAA,GAAG,EAAC,mEAAmE;AACvEC,UAAAA,cAAc,EAAE,CAAC,qBAAqB,EAAE,kBAAkB;AAAE,SAAA,CAC5D;AACN,MAAA;AACA,MAAA,OAAO,IAAI;AACb,IAAA,CAAC;AAAG,GACD,CAAC;AAEV;;;;"}
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ var reactWebgl2 = require('@rive-app/react-webgl2');
4
+ var clsx = require('clsx');
5
+ var react = require('react');
6
+ var common = require('../common-H4L6Hbbh.js');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
+
11
+ var clsx__default = /*#__PURE__*/_interopDefault(clsx);
12
+
13
+ const Rive = ({
14
+ src,
15
+ animationNames
16
+ }) => {
17
+ const {
18
+ RiveComponent
19
+ } = reactWebgl2.useRive({
20
+ src,
21
+ animations: animationNames,
22
+ autoplay: true
23
+ });
24
+ return /*#__PURE__*/jsxRuntime.jsx(RiveComponent, {});
25
+ };
26
+ const RiveIllustrationExperimental = ({
27
+ name,
28
+ size: sizeProp = common.Sizes.MEDIUM,
29
+ className
30
+ }) => {
31
+ const [size, setSize] = react.useState(sizeProp);
32
+ react.useEffect(() => {
33
+ const isMobile = (typeof window !== "undefined" && window?.matchMedia('(max-width: 575px)')?.matches) ?? false;
34
+ if (isMobile) {
35
+ setSize(common.Sizes.SMALL);
36
+ }
37
+ }, []);
38
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
39
+ className: clsx__default.default(`wds-illustration-rive wds-illustration-rive-${name} wds-illustration-rive-${size}`, className),
40
+ children: (() => {
41
+ if (name === 'document-scan') {
42
+ return /*#__PURE__*/jsxRuntime.jsx(Rive, {
43
+ src: "https://wise.com/web-art/assets/illustrations3d/rive/doc-scan.riv",
44
+ animationNames: ["Scan Line Appearing", "Scan Line Moving"]
45
+ });
46
+ }
47
+ return null;
48
+ })()
49
+ });
50
+ };
51
+
52
+ exports.RiveIllustrationExperimental = RiveIllustrationExperimental;
53
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/rive/RiveIllustration.tsx"],"sourcesContent":["import { useRive } from \"@rive-app/react-webgl2\";\nimport clsx from \"clsx\";\nimport { useEffect, useState } from \"react\";\n\nimport { Sizes } from \"../common\";\nimport type { Illustration3DProps } from \"../illustrations3d\";\n\nexport interface RiveProps {\n src: string;\n animationNames?: string | string[];\n}\n\nconst Rive = ({ src, animationNames }: RiveProps) => {\n const { RiveComponent } = useRive({\n src,\n animations: animationNames,\n autoplay: true,\n });\n\n return (<RiveComponent />);\n};\n\nexport type Props = {\n name: 'document-scan';\n size?: Illustration3DProps[\"size\"];\n className?: Illustration3DProps[\"className\"];\n};\n\nconst RiveIllustrationExperimental = ({ name, size: sizeProp = Sizes.MEDIUM, className }: Props) => {\n const [size, setSize] = useState<Props['size']>(sizeProp);\n useEffect(() => {\n const isMobile: boolean =\n (typeof window !== \"undefined\" && window?.matchMedia('(max-width: 575px)')?.matches) ?? false;\n if (isMobile) {\n setSize(Sizes.SMALL);\n }\n }, []);\n return (\n <div className={clsx('wds-illustration-rive', `wds-illustration-rive-${name}`, `wds-illustration-rive-${size}`, className)}>\n {(() => {\n if (name === 'document-scan') {\n return (\n <Rive\n src=\"https://wise.com/web-art/assets/illustrations3d/rive/doc-scan.riv\"\n animationNames={[\"Scan Line Appearing\", \"Scan Line Moving\"]}\n />);\n }\n return null;\n })()}\n </div>\n );\n};\n\nexport default RiveIllustrationExperimental;\n"],"names":["Rive","src","animationNames","RiveComponent","useRive","animations","autoplay","_jsx","RiveIllustrationExperimental","name","size","sizeProp","Sizes","MEDIUM","className","setSize","useState","useEffect","isMobile","window","matchMedia","matches","SMALL","clsx","children"],"mappings":";;;;;;;;;;;;AAYA,MAAMA,IAAI,GAAGA,CAAC;EAAEC,GAAG;AAAEC,EAAAA;AAAc,CAAa,KAAI;EAClD,MAAM;AAAEC,IAAAA;GAAe,GAAGC,mBAAO,CAAC;IAChCH,GAAG;AACHI,IAAAA,UAAU,EAAEH,cAAc;AAC1BI,IAAAA,QAAQ,EAAE;AACX,GAAA,CAAC;AAEF,EAAA,oBAAQC,cAAA,CAACJ,aAAa,EAAA,EAAA,CAAG;AAC3B,CAAC;AAQD,MAAMK,4BAA4B,GAAGA,CAAC;EAAEC,IAAI;AAAEC,EAAAA,IAAI,EAAEC,QAAQ,GAAGC,YAAK,CAACC,MAAM;AAAEC,EAAAA;AAAS,CAAS,KAAI;EACjG,MAAM,CAACJ,IAAI,EAAEK,OAAO,CAAC,GAAGC,cAAQ,CAAgBL,QAAQ,CAAC;AACzDM,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,MAAMC,QAAQ,GACZ,CAAC,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,EAAEC,UAAU,CAAC,oBAAoB,CAAC,EAAEC,OAAO,KAAK,KAAK;AAC/F,IAAA,IAAIH,QAAQ,EAAE;AACZH,MAAAA,OAAO,CAACH,YAAK,CAACU,KAAK,CAAC;AACtB,IAAA;EACF,CAAC,EAAE,EAAE,CAAC;AACN,EAAA,oBACEf,cAAA,CAAA,KAAA,EAAA;IAAKO,SAAS,EAAES,qBAAI,CAAA,CAAA,4CAAA,EAAmDd,IAAI,0BAA6BC,IAAI,CAAA,CAAA,EAAII,SAAS,CAAE;IAAAU,QAAA,EACxH,CAAC,MAAK;MACL,IAAIf,IAAI,KAAK,eAAe,EAAE;QAC5B,oBACEF,cAAA,CAACP,IAAI,EAAA;AACHC,UAAAA,GAAG,EAAC,mEAAmE;AACvEC,UAAAA,cAAc,EAAE,CAAC,qBAAqB,EAAE,kBAAkB;AAAE,SAAA,CAC5D;AACN,MAAA;AACA,MAAA,OAAO,IAAI;AACb,IAAA,CAAC;AAAG,GACD,CAAC;AAEV;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/art",
3
- "version": "0.0.0-experimental-7f4f66a",
3
+ "version": "0.0.0-experimental-b088eec",
4
4
  "license": "MIT",
5
5
  "description": "React library for art elements in UI",
6
6
  "homepage": "https://github.com/transferwise/web-art#readme",
@@ -76,7 +76,7 @@
76
76
  "storybook": "^10.2.10",
77
77
  "typescript": "^5.9.3",
78
78
  "vite": "^7.3.1",
79
- "wise-atoms": "git+https://github.com/transferwise/wise-atoms.git#3e078a112be8ca2b2fc736a95e607b8b41bae94f",
79
+ "wise-atoms": "git+https://github.com/transferwise/wise-atoms.git#0f3db58bbc3aef475d869f20f6a1a7e54b6decfb",
80
80
  "@storybook/addon-docs": "^10.2.10",
81
81
  "@changesets/cli": "^2.29.8",
82
82
  "@changesets/changelog-github": "0.5.2"
@@ -96,18 +96,16 @@
96
96
  "setup": "pnpm install && pnpm build",
97
97
  "load-3d-i10s": "rm -rf s3-bucket/illustrations3d/ && node ./scripts/load-3d-i10s.mjs && pnpm load-riv",
98
98
  "load-riv": "copyfiles -u 1 assets/*.riv s3-bucket/illustrations3d/rive",
99
- "load-i10s": "copyfiles -u 3 node_modules/wise-atoms/illustrations/**/*.png temp",
99
+ "load-i10s": "copyfiles -u 4 node_modules/wise-atoms/assets/illustrations/**/*.webp s3-bucket/illustrations",
100
100
  "load-flags": "rm -rf s3-bucket/flags/* && pnpm load-country-flags && pnpm load-currency-flags && pnpm transform-flags && pnpm convert-flags-svg-to-png",
101
- "load-country-flags": "copyfiles -u 3 node_modules/wise-atoms/flags/*.svg s3-bucket/flags && node ./scripts/generate-country-flags.mjs",
102
- "load-currency-flags": "copyfiles -u 3 node_modules/wise-atoms/flags/.metadata.json s3-bucket/flags && node ./scripts/generate-currency-flags.mjs",
101
+ "load-country-flags": "copyfiles -u 4 node_modules/wise-atoms/assets/flags/*.svg s3-bucket/flags && node ./scripts/generate-country-flags.mjs",
102
+ "load-currency-flags": "copyfiles -u 4 node_modules/wise-atoms/assets/flags/_metadata.json s3-bucket/flags && node ./scripts/generate-currency-flags.mjs",
103
103
  "transform-flags": "node ./scripts/transform-flags.mjs",
104
104
  "convert-flags-svg-to-png": "node ./scripts/convert-flags-svg-to-png.mjs",
105
- "convert-i10s-png-to-webp": "rm -rf s3-bucket/illustrations/ && copyfiles --f node_modules/wise-atoms/illustrations/**/*.png s3-bucket/illustrations && node ./scripts/convert-png-to-webp.mjs",
106
105
  "generate-i10s-metadata": "node ./scripts/generate-i10s-metadata.mjs && eslint 'src/illustrations/metadata.ts' --fix",
107
106
  "generate-flags-metadata": "node ./scripts/generate-flags-metadata.mjs && eslint 'src/flags/metadata.ts' --fix",
108
107
  "bundle": "rm -rf dist && rollup --config --sourcemap && pnpm build-styles",
109
- "cleanup": "rm -rf temp",
110
- "build": "NODE_ENV=web-art-prod pnpm load-i10s && pnpm load-3d-i10s && pnpm convert-i10s-png-to-webp && pnpm generate-i10s-metadata && pnpm load-flags && pnpm generate-flags-metadata",
108
+ "build": "NODE_ENV=web-art-prod pnpm load-i10s && pnpm load-3d-i10s && pnpm generate-i10s-metadata && pnpm load-flags && pnpm generate-flags-metadata && pnpm bundle",
111
109
  "start": "storybook dev -p 3001",
112
110
  "dev": "NODE_ENV=web-art-dev pnpm start",
113
111
  "test": "jest",
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import flagRawMetaData from "../../node_modules/wise-atoms/assets/flags/_metadata.json";
2
3
 
3
- import flagRawMetaData from '../../node_modules/wise-atoms/flags/.metadata.json';
4
4
  import { Flag } from './Flag';
5
5
 
6
6
  const meta: Meta<typeof Flag> = {
@@ -14,19 +14,22 @@ type Story = StoryObj<typeof Flag>;
14
14
  // Helper function to render all flags and sizes for a given region
15
15
  const AllFlagsAndSizes = (region: string) => {
16
16
  const regionFlags = Object.entries(flagRawMetaData)
17
- .filter(([currentRegion]) => currentRegion === region)
18
- .flatMap(([, flags]) => flags)
19
- .reduce<{ country: string[]; currencies: string[][] }[]>((acc, flag) => {
20
- const existing = acc.find(
21
- (currentFlag) => currentFlag.country[0] && currentFlag.country[0] === flag.country[0],
22
- );
23
- if (existing) {
24
- existing.currencies.push(flag.currency);
25
- } else {
26
- acc.push({ country: flag.country, currencies: [flag.currency] });
27
- }
28
- return acc;
29
- }, []);
17
+ .filter(([, entry]) => entry.group === region)
18
+ .filter(([key]) => !key.endsWith('-detailed'))
19
+ .map(([key, entry]) => {
20
+ const name = key
21
+ .replace(/^[a-z0-9]+-/u, '')
22
+ .split('-')
23
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
24
+ .join(' ');
25
+
26
+ return {
27
+ key,
28
+ name,
29
+ iso2: 'iso2' in entry ? entry.iso2 : undefined,
30
+ currencyCode: 'currencyCode' in entry ? entry.currencyCode : undefined,
31
+ };
32
+ });
30
33
 
31
34
  return (
32
35
  <>
@@ -45,59 +48,56 @@ const AllFlagsAndSizes = (region: string) => {
45
48
  <div
46
49
  style={{
47
50
  display: 'grid',
48
- gridTemplateColumns: 'repeat(auto-fill, minmax(350px, 1fr))',
49
- gap: 'var(--size-24)',
51
+ gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',
52
+ gap: 'var(--padding-small)',
50
53
  }}
51
54
  >
52
55
  {regionFlags.map((flag) => {
53
- const countryCode = flag.country[0]?.toUpperCase();
54
- const primaryCurrencyCode = flag.currencies[0]?.[0]?.toUpperCase();
55
- const flagCode = countryCode ?? primaryCurrencyCode;
56
- const currencyCodes = flag.currencies.map((currency) => currency[0]).filter(Boolean).map((code) => code.toUpperCase());
57
-
58
- // Covers cases where there's just a currency code and no country (e.g. Euro)
59
- const flagName = countryCode
60
- ? flag.country.at(-1)
61
- : flag.currencies[0]?.at(-1);
56
+ const flagCode = flag.iso2 ?? flag.currencyCode ?? flag.key;
62
57
 
63
58
  return (
64
59
  <div
65
- key={flagName}
60
+ key={flag.key}
66
61
  style={{
67
- display: 'grid',
68
- gridTemplateColumns: 'auto auto minmax(auto, 1fr)',
69
- gap: 'var(--size-12)',
62
+ display: 'flex',
63
+ flexDirection: 'column',
70
64
  alignItems: 'center',
65
+ gap: 'var(--padding-small)',
66
+ padding: 'var(--padding-small)',
67
+ border: '1px solid var(--color-border-neutral)',
68
+ borderRadius: 'var(--radius-large)',
71
69
  }}
72
70
  >
73
- <Flag code={flagCode} intrinsicSize={150} />
74
- <Flag code={flagCode} />
75
71
  <div
76
72
  style={{
77
73
  display: 'flex',
78
- flexWrap: 'wrap',
74
+ alignItems: 'center',
75
+ gap: 'var(--padding-small)',
76
+ }}
77
+ >
78
+ <Flag code={flagCode} />
79
+ <Flag code={flagCode} intrinsicSize={150} />
80
+ </div>
81
+ <div
82
+ style={{
83
+ display: 'flex',
79
84
  flexDirection: 'column',
80
85
  alignItems: 'flex-start',
81
86
  }}
82
87
  >
83
- <strong>{flagName}</strong>
88
+ <strong>{flag.name}</strong>
84
89
  <span>
85
- {countryCode && (
90
+ {flag.iso2 && (
91
+ <>
92
+ Country: <code>{flag.iso2}</code>
93
+ </>
94
+ )}
95
+ {flag.currencyCode && (
86
96
  <>
87
- Country: <code>{countryCode}</code>
97
+ {flag.iso2 && <br />}
98
+ Currency: <code>{flag.currencyCode}</code>
88
99
  </>
89
100
  )}
90
- {currencyCodes.length > 0 && (
91
- <>
92
- <br />
93
- <span>
94
- {`${currencyCodes.length === 1 ? 'Currency' : 'Currencies'}: `}
95
- {currencyCodes.map((currencyCode) => (
96
- <code key={currencyCode}>{currencyCode}</code>
97
- ))}
98
- </span>
99
- </>
100
- )}
101
101
  </span>
102
102
  </div>
103
103
  </div>
@@ -108,7 +108,6 @@ const AllFlagsAndSizes = (region: string) => {
108
108
  );
109
109
  };
110
110
 
111
- // Stories for each region
112
111
  export const Africa: Story = {
113
112
  render: () => AllFlagsAndSizes('Africa'),
114
113
  };
@@ -141,6 +140,6 @@ export const SouthAmerica: Story = {
141
140
  render: () => AllFlagsAndSizes('South America'),
142
141
  };
143
142
 
144
- export const Fallback: Story = {
145
- render: () => AllFlagsAndSizes('Fallback'),
143
+ export const Misc: Story = {
144
+ render: () => AllFlagsAndSizes('Misc'),
146
145
  };
@@ -20,39 +20,42 @@ export const Basic: Story = {
20
20
  },
21
21
  };
22
22
 
23
- export const All = () => {
24
- const assetNames = Object.values(Assets);
25
- return (
26
- <>
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>
56
- </>
57
- );
23
+ export const All: Story = {
24
+ tags: ["autodocs"],
25
+ render: () => {
26
+ const assetNames = Object.values(Assets);
27
+ return (
28
+ <>
29
+ <span className="np-text-body-large-bold">
30
+ Total number of illustrations: {assetNames.length}
31
+ </span>
32
+ <div
33
+ style={{
34
+ display: "grid",
35
+ gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))",
36
+ gap: "var(--padding-small)",
37
+ }}
38
+ >
39
+ {assetNames.map((assetName) => (
40
+ <div
41
+ key={assetName}
42
+ style={{
43
+ display: "grid",
44
+ alignItems: "center",
45
+ justifyItems: "center",
46
+ }}
47
+ >
48
+ <Illustration
49
+ alt={assetName}
50
+ name={assetName as IllustrationNames}
51
+ />
52
+ <span>
53
+ <code>{assetName}</code>
54
+ </span>
55
+ </div>
56
+ ))}
57
+ </div>
58
+ </>
59
+ );
60
+ },
58
61
  };