@wise/art 2.5.0 → 2.6.0-beta.2

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 (144) hide show
  1. package/README.md +0 -1
  2. package/dist/CheckMark-1d199954.js +39 -0
  3. package/dist/CheckMark-1d199954.js.map +1 -0
  4. package/dist/CheckMark-dfa7e17d.js +37 -0
  5. package/dist/CheckMark-dfa7e17d.js.map +1 -0
  6. package/dist/Confetti-3f6f42f8.js +36 -0
  7. package/dist/Confetti-3f6f42f8.js.map +1 -0
  8. package/dist/Confetti-a1500ca5.js +34 -0
  9. package/dist/Confetti-a1500ca5.js.map +1 -0
  10. package/dist/Flower-01a6ad2e.js +27 -0
  11. package/dist/Flower-01a6ad2e.js.map +1 -0
  12. package/dist/Flower-194046f6.js +29 -0
  13. package/dist/Flower-194046f6.js.map +1 -0
  14. package/dist/Globe-e0b92541.js +43 -0
  15. package/dist/Globe-e0b92541.js.map +1 -0
  16. package/dist/Globe-f9a29570.js +45 -0
  17. package/dist/Globe-f9a29570.js.map +1 -0
  18. package/dist/Graph-a5cabcf9.js +33 -0
  19. package/dist/Graph-a5cabcf9.js.map +1 -0
  20. package/dist/Graph-d719e9bc.js +31 -0
  21. package/dist/Graph-d719e9bc.js.map +1 -0
  22. package/dist/Illustration.css +19 -0
  23. package/dist/Jars-786486f1.js +50 -0
  24. package/dist/Jars-786486f1.js.map +1 -0
  25. package/dist/Jars-ce225524.js +52 -0
  26. package/dist/Jars-ce225524.js.map +1 -0
  27. package/dist/Lock-32a1942d.js +41 -0
  28. package/dist/Lock-32a1942d.js.map +1 -0
  29. package/dist/Lock-a8143e20.js +43 -0
  30. package/dist/Lock-a8143e20.js.map +1 -0
  31. package/dist/MagnifyingGlass-8d2fb672.js +32 -0
  32. package/dist/MagnifyingGlass-8d2fb672.js.map +1 -0
  33. package/dist/MagnifyingGlass-d6a087d9.js +30 -0
  34. package/dist/MagnifyingGlass-d6a087d9.js.map +1 -0
  35. package/dist/Marble-4abb104b.js +42 -0
  36. package/dist/Marble-4abb104b.js.map +1 -0
  37. package/dist/Marble-ce46aa0f.js +44 -0
  38. package/dist/Marble-ce46aa0f.js.map +1 -0
  39. package/dist/MarbleCard-56c75d72.js +47 -0
  40. package/dist/MarbleCard-56c75d72.js.map +1 -0
  41. package/dist/MarbleCard-877fd12e.js +45 -0
  42. package/dist/MarbleCard-877fd12e.js.map +1 -0
  43. package/dist/MultiCurrency-0e4db1a6.js +61 -0
  44. package/dist/MultiCurrency-0e4db1a6.js.map +1 -0
  45. package/dist/MultiCurrency-700fce5f.js +63 -0
  46. package/dist/MultiCurrency-700fce5f.js.map +1 -0
  47. package/dist/Plane-88c1d61e.js +37 -0
  48. package/dist/Plane-88c1d61e.js.map +1 -0
  49. package/dist/Plane-8eb0f41c.js +39 -0
  50. package/dist/Plane-8eb0f41c.js.map +1 -0
  51. package/dist/Scene-597f1100.js +50 -0
  52. package/dist/Scene-597f1100.js.map +1 -0
  53. package/dist/Scene-e2e3b7aa.js +48 -0
  54. package/dist/Scene-e2e3b7aa.js.map +1 -0
  55. package/dist/common.d.ts +15 -9
  56. package/dist/common.d.ts.map +1 -0
  57. package/dist/flags/Flag.d.ts +13 -12
  58. package/dist/flags/Flag.d.ts.map +1 -0
  59. package/dist/flags/index.d.ts +3 -2
  60. package/dist/flags/index.d.ts.map +1 -0
  61. package/dist/illustrations/Illustration.d.ts +21 -20
  62. package/dist/illustrations/Illustration.d.ts.map +1 -0
  63. package/dist/illustrations/index.d.ts +5 -4
  64. package/dist/illustrations/index.d.ts.map +1 -0
  65. package/dist/illustrations/metadata.d.ts +69 -68
  66. package/dist/illustrations/metadata.d.ts.map +1 -0
  67. package/dist/illustrations3d/Illustration3d.d.ts +11 -0
  68. package/dist/illustrations3d/Illustration3d.d.ts.map +1 -0
  69. package/dist/illustrations3d/Scene.d.ts +9 -0
  70. package/dist/illustrations3d/Scene.d.ts.map +1 -0
  71. package/dist/illustrations3d/index.d.ts +5 -0
  72. package/dist/illustrations3d/index.d.ts.map +1 -0
  73. package/dist/illustrations3d/models/CheckMark.d.ts +4 -0
  74. package/dist/illustrations3d/models/CheckMark.d.ts.map +1 -0
  75. package/dist/illustrations3d/models/Confetti.d.ts +4 -0
  76. package/dist/illustrations3d/models/Confetti.d.ts.map +1 -0
  77. package/dist/illustrations3d/models/Flower.d.ts +4 -0
  78. package/dist/illustrations3d/models/Flower.d.ts.map +1 -0
  79. package/dist/illustrations3d/models/Globe.d.ts +4 -0
  80. package/dist/illustrations3d/models/Globe.d.ts.map +1 -0
  81. package/dist/illustrations3d/models/Graph.d.ts +4 -0
  82. package/dist/illustrations3d/models/Graph.d.ts.map +1 -0
  83. package/dist/illustrations3d/models/Jars.d.ts +4 -0
  84. package/dist/illustrations3d/models/Jars.d.ts.map +1 -0
  85. package/dist/illustrations3d/models/Lock.d.ts +4 -0
  86. package/dist/illustrations3d/models/Lock.d.ts.map +1 -0
  87. package/dist/illustrations3d/models/MagnifyingGlass.d.ts +4 -0
  88. package/dist/illustrations3d/models/MagnifyingGlass.d.ts.map +1 -0
  89. package/dist/illustrations3d/models/Marble.d.ts +4 -0
  90. package/dist/illustrations3d/models/Marble.d.ts.map +1 -0
  91. package/dist/illustrations3d/models/MarbleCard.d.ts +4 -0
  92. package/dist/illustrations3d/models/MarbleCard.d.ts.map +1 -0
  93. package/dist/illustrations3d/models/MultiCurrency.d.ts +4 -0
  94. package/dist/illustrations3d/models/MultiCurrency.d.ts.map +1 -0
  95. package/dist/illustrations3d/models/Plane.d.ts +4 -0
  96. package/dist/illustrations3d/models/Plane.d.ts.map +1 -0
  97. package/dist/illustrations3d/utils.d.ts +9 -0
  98. package/dist/illustrations3d/utils.d.ts.map +1 -0
  99. package/dist/index-322e874c.js +332 -0
  100. package/dist/index-322e874c.js.map +1 -0
  101. package/dist/index-3bf9c1e9.js +325 -0
  102. package/dist/index-3bf9c1e9.js.map +1 -0
  103. package/dist/index.d.ts +10 -6
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +21 -1
  106. package/dist/index.js.map +1 -1
  107. package/dist/index.mjs +5 -0
  108. package/dist/index.mjs.map +1 -0
  109. package/package.json +48 -24
  110. package/src/common.ts +17 -0
  111. package/src/flags/Flag.stories.tsx +19 -0
  112. package/src/flags/Flag.tsx +40 -0
  113. package/src/flags/index.ts +2 -0
  114. package/src/illustrations/Illustration.css +27 -0
  115. package/src/illustrations/Illustration.stories.tsx +33 -0
  116. package/src/illustrations/Illustration.tsx +95 -0
  117. package/src/illustrations/index.ts +5 -0
  118. package/src/illustrations/metadata.ts +141 -0
  119. package/src/illustrations3d/Illustration3d.stories.tsx +89 -0
  120. package/src/illustrations3d/Illustration3d.tsx +133 -0
  121. package/src/illustrations3d/Scene.tsx +54 -0
  122. package/src/illustrations3d/index.ts +6 -0
  123. package/src/illustrations3d/models/CheckMark.tsx +30 -0
  124. package/src/illustrations3d/models/Confetti.tsx +29 -0
  125. package/src/illustrations3d/models/Flower.tsx +25 -0
  126. package/src/illustrations3d/models/Globe.tsx +42 -0
  127. package/src/illustrations3d/models/Graph.tsx +27 -0
  128. package/src/illustrations3d/models/Jars.tsx +47 -0
  129. package/src/illustrations3d/models/Lock.tsx +38 -0
  130. package/src/illustrations3d/models/MagnifyingGlass.tsx +31 -0
  131. package/src/illustrations3d/models/Marble.tsx +57 -0
  132. package/src/illustrations3d/models/MarbleCard.tsx +62 -0
  133. package/src/illustrations3d/models/MultiCurrency.tsx +58 -0
  134. package/src/illustrations3d/models/Plane.tsx +33 -0
  135. package/src/illustrations3d/utils.ts +68 -0
  136. package/src/index.ts +12 -0
  137. package/dist/flags/Flag.stories.d.ts +0 -6
  138. package/dist/illustrations/Illustration.stories.d.ts +0 -19
  139. package/dist/index.modern.mjs +0 -2
  140. package/dist/index.modern.mjs.map +0 -1
  141. package/dist/index.module.js +0 -2
  142. package/dist/index.module.js.map +0 -1
  143. package/dist/index.umd.js +0 -2
  144. package/dist/index.umd.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
- export { Flag } from './flags';
2
- export { default as Illustration } from './illustrations';
3
- export { Assets } from './illustrations';
4
- export { Sizes } from './common';
5
- export type { FlagProps } from './flags';
6
- export type { IllustrationNames, IllustrationProps } from './illustrations';
1
+ export { Flag } from './flags';
2
+ export { default as Illustration } from './illustrations';
3
+ export { default as Illustration3d } from './illustrations3d';
4
+ export { Assets } from './illustrations';
5
+ export { Sizes } from './common';
6
+ export type { FlagProps } from './flags';
7
+ export type { IllustrationNames, IllustrationProps } from './illustrations';
8
+ export type { Illustration3dNames, Illustration3dProps } from './illustrations3d';
9
+ export { is3dIllustrationSupported } from './illustrations3d';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,22 @@
1
- var e=require("react"),t=require("classnames");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r,a,s=/*#__PURE__*/i(e),l=/*#__PURE__*/i(t);exports.Sizes=void 0,(r=exports.Sizes||(exports.Sizes={})).SMALL="small",r.MEDIUM="medium",r.LARGE="large";var E,n=((a={})[exports.Sizes.SMALL]=200,a[exports.Sizes.MEDIUM]=300,a[exports.Sizes.LARGE]=500,a),o=e.forwardRef(function(e,t){var i=e.id,r=e.name,a=e.alt,E=e.loading,o=void 0===E?"eager":E,d=e.className,u=e.size,A=void 0===u?exports.Sizes.MEDIUM:u,I=e.disablePadding,p=void 0!==I&&I,R=exports.Sizes.SMALL,L=exports.Sizes.MEDIUM;return r?/*#__PURE__*/s.default.createElement("picture",null,A===exports.Sizes.LARGE||A===exports.Sizes.MEDIUM?/*#__PURE__*/s.default.createElement(s.default.Fragment,null,/*#__PURE__*/s.default.createElement("source",{width:n[R],height:n[R],media:"(max-width: 575px)",srcSet:c(r,R,"1x")+", "+c(r,R,"2x")+" 2x"}),A!==exports.Sizes.MEDIUM?/*#__PURE__*/s.default.createElement("source",{width:n[L],height:n[L],media:"(max-width: 992px)",srcSet:c(r,L,"1x")+", "+c(r,L,"2x")+" 2x"}):null):null,/*#__PURE__*/s.default.createElement("img",{id:i,ref:t,alt:null!=a?a:r.replace("-"," "),"data-testid":"wds-"+r+"-illustration",className:l.default("wds-illustration","wds-illustration-"+r,{"wds-illustration-padding":!p},d),loading:o,src:c(r,A,"1x"),srcSet:c(r,A,"2x")+" 2x",width:n[A],height:n[A]})):null});function c(e,t,i){return"https://wise.com/web-art/assets/illustrations/"+e+"-"+t+"@"+i+".webp"}exports.Assets=void 0,(E=exports.Assets||(exports.Assets={})).BELL="bell",E.BRIEFCASE="briefcase",E.BUSINESS_CARD="business-card",E.CALENDAR="calendar",E.CHECK_MARK="check-mark",E.CLOSED_WINDOW="closed-window",E.COIN_PILE_DOWN="coin-pile-down",E.COIN_PILE_UP="coin-pile-up",E.CONFETTI="confetti",E.CONSTRUCTION_FENCE="construction-fence",E.CONVERT="convert",E.COOKIE="cookie",E.DIGITAL_CARD_2="digital-card-2",E.DIGITAL_CARD="digital-card",E.DOCUMENTS="documents",E.DOOR="door",E.ECO_CARD="eco-card",E.ELECTRIC_PLUG="electric-plug",E.EMAIL_SUCCESS="email-success",E.EMAIL="email",E.EXCLAMATION_MARK="exclamation-mark",E.FLAG="flag",E.FLOWER="flower",E.GEAR="gear",E.GLOBE="globe",E.GRAPH="graph",E.HEART_2="heart-2",E.HEART_3="heart-3",E.HEART_4="heart-4",E.HEART_5="heart-5",E.HEART="heart",E.HOUSE="house",E.ID_CARD="id-card",E.INFINITE="infinite",E.INVITE_LETTER="invite-letter",E.JARS="jars",E.KEY="key",E.LIGHT_BULB="light-bulb",E.LOCK="lock",E.MAGNIFYING_GLASS="magnifying-glass",E.MAP="map",E.MARBLE_CARD_BUSINESS="marble-card-business",E.MARBLE_CARD="marble-card",E.MARBLE="marble",E.MEGAPHONE="megaphone",E.MULTI_CURRENCY="multi-currency",E.ONE_INVITE_LETTER_OPENED="one-invite-letter-opened",E.PALM_TREE="palm-tree",E.PERCENTAGE="percentage",E.PERSONAL_CARD="personal-card",E.PHONES="phones",E.PIE_CHART="pie-chart",E.PLANE_2="plane-2",E.PLANE="plane",E.PUZZLE_PIECES="puzzle-pieces",E.QUESTION_MARK="question-mark",E.RECEIVE="receive",E.REMINDER_LETTER="reminder-letter",E.SAND_TIMER="sand-timer",E.SHOPPING_BAG="shopping-bag",E.SKIP_AUTHENTICATION="skip-authentication",E.SPEECH_BUBBLE="speech-bubble",E.TOOL="tool",E.TWO_INVITE_LETTERS_OPENED="two-invite-letters-opened",E.WALLET="wallet",exports.Flag=function(t){var i=t.code,r=t.intrinsicSize,a=void 0===r?64:r,s=e.useState(null),l=s[0],E=s[1];e.useEffect(function(){E(null)},[i]);var n=a>=150,o="unknown"!==l?i.toLowerCase()+(null==l&&n?"-detailed":""):"wise";/*#__PURE__*/return React.createElement("img",{src:"https://wise.com/web-art/assets/flags/"+o+".svg",alt:"",width:a,height:a,onError:function(){E(function(e){return null==e&&n?"simple":"unknown"})}})},exports.Illustration=o;
1
+ 'use strict';
2
+
3
+ var index = require('./index-322e874c.js');
4
+ require('react');
5
+ require('react/jsx-runtime');
6
+ require('clsx');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, 'Assets', {
11
+ enumerable: true,
12
+ get: function () { return index.Assets; }
13
+ });
14
+ exports.Flag = index.Flag;
15
+ exports.Illustration = index.Illustration;
16
+ exports.Illustration3d = index.Illustration3d;
17
+ Object.defineProperty(exports, 'Sizes', {
18
+ enumerable: true,
19
+ get: function () { return index.Sizes; }
20
+ });
21
+ exports.is3dIllustrationSupported = index.is3dIllustrationSupported;
2
22
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/common.ts","../src/illustrations/Illustration.tsx","../src/illustrations/metadata.ts","../src/flags/Flag.tsx"],"sourcesContent":["export enum Sizes {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\nexport type LargeSize = 'large';\nexport type MediumSize = 'medium';\nexport type SmallSize = 'small';\n\nexport type Descriptors = '1x' | '1.5x' | '2x' | '3x' | '4x';\n","import classNames from 'classnames';\nimport React, { forwardRef, ImgHTMLAttributes } from 'react';\n\nimport { LargeSize, MediumSize, SmallSize, Descriptors, Sizes } from './../common';\nimport { IllustrationNames } from './metadata';\n\n// Picking only a few props from Image element to avoid breaking change\n// as in future underlying element might change\ntype ImgProps = Pick<ImgHTMLAttributes<HTMLImageElement>, 'id' | 'className'>;\n\nexport type IllustrationSizes = LargeSize | MediumSize | SmallSize;\n\nexport type Props = {\n name: IllustrationNames;\n alt: string;\n size?: IllustrationSizes;\n loading?: 'eager' | 'lazy';\n disablePadding?: boolean;\n} & ImgProps;\n\nconst imageSizes = {\n [Sizes.SMALL]: 200,\n [Sizes.MEDIUM]: 300,\n [Sizes.LARGE]: 500,\n};\n\nconst Illustration = forwardRef<HTMLImageElement, Props>(\n (\n {\n id,\n name,\n alt,\n loading = 'eager',\n className,\n size = Sizes.MEDIUM,\n disablePadding = false,\n }: Props,\n ref,\n ) => {\n const { SMALL, MEDIUM } = Sizes;\n\n return name ? (\n <picture>\n {size === Sizes.LARGE || size === Sizes.MEDIUM ? (\n <>\n <source\n width={imageSizes[SMALL]}\n height={imageSizes[SMALL]}\n media=\"(max-width: 575px)\"\n srcSet={`${defineSrc(name, SMALL, '1x')}, ${defineSrc(name, SMALL, '2x')} 2x`}\n />\n {size !== Sizes.MEDIUM ? (\n <source\n width={imageSizes[MEDIUM]}\n height={imageSizes[MEDIUM]}\n media=\"(max-width: 992px)\"\n srcSet={`${defineSrc(name, MEDIUM, '1x')}, ${defineSrc(name, MEDIUM, '2x')} 2x`}\n />\n ) : null}\n </>\n ) : null}\n\n <img\n id={id}\n ref={ref}\n alt={alt ?? name.replace('-', ' ')}\n data-testid={`wds-${name}-illustration`}\n className={classNames(\n 'wds-illustration',\n `wds-illustration-${name}`,\n { 'wds-illustration-padding': !disablePadding },\n className,\n )}\n loading={loading}\n src={defineSrc(name, size, '1x')}\n srcSet={`${defineSrc(name, size, '2x')} 2x`}\n width={imageSizes[size]}\n height={imageSizes[size]}\n />\n </picture>\n ) : null;\n },\n);\n\nfunction defineSrc(illustration: string, size: IllustrationSizes, descriptor: Descriptors) {\n return `https://wise.com/web-art/assets/illustrations/${illustration}-${size}@${descriptor}.webp`;\n}\n\nexport default Illustration;\n","/*\n *\n * DON'T MODIFY THIS FILE IT'S AUTO GENERATED\n * See: `scripts/generate-i10s-metadata.mjs`\n *\n */\n\nexport enum Assets {\n BELL = 'bell',\n BRIEFCASE = 'briefcase',\n BUSINESS_CARD = 'business-card',\n CALENDAR = 'calendar',\n CHECK_MARK = 'check-mark',\n CLOSED_WINDOW = 'closed-window',\n COIN_PILE_DOWN = 'coin-pile-down',\n COIN_PILE_UP = 'coin-pile-up',\n CONFETTI = 'confetti',\n CONSTRUCTION_FENCE = 'construction-fence',\n CONVERT = 'convert',\n COOKIE = 'cookie',\n DIGITAL_CARD_2 = 'digital-card-2',\n DIGITAL_CARD = 'digital-card',\n DOCUMENTS = 'documents',\n DOOR = 'door',\n ECO_CARD = 'eco-card',\n ELECTRIC_PLUG = 'electric-plug',\n EMAIL_SUCCESS = 'email-success',\n EMAIL = 'email',\n EXCLAMATION_MARK = 'exclamation-mark',\n FLAG = 'flag',\n FLOWER = 'flower',\n GEAR = 'gear',\n GLOBE = 'globe',\n GRAPH = 'graph',\n HEART_2 = 'heart-2',\n HEART_3 = 'heart-3',\n HEART_4 = 'heart-4',\n HEART_5 = 'heart-5',\n HEART = 'heart',\n HOUSE = 'house',\n ID_CARD = 'id-card',\n INFINITE = 'infinite',\n INVITE_LETTER = 'invite-letter',\n JARS = 'jars',\n KEY = 'key',\n LIGHT_BULB = 'light-bulb',\n LOCK = 'lock',\n MAGNIFYING_GLASS = 'magnifying-glass',\n MAP = 'map',\n MARBLE_CARD_BUSINESS = 'marble-card-business',\n MARBLE_CARD = 'marble-card',\n MARBLE = 'marble',\n MEGAPHONE = 'megaphone',\n MULTI_CURRENCY = 'multi-currency',\n ONE_INVITE_LETTER_OPENED = 'one-invite-letter-opened',\n PALM_TREE = 'palm-tree',\n PERCENTAGE = 'percentage',\n PERSONAL_CARD = 'personal-card',\n PHONES = 'phones',\n PIE_CHART = 'pie-chart',\n PLANE_2 = 'plane-2',\n PLANE = 'plane',\n PUZZLE_PIECES = 'puzzle-pieces',\n QUESTION_MARK = 'question-mark',\n RECEIVE = 'receive',\n REMINDER_LETTER = 'reminder-letter',\n SAND_TIMER = 'sand-timer',\n SHOPPING_BAG = 'shopping-bag',\n SKIP_AUTHENTICATION = 'skip-authentication',\n SPEECH_BUBBLE = 'speech-bubble',\n TOOL = 'tool',\n TWO_INVITE_LETTERS_OPENED = 'two-invite-letters-opened',\n WALLET = 'wallet',\n}\n\nexport type IllustrationNames =\n | 'bell'\n | 'briefcase'\n | 'business-card'\n | 'calendar'\n | 'check-mark'\n | 'closed-window'\n | 'coin-pile-down'\n | 'coin-pile-up'\n | 'confetti'\n | 'construction-fence'\n | 'convert'\n | 'cookie'\n | 'digital-card-2'\n | 'digital-card'\n | 'documents'\n | 'door'\n | 'eco-card'\n | 'electric-plug'\n | 'email-success'\n | 'email'\n | 'exclamation-mark'\n | 'flag'\n | 'flower'\n | 'gear'\n | 'globe'\n | 'graph'\n | 'heart-2'\n | 'heart-3'\n | 'heart-4'\n | 'heart-5'\n | 'heart'\n | 'house'\n | 'id-card'\n | 'infinite'\n | 'invite-letter'\n | 'jars'\n | 'key'\n | 'light-bulb'\n | 'lock'\n | 'magnifying-glass'\n | 'map'\n | 'marble-card-business'\n | 'marble-card'\n | 'marble'\n | 'megaphone'\n | 'multi-currency'\n | 'one-invite-letter-opened'\n | 'palm-tree'\n | 'percentage'\n | 'personal-card'\n | 'phones'\n | 'pie-chart'\n | 'plane-2'\n | 'plane'\n | 'puzzle-pieces'\n | 'question-mark'\n | 'receive'\n | 'reminder-letter'\n | 'sand-timer'\n | 'shopping-bag'\n | 'skip-authentication'\n | 'speech-bubble'\n | 'tool'\n | 'two-invite-letters-opened'\n | 'wallet';\n","import { useEffect, useState } from 'react';\n\nexport interface FlagProps {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2) or three-letter currency code (ISO 4217).\n */\n code: string;\n\n /**\n * Width and height to reserve for the underlying image, in pixels. A detailed variant is shown from 150px and above.\n */\n intrinsicSize?: number;\n}\n\nconst unknownFlagName = 'wise';\n\nexport const Flag = ({ code, intrinsicSize = 64 }: FlagProps) => {\n const [fallback, setFallback] = useState<'simple' | 'unknown' | null>(null);\n useEffect(() => {\n setFallback(null);\n }, [code]);\n\n const detailed = intrinsicSize >= 150;\n const name =\n fallback !== 'unknown'\n ? `${code.toLowerCase()}${fallback == null && detailed ? '-detailed' : ''}`\n : unknownFlagName;\n\n return (\n <img\n src={`https://wise.com/web-art/assets/flags/${name}.svg`}\n alt=\"\"\n width={intrinsicSize}\n height={intrinsicSize}\n onError={() => {\n setFallback((prev) => (prev == null && detailed ? 'simple' : 'unknown'));\n }}\n />\n );\n};\n"],"names":["Sizes","_imageSizes","Assets","imageSizes","SMALL","MEDIUM","LARGE","Illustration","forwardRef","ref","id","name","_ref","alt","loading","_ref$loading","className","size","_ref$size","disablePadding","_ref$disablePadding","React","createElement","Fragment","width","height","media","srcSet","defineSrc","replace","classNames","src","illustration","descriptor","code","intrinsicSize","_ref$intrinsicSize","_useState","useState","fallback","setFallback","useEffect","detailed","toLowerCase","onError","prev"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
package/dist/index.mjs ADDED
@@ -0,0 +1,5 @@
1
+ export { A as Assets, F as Flag, a as Illustration, b as Illustration3d, S as Sizes, i as is3dIllustrationSupported } from './index-3bf9c1e9.js';
2
+ import 'react';
3
+ import 'react/jsx-runtime';
4
+ import 'clsx';
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/art",
3
- "version": "2.5.0",
3
+ "version": "2.6.0-beta.2",
4
4
  "license": "MIT",
5
5
  "description": "React library for art elements in UI",
6
6
  "homepage": "https://github.com/transferwise/web-art#readme",
@@ -8,16 +8,26 @@
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/transferwise/web-art.git"
10
10
  },
11
- "source": "src/index.ts",
12
- "main": "dist/index.js",
13
- "module": "./dist/index.module.js",
14
- "unpkg": "./dist/index.umd.js",
15
- "types": "dist/index.d.ts",
11
+ "author": "Wise Payments Ltd.",
12
+ "sideEffects": false,
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.js"
18
+ },
19
+ "./dist/Illustration.css": "./dist/Illustration.css"
20
+ },
21
+ "main": "./dist/index.js",
22
+ "types": "./dist/index.d.ts",
16
23
  "files": [
17
- "dist"
24
+ "dist/",
25
+ "src/",
26
+ "!**/*.tsbuildinfo"
18
27
  ],
19
28
  "scripts": {
20
29
  "setup": "yarn && yarn build",
30
+ "load-3d-i10s": "node ./scripts/load-3d-i10s.mjs",
21
31
  "load-i10s": "copyfiles -u 3 node_modules/wise-atoms/illustrations/**/*.png temp",
22
32
  "load-flags": "yarn load-country-flags && yarn load-currency-flags && yarn transform-flags && yarn convert-flags-svg-to-png",
23
33
  "load-country-flags": "copyfiles -u 3 node_modules/wise-atoms/flags/*.svg s3-bucket/flags && node ./scripts/generate-country-flags.mjs",
@@ -26,44 +36,56 @@
26
36
  "convert-flags-svg-to-png": "node ./scripts/convert-flags-svg-to-png.mjs",
27
37
  "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",
28
38
  "generate-i10s-metadata": "node ./scripts/generate-i10s-metadata.mjs && eslint 'src/illustrations/metadata.ts' --fix",
29
- "bundle": "rm -rf dist && microbundle --jsxFragment React.Fragment --jsx React.createElement && cpx src/illustrations/Illustration.css dist/",
39
+ "bundle": "rm -rf dist && rollup --config --sourcemap && cpx src/illustrations/Illustration.css dist/",
30
40
  "cleanup": "rm -rf temp",
31
- "build": "yarn load-i10s && yarn convert-i10s-png-to-webp && yarn generate-i10s-metadata && yarn load-flags && yarn bundle && yarn cleanup",
41
+ "build": "yarn load-i10s && yarn load-3d-i10s && yarn convert-i10s-png-to-webp && yarn generate-i10s-metadata && yarn load-flags && yarn bundle && yarn cleanup",
32
42
  "start": "storybook dev -p 3001",
33
43
  "dev": "yarn start",
34
- "test": "release-to-github-with-changelog-pre-release-checks",
44
+ "test": "echo 'release-to-github-with-changelog-pre-release-checks'",
35
45
  "lint-fix": "eslint 'src/**/*.{js,ts,tsx}' 'scripts/*.{mjs,js,ts,tsx}' --fix",
36
- "build-docs": "storybook build -o docs",
37
- "deploy-docs": "deploy-to-github-pages -d docs -m main"
46
+ "build-docs": "storybook build -o docs && touch ./docs/.nojekyll"
47
+ },
48
+ "dependencies": {
49
+ "@babel/runtime": "^7.22.15",
50
+ "clsx": "^2.0.0",
51
+ "three": "^0.154.0",
52
+ "@react-three/fiber": "^8.13.5",
53
+ "@react-three/drei": "^9.78.2"
38
54
  },
39
55
  "devDependencies": {
40
- "@babel/preset-env": "^7.22.14",
41
- "@babel/preset-react": "^7.22.5",
42
- "@babel/preset-typescript": "^7.22.11",
56
+ "@babel/core": "^7.22.15",
57
+ "@babel/plugin-transform-runtime": "^7.22.15",
58
+ "@babel/preset-env": "^7.22.15",
59
+ "@babel/preset-react": "^7.22.15",
60
+ "@babel/preset-typescript": "^7.22.15",
61
+ "@rollup/plugin-babel": "^6.0.3",
62
+ "@rollup/plugin-typescript": "^11.1.3",
43
63
  "@storybook/addon-essentials": "^7.4.0",
44
64
  "@storybook/react": "^7.4.0",
45
65
  "@storybook/react-vite": "^7.4.0",
46
66
  "@transferwise/eslint-config": "^8.0.0",
67
+ "@tsconfig/recommended": "^1.0.2",
68
+ "@types/babel__core": "^7.20.1",
47
69
  "@types/glob": "^8.1.0",
48
70
  "@types/imagemin": "^8.0.1",
49
71
  "@types/imagemin-webp": "^7.0.0",
50
- "@types/jest": "^28.1.6",
72
+ "@types/jest": "^28.1.8",
51
73
  "@types/jsdom": "^21.1.2",
52
74
  "@types/react": "^18.2.21",
53
75
  "@types/react-dom": "^18.2.7",
54
- "classnames": "^2.3.2",
76
+ "@types/three": "^0.154.0",
77
+ "babel-plugin-optimize-clsx": "^2.6.2",
55
78
  "copyfiles": "^2.4.1",
56
79
  "cpx": "^1.5.0",
57
- "deploy-to-github-pages": "^1.0.1",
58
80
  "eslint": "^8.48.0",
59
- "glob": "^8.0.3",
81
+ "glob": "^8.1.0",
60
82
  "imagemin": "^8.0.1",
61
83
  "imagemin-webp": "^7.0.0",
84
+ "gltf-pipeline": "^4.1.0",
62
85
  "jest": "^28.1.3",
63
86
  "jest-environment-jsdom": "^28.1.3",
64
- "jsdom": "~21.1.1",
65
- "microbundle": "^0.15.1",
66
- "prettier": "^2.7.1",
87
+ "jsdom": "~21.1.2",
88
+ "prettier": "^2.8.8",
67
89
  "react": "^18.2.0",
68
90
  "react-dom": "^18.2.0",
69
91
  "release-to-github-with-changelog": "^1.2.4",
@@ -72,15 +94,17 @@
72
94
  "ts-node": "10.9.1",
73
95
  "typescript": "^4.9.5",
74
96
  "vite": "^4.4.9",
75
- "wise-atoms": "git+ssh://git@github.com:transferwise/wise-atoms.git#bb7a63aa66453af9c77e754586381ac5b996a176"
97
+ "wise-atoms": "git+ssh://git@github.com:transferwise/wise-atoms.git#c2683d557cf6f7b4f6226ea8f0e67bc797e7fb2e"
76
98
  },
77
99
  "peerDependencies": {
78
- "classnames": "^2.3",
79
100
  "react": ">=17",
80
101
  "react-dom": ">=17"
81
102
  },
82
103
  "prettier": "@transferwise/eslint-config/.prettierrc.js",
83
104
  "publishConfig": {
84
105
  "access": "public"
106
+ },
107
+ "resolutions": {
108
+ "jackspeak": "2.1.1"
85
109
  }
86
110
  }
package/src/common.ts ADDED
@@ -0,0 +1,17 @@
1
+ export enum Sizes {
2
+ SMALL = 'small',
3
+ MEDIUM = 'medium',
4
+ LARGE = 'large',
5
+ }
6
+
7
+ export const ImageSizes = {
8
+ [Sizes.SMALL]: 200,
9
+ [Sizes.MEDIUM]: 300,
10
+ [Sizes.LARGE]: 500,
11
+ };
12
+
13
+ export type LargeSize = 'large';
14
+ export type MediumSize = 'medium';
15
+ export type SmallSize = 'small';
16
+
17
+ export type Descriptors = '1x' | '1.5x' | '2x' | '3x' | '4x';
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+
3
+ import { Flag } from './Flag';
4
+
5
+ const meta: Meta<typeof Flag> = {
6
+ component: Flag,
7
+ title: 'Flag',
8
+ };
9
+ export default meta;
10
+
11
+ type Story = StoryObj<typeof Flag>;
12
+
13
+ export const Basic: Story = {
14
+ render: (args) => <Flag {...args} />,
15
+ args: {
16
+ code: 'GBP',
17
+ intrinsicSize: 64,
18
+ },
19
+ };
@@ -0,0 +1,40 @@
1
+ import { useEffect, useState } from 'react';
2
+
3
+ export interface FlagProps {
4
+ /**
5
+ * Two-letter country code (ISO 3166-1 alpha-2) or three-letter currency code (ISO 4217).
6
+ */
7
+ code: string;
8
+
9
+ /**
10
+ * Width and height to reserve for the underlying image, in pixels. A detailed variant is shown from 150px and above.
11
+ */
12
+ intrinsicSize?: number;
13
+ }
14
+
15
+ const unknownFlagName = 'wise';
16
+
17
+ export const Flag = ({ code, intrinsicSize = 64 }: FlagProps) => {
18
+ const [fallback, setFallback] = useState<'simple' | 'unknown' | null>(null);
19
+ useEffect(() => {
20
+ setFallback(null);
21
+ }, [code]);
22
+
23
+ const detailed = intrinsicSize >= 150;
24
+ const name =
25
+ fallback !== 'unknown'
26
+ ? `${code.toLowerCase()}${fallback == null && detailed ? '-detailed' : ''}`
27
+ : unknownFlagName;
28
+
29
+ return (
30
+ <img
31
+ src={`https://wise.com/web-art/assets/flags/${name}.svg`}
32
+ alt=""
33
+ width={intrinsicSize}
34
+ height={intrinsicSize}
35
+ onError={() => {
36
+ setFallback((prev) => (prev == null && detailed ? 'simple' : 'unknown'));
37
+ }}
38
+ />
39
+ );
40
+ };
@@ -0,0 +1,2 @@
1
+ export { Flag } from './Flag';
2
+ export type { FlagProps } from './Flag';
@@ -0,0 +1,27 @@
1
+ /* Prevent image overflow viewport or container element */
2
+ img.wds-illustration {
3
+ max-width: 100%;
4
+ }
5
+
6
+ .wds-illustration-padding {
7
+ padding: 24px;
8
+ }
9
+
10
+ .wds-illustration-3d {
11
+ display: inline-flex;
12
+ }
13
+
14
+ .wds-illustration-3d-small {
15
+ width: 200px;
16
+ height: 200px;
17
+ }
18
+
19
+ .wds-illustration-3d-medium {
20
+ width: 300px;
21
+ height: 300px;
22
+ }
23
+
24
+ .wds-illustration-3d-large {
25
+ width: 500px;
26
+ height: 500px;
27
+ }
@@ -0,0 +1,33 @@
1
+ /* eslint-disable react/forbid-dom-props */
2
+ import React from 'react';
3
+
4
+ import Illustration, { Props as IllustrationProps } from './Illustration';
5
+ import { Assets, IllustrationNames } from './metadata';
6
+
7
+ export default {
8
+ component: Illustration,
9
+ title: 'Illustration',
10
+ };
11
+
12
+ export const All = () => {
13
+ const assetNames = Object.values(Assets);
14
+ return (
15
+ <>
16
+ <div>Total number of illustrations: {assetNames.length}</div>
17
+ {Object.values(Assets).map((assetName) => (
18
+ <p key={assetName}>
19
+ Asset: <code>{assetName}</code>
20
+ <Illustration alt={assetName} key={assetName} name={assetName as IllustrationNames} />
21
+ </p>
22
+ ))}
23
+ </>
24
+ );
25
+ };
26
+
27
+ export const Individual = ({ name = Assets.CHECK_MARK, ...props }: IllustrationProps) => {
28
+ return (
29
+ <>
30
+ <Illustration name={name} {...props} />
31
+ </>
32
+ );
33
+ };
@@ -0,0 +1,95 @@
1
+ import { clsx } from 'clsx';
2
+ import { forwardRef } from 'react';
3
+
4
+ import {
5
+ type LargeSize,
6
+ type MediumSize,
7
+ type SmallSize,
8
+ type Descriptors,
9
+ Sizes,
10
+ } from './../common';
11
+ import type { IllustrationNames } from './metadata';
12
+
13
+ // Picking only a few props from Image element to avoid breaking change
14
+ // as in future underlying element might change
15
+ type ImgProps = Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'id' | 'className'>;
16
+
17
+ export type IllustrationSizes = LargeSize | MediumSize | SmallSize;
18
+
19
+ export type Props = {
20
+ name: IllustrationNames;
21
+ alt: string;
22
+ size?: IllustrationSizes;
23
+ loading?: 'eager' | 'lazy';
24
+ disablePadding?: boolean;
25
+ } & ImgProps;
26
+
27
+ const imageSizes = {
28
+ [Sizes.SMALL]: 200,
29
+ [Sizes.MEDIUM]: 300,
30
+ [Sizes.LARGE]: 500,
31
+ };
32
+
33
+ const Illustration = forwardRef<HTMLImageElement, Props>(
34
+ (
35
+ {
36
+ id,
37
+ name,
38
+ alt,
39
+ loading = 'eager',
40
+ className,
41
+ size = Sizes.MEDIUM,
42
+ disablePadding = false,
43
+ }: Props,
44
+ ref,
45
+ ) => {
46
+ const { SMALL, MEDIUM } = Sizes;
47
+
48
+ return name ? (
49
+ <picture>
50
+ {size === Sizes.LARGE || size === Sizes.MEDIUM ? (
51
+ <>
52
+ <source
53
+ width={imageSizes[SMALL]}
54
+ height={imageSizes[SMALL]}
55
+ media="(max-width: 575px)"
56
+ srcSet={`${defineSrc(name, SMALL, '1x')}, ${defineSrc(name, SMALL, '2x')} 2x`}
57
+ />
58
+ {size !== Sizes.MEDIUM ? (
59
+ <source
60
+ width={imageSizes[MEDIUM]}
61
+ height={imageSizes[MEDIUM]}
62
+ media="(max-width: 992px)"
63
+ srcSet={`${defineSrc(name, MEDIUM, '1x')}, ${defineSrc(name, MEDIUM, '2x')} 2x`}
64
+ />
65
+ ) : null}
66
+ </>
67
+ ) : null}
68
+
69
+ <img
70
+ id={id}
71
+ ref={ref}
72
+ alt={alt ?? name.replace('-', ' ')}
73
+ data-testid={`wds-${name}-illustration`}
74
+ className={clsx(
75
+ 'wds-illustration',
76
+ `wds-illustration-${name}`,
77
+ { 'wds-illustration-padding': !disablePadding },
78
+ className,
79
+ )}
80
+ loading={loading}
81
+ src={defineSrc(name, size, '1x')}
82
+ srcSet={`${defineSrc(name, size, '2x')} 2x`}
83
+ width={imageSizes[size]}
84
+ height={imageSizes[size]}
85
+ />
86
+ </picture>
87
+ ) : null;
88
+ },
89
+ );
90
+
91
+ function defineSrc(illustration: string, size: IllustrationSizes, descriptor: Descriptors) {
92
+ return `https://wise.com/web-art/assets/illustrations/${illustration}-${size}@${descriptor}.webp`;
93
+ }
94
+
95
+ export default Illustration;
@@ -0,0 +1,5 @@
1
+ export { default } from './Illustration';
2
+ export type { Props as IllustrationProps } from './Illustration';
3
+
4
+ export { Assets } from './metadata';
5
+ export type { IllustrationNames } from './metadata';
@@ -0,0 +1,141 @@
1
+ /*
2
+ *
3
+ * DON'T MODIFY THIS FILE IT'S AUTO GENERATED
4
+ * See: `scripts/generate-i10s-metadata.mjs`
5
+ *
6
+ */
7
+
8
+ export enum Assets {
9
+ BELL = 'bell',
10
+ BRIEFCASE = 'briefcase',
11
+ BUSINESS_CARD = 'business-card',
12
+ CALENDAR = 'calendar',
13
+ CHECK_MARK = 'check-mark',
14
+ CLOSED_WINDOW = 'closed-window',
15
+ COIN_PILE_DOWN = 'coin-pile-down',
16
+ COIN_PILE_UP = 'coin-pile-up',
17
+ CONFETTI = 'confetti',
18
+ CONSTRUCTION_FENCE = 'construction-fence',
19
+ CONVERT = 'convert',
20
+ COOKIE = 'cookie',
21
+ DIGITAL_CARD_2 = 'digital-card-2',
22
+ DIGITAL_CARD = 'digital-card',
23
+ DOCUMENTS = 'documents',
24
+ DOOR = 'door',
25
+ ECO_CARD = 'eco-card',
26
+ ELECTRIC_PLUG = 'electric-plug',
27
+ EMAIL_SUCCESS = 'email-success',
28
+ EMAIL = 'email',
29
+ EXCLAMATION_MARK = 'exclamation-mark',
30
+ FLAG = 'flag',
31
+ FLOWER = 'flower',
32
+ GEAR = 'gear',
33
+ GLOBE = 'globe',
34
+ GRAPH = 'graph',
35
+ HEART_2 = 'heart-2',
36
+ HEART_3 = 'heart-3',
37
+ HEART_4 = 'heart-4',
38
+ HEART_5 = 'heart-5',
39
+ HEART = 'heart',
40
+ HOUSE = 'house',
41
+ ID_CARD = 'id-card',
42
+ INFINITE = 'infinite',
43
+ INVITE_LETTER = 'invite-letter',
44
+ JARS = 'jars',
45
+ KEY = 'key',
46
+ LIGHT_BULB = 'light-bulb',
47
+ LOCK = 'lock',
48
+ MAGNIFYING_GLASS = 'magnifying-glass',
49
+ MAP = 'map',
50
+ MARBLE_CARD_BUSINESS = 'marble-card-business',
51
+ MARBLE_CARD = 'marble-card',
52
+ MARBLE = 'marble',
53
+ MEGAPHONE = 'megaphone',
54
+ MULTI_CURRENCY = 'multi-currency',
55
+ ONE_INVITE_LETTER_OPENED = 'one-invite-letter-opened',
56
+ PALM_TREE = 'palm-tree',
57
+ PERCENTAGE = 'percentage',
58
+ PERSONAL_CARD = 'personal-card',
59
+ PHONES = 'phones',
60
+ PIE_CHART = 'pie-chart',
61
+ PLANE_2 = 'plane-2',
62
+ PLANE = 'plane',
63
+ PUZZLE_PIECES = 'puzzle-pieces',
64
+ QUESTION_MARK = 'question-mark',
65
+ RECEIVE = 'receive',
66
+ REMINDER_LETTER = 'reminder-letter',
67
+ SAND_TIMER = 'sand-timer',
68
+ SHOPPING_BAG = 'shopping-bag',
69
+ SKIP_AUTHENTICATION = 'skip-authentication',
70
+ SPEECH_BUBBLE = 'speech-bubble',
71
+ TOOL = 'tool',
72
+ TWO_INVITE_LETTERS_OPENED = 'two-invite-letters-opened',
73
+ WALLET = 'wallet',
74
+ }
75
+
76
+ export type IllustrationNames =
77
+ | 'bell'
78
+ | 'briefcase'
79
+ | 'business-card'
80
+ | 'calendar'
81
+ | 'check-mark'
82
+ | 'closed-window'
83
+ | 'coin-pile-down'
84
+ | 'coin-pile-up'
85
+ | 'confetti'
86
+ | 'construction-fence'
87
+ | 'convert'
88
+ | 'cookie'
89
+ | 'digital-card-2'
90
+ | 'digital-card'
91
+ | 'documents'
92
+ | 'door'
93
+ | 'eco-card'
94
+ | 'electric-plug'
95
+ | 'email-success'
96
+ | 'email'
97
+ | 'exclamation-mark'
98
+ | 'flag'
99
+ | 'flower'
100
+ | 'gear'
101
+ | 'globe'
102
+ | 'graph'
103
+ | 'heart-2'
104
+ | 'heart-3'
105
+ | 'heart-4'
106
+ | 'heart-5'
107
+ | 'heart'
108
+ | 'house'
109
+ | 'id-card'
110
+ | 'infinite'
111
+ | 'invite-letter'
112
+ | 'jars'
113
+ | 'key'
114
+ | 'light-bulb'
115
+ | 'lock'
116
+ | 'magnifying-glass'
117
+ | 'map'
118
+ | 'marble-card-business'
119
+ | 'marble-card'
120
+ | 'marble'
121
+ | 'megaphone'
122
+ | 'multi-currency'
123
+ | 'one-invite-letter-opened'
124
+ | 'palm-tree'
125
+ | 'percentage'
126
+ | 'personal-card'
127
+ | 'phones'
128
+ | 'pie-chart'
129
+ | 'plane-2'
130
+ | 'plane'
131
+ | 'puzzle-pieces'
132
+ | 'question-mark'
133
+ | 'receive'
134
+ | 'reminder-letter'
135
+ | 'sand-timer'
136
+ | 'shopping-bag'
137
+ | 'skip-authentication'
138
+ | 'speech-bubble'
139
+ | 'tool'
140
+ | 'two-invite-letters-opened'
141
+ | 'wallet';