@transferwise/components 0.0.0-experimental-7b7608c → 0.0.0-experimental-c76c3bc

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 (87) hide show
  1. package/build/avatar/Avatar.js +5 -0
  2. package/build/avatar/Avatar.js.map +1 -1
  3. package/build/avatar/Avatar.mjs +5 -0
  4. package/build/avatar/Avatar.mjs.map +1 -1
  5. package/build/circularButton/CircularButton.js +1 -1
  6. package/build/circularButton/CircularButton.js.map +1 -1
  7. package/build/circularButton/CircularButton.mjs +1 -1
  8. package/build/circularButton/CircularButton.mjs.map +1 -1
  9. package/build/common/circle/Circle.js +15 -2
  10. package/build/common/circle/Circle.js.map +1 -1
  11. package/build/common/circle/Circle.mjs +15 -2
  12. package/build/common/circle/Circle.mjs.map +1 -1
  13. package/build/i18n/en.json +0 -2
  14. package/build/i18n/en.json.js +0 -2
  15. package/build/i18n/en.json.js.map +1 -1
  16. package/build/i18n/en.json.mjs +0 -2
  17. package/build/i18n/en.json.mjs.map +1 -1
  18. package/build/main.css +6 -237
  19. package/build/statusIcon/StatusIcon.js +4 -4
  20. package/build/statusIcon/StatusIcon.js.map +1 -1
  21. package/build/statusIcon/StatusIcon.mjs +4 -4
  22. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  23. package/build/styles/circularButton/CircularButton.css +2 -2
  24. package/build/styles/common/circle/Circle.css +4 -0
  25. package/build/styles/main.css +6 -237
  26. package/build/styles/statusIcon/StatusIcon.css +0 -20
  27. package/build/types/avatar/Avatar.d.ts.map +1 -1
  28. package/build/types/common/circle/Circle.d.ts +1 -1
  29. package/build/types/common/circle/Circle.d.ts.map +1 -1
  30. package/build/types/statusIcon/StatusIcon.d.ts +6 -2
  31. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  32. package/package.json +3 -3
  33. package/src/avatar/Avatar.spec.tsx +3 -1
  34. package/src/avatar/Avatar.tsx +5 -2
  35. package/src/avatarWrapper/__snapshots__/AvatarWrapper.spec.tsx.snap +11 -11
  36. package/src/badge/Badge.spec.tsx +3 -1
  37. package/src/circularButton/CircularButton.css +2 -2
  38. package/src/circularButton/CircularButton.less +1 -1
  39. package/src/circularButton/CircularButton.tsx +1 -1
  40. package/src/circularButton/__snapshots__/CircularButton.spec.tsx.snap +10 -10
  41. package/src/common/circle/Circle.css +4 -0
  42. package/src/common/circle/Circle.less +6 -0
  43. package/src/common/circle/Circle.tsx +25 -2
  44. package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +4 -4
  45. package/src/i18n/en.json +0 -2
  46. package/src/main.css +6 -237
  47. package/src/main.less +0 -1
  48. package/src/overlayHeader/OverlayHeader.spec.tsx +3 -1
  49. package/src/overlayHeader/__snapshots__/OverlayHeader.spec.tsx.snap +2 -2
  50. package/src/promoCard/PromoCard.spec.tsx +3 -1
  51. package/src/radio/Radio.rtl.spec.tsx +2 -1
  52. package/src/radio/__snapshots__/Radio.rtl.spec.tsx.snap +2 -2
  53. package/src/statusIcon/StatusIcon.css +0 -20
  54. package/src/statusIcon/StatusIcon.less +0 -17
  55. package/src/statusIcon/StatusIcon.spec.tsx +3 -21
  56. package/src/statusIcon/StatusIcon.story.tsx +31 -8
  57. package/src/statusIcon/StatusIcon.tsx +12 -6
  58. package/build/styles/table/Table.css +0 -215
  59. package/build/types/table/Table.d.ts +0 -23
  60. package/build/types/table/Table.d.ts.map +0 -1
  61. package/build/types/table/Table.messages.d.ts +0 -12
  62. package/build/types/table/Table.messages.d.ts.map +0 -1
  63. package/build/types/table/TableCell.d.ts +0 -37
  64. package/build/types/table/TableCell.d.ts.map +0 -1
  65. package/build/types/table/TableHeader.d.ts +0 -12
  66. package/build/types/table/TableHeader.d.ts.map +0 -1
  67. package/build/types/table/TableRow.d.ts +0 -17
  68. package/build/types/table/TableRow.d.ts.map +0 -1
  69. package/build/types/table/TableStatusText.d.ts +0 -9
  70. package/build/types/table/TableStatusText.d.ts.map +0 -1
  71. package/build/types/table/index.d.ts +0 -6
  72. package/build/types/table/index.d.ts.map +0 -1
  73. package/src/table/Table.css +0 -215
  74. package/src/table/Table.less +0 -261
  75. package/src/table/Table.messages.ts +0 -12
  76. package/src/table/Table.spec.tsx +0 -87
  77. package/src/table/Table.story.tsx +0 -352
  78. package/src/table/Table.tsx +0 -121
  79. package/src/table/TableCell.spec.tsx +0 -298
  80. package/src/table/TableCell.tsx +0 -153
  81. package/src/table/TableHeader.spec.tsx +0 -58
  82. package/src/table/TableHeader.tsx +0 -50
  83. package/src/table/TableRow.spec.tsx +0 -104
  84. package/src/table/TableRow.tsx +0 -62
  85. package/src/table/TableStatusText.spec.tsx +0 -53
  86. package/src/table/TableStatusText.tsx +0 -35
  87. package/src/table/index.ts +0 -11
@@ -23,17 +23,17 @@ const mapLegacySize = {
23
23
  };
24
24
  const StatusIcon = ({
25
25
  sentiment = 'neutral',
26
- size: sizeProp = 'md'
26
+ size: sizeProp = 40
27
27
  }) => {
28
28
  const Icon = iconTypeMap[sentiment];
29
29
  const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';
30
30
  const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
31
- const size = sizeProp === Size.SMALL && isTinyViewport ? 32 : mapLegacySize[sizeProp];
31
+ const size = typeof sizeProp === 'string' ? mapLegacySize[sizeProp] : sizeProp;
32
32
  return /*#__PURE__*/jsx(Circle, {
33
33
  as: "span",
34
- size: size,
34
+ size: isTinyViewport && size < 40 ? 32 : size,
35
35
  "data-testid": "status-icon",
36
- className: clsx('status-circle', `status-circle-${sizeProp}`, sentiment),
36
+ className: clsx('status-circle', sentiment),
37
37
  children: /*#__PURE__*/jsx(Icon, {
38
38
  className: clsx('status-icon', iconColor)
39
39
  })
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nexport type StatusIconProps = {\n sentiment: `${Sentiment}`;\n size: SizeSmall | SizeMedium | SizeLarge;\n};\n\nconst iconTypeMap = {\n positive: Check,\n neutral: Info,\n warning: Alert,\n negative: Cross,\n pending: ClockBorderless,\n info: Info,\n error: Cross,\n success: Check,\n} satisfies Record<`${Sentiment}`, React.ElementType>;\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 'md' }: StatusIconProps) => {\n const Icon = iconTypeMap[sentiment];\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = sizeProp === Size.SMALL && isTinyViewport ? 32 : mapLegacySize[sizeProp];\n return (\n <Circle\n as=\"span\"\n size={size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', `status-circle-${sizeProp}`, sentiment)}\n >\n <Icon className={clsx('status-icon', iconColor)} />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["iconTypeMap","positive","Check","neutral","Info","warning","Alert","negative","Cross","pending","ClockBorderless","info","error","success","mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","Icon","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children"],"mappings":";;;;;;;;AAYA,MAAMA,WAAW,GAAG;AAClBC,EAAAA,QAAQ,EAAEC,KAAK;AACfC,EAAAA,OAAO,EAAEC,IAAI;AACbC,EAAAA,OAAO,EAAEC,KAAK;AACdC,EAAAA,QAAQ,EAAEC,KAAK;AACfC,EAAAA,OAAO,EAAEC,eAAe;AACxBC,EAAAA,IAAI,EAAEP,IAAI;AACVQ,EAAAA,KAAK,EAAEJ,KAAK;AACZK,EAAAA,OAAO,EAAEX,KAAAA;CAC0C,CAAA;AAErD,MAAMY,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,EAAAA,SAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,IAAA;AAAI,CAAmB,KAAI;AACvF,EAAA,MAAMC,IAAI,GAAGxB,WAAW,CAACqB,SAAS,CAAC,CAAA;AACnC,EAAA,MAAMI,SAAS,GAAGJ,SAAS,KAAK,SAAS,IAAIA,SAAS,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;EACvF,MAAMK,cAAc,GAAGC,QAAQ,CAAC,eAAeC,UAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;AACxE,EAAA,MAAMP,IAAI,GAAGC,QAAQ,KAAKP,IAAI,CAACC,KAAK,IAAIS,cAAc,GAAG,EAAE,GAAGZ,aAAa,CAACS,QAAQ,CAAC,CAAA;EACrF,oBACEO,GAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,MAAM;AACTV,IAAAA,IAAI,EAAEA,IAAK;AACX,IAAA,aAAA,EAAY,aAAa;IACzBW,SAAS,EAAEC,IAAI,CAAC,eAAe,EAAE,iBAAiBX,QAAQ,CAAA,CAAE,EAAEF,SAAS,CAAE;IAAAc,QAAA,eAEzEL,GAAA,CAACN,IAAI,EAAA;AAACS,MAAAA,SAAS,EAAEC,IAAI,CAAC,aAAa,EAAET,SAAS,CAAA;KAChD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
1
+ {"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n};\n\nconst iconTypeMap = {\n positive: Check,\n neutral: Info,\n warning: Alert,\n negative: Cross,\n pending: ClockBorderless,\n info: Info,\n error: Cross,\n success: Check,\n} satisfies Record<`${Sentiment}`, React.ElementType>;\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40 }: StatusIconProps) => {\n const Icon = iconTypeMap[sentiment];\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size: CircleProps['size'] =\n typeof sizeProp === 'string' ? mapLegacySize[sizeProp] : sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon className={clsx('status-icon', iconColor)} />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["iconTypeMap","positive","Check","neutral","Info","warning","Alert","negative","Cross","pending","ClockBorderless","info","error","success","mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","Icon","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children"],"mappings":";;;;;;;;AAiBA,MAAMA,WAAW,GAAG;AAClBC,EAAAA,QAAQ,EAAEC,KAAK;AACfC,EAAAA,OAAO,EAAEC,IAAI;AACbC,EAAAA,OAAO,EAAEC,KAAK;AACdC,EAAAA,QAAQ,EAAEC,KAAK;AACfC,EAAAA,OAAO,EAAEC,eAAe;AACxBC,EAAAA,IAAI,EAAEP,IAAI;AACVQ,EAAAA,KAAK,EAAEJ,KAAK;AACZK,EAAAA,OAAO,EAAEX,KAAAA;CAC0C,CAAA;AAErD,MAAMY,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,EAAAA,SAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAA;AAAE,CAAmB,KAAI;AACrF,EAAA,MAAMC,IAAI,GAAGxB,WAAW,CAACqB,SAAS,CAAC,CAAA;AACnC,EAAA,MAAMI,SAAS,GAAGJ,SAAS,KAAK,SAAS,IAAIA,SAAS,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;EACvF,MAAMK,cAAc,GAAGC,QAAQ,CAAC,eAAeC,UAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;AACxE,EAAA,MAAMP,IAAI,GACR,OAAOC,QAAQ,KAAK,QAAQ,GAAGT,aAAa,CAACS,QAAQ,CAAC,GAAGA,QAAQ,CAAA;EACnE,oBACEO,GAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,MAAM;IACTV,IAAI,EAAEI,cAAc,IAAIJ,IAAI,GAAG,EAAE,GAAG,EAAE,GAAGA,IAAK;AAC9C,IAAA,aAAA,EAAY,aAAa;AACzBW,IAAAA,SAAS,EAAEC,IAAI,CAAC,eAAe,EAAEb,SAAS,CAAE;IAAAc,QAAA,eAE5CL,GAAA,CAACN,IAAI,EAAA;AAACS,MAAAA,SAAS,EAAEC,IAAI,CAAC,aAAa,EAAET,SAAS,CAAA;KAChD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
@@ -23,8 +23,8 @@
23
23
  }
24
24
  @media (max-width: 320px) {
25
25
  .np-circular-btn .tw-icon {
26
- top: 8px;
27
- top: var(--size-8);
26
+ top: 12px;
27
+ top: var(--size-12);
28
28
  }
29
29
  }
30
30
  .np-circular-btn .tw-icon > svg {
@@ -5,3 +5,7 @@
5
5
  height: var(--circle-size);
6
6
  flex-shrink: 0;
7
7
  }
8
+ .np-circle .tw-icon > svg {
9
+ height: var(--circle-icon-size);
10
+ width: var(--circle-icon-size);
11
+ }
@@ -1013,8 +1013,8 @@ div.critical-comms .critical-comms-body {
1013
1013
  }
1014
1014
  @media (max-width: 320px) {
1015
1015
  .np-circular-btn .tw-icon {
1016
- top: 8px;
1017
- top: var(--size-8);
1016
+ top: 12px;
1017
+ top: var(--size-12);
1018
1018
  }
1019
1019
  }
1020
1020
  .np-circular-btn .tw-icon > svg {
@@ -1169,6 +1169,10 @@ div.critical-comms .critical-comms-body {
1169
1169
  height: var(--circle-size);
1170
1170
  flex-shrink: 0;
1171
1171
  }
1172
+ .np-circle .tw-icon > svg {
1173
+ height: var(--circle-icon-size);
1174
+ width: var(--circle-icon-size);
1175
+ }
1172
1176
  .np-bottom-sheet {
1173
1177
  border-radius: 10px 10px 0 0;
1174
1178
  }
@@ -4155,12 +4159,6 @@ html:not([dir="rtl"]) .np-navigation-option {
4155
4159
  transform: translateY(-24px);
4156
4160
  }
4157
4161
  }
4158
- .status-icon > svg {
4159
- height: 32px;
4160
- height: var(--size-32);
4161
- width: 32px;
4162
- width: var(--size-32);
4163
- }
4164
4162
  .status-circle .light {
4165
4163
  color: var(--color-contrast);
4166
4164
  }
@@ -4176,20 +4174,6 @@ html:not([dir="rtl"]) .np-navigation-option {
4176
4174
  .np-theme-personal .status-circle.pending .status-icon {
4177
4175
  color: var(--color-dark);
4178
4176
  }
4179
- .status-circle-sm .status-icon > svg {
4180
- height: 14px;
4181
- height: var(--size-14);
4182
- width: 14px;
4183
- width: var(--size-14);
4184
- }
4185
- @media (max-width: 320px) {
4186
- .status-circle-sm .status-icon > svg {
4187
- width: 24px;
4188
- width: var(--size-24);
4189
- height: 24px;
4190
- height: var(--size-24);
4191
- }
4192
- }
4193
4177
  .status-circle.negative,
4194
4178
  .status-circle.error {
4195
4179
  background-color: var(--color-sentiment-negative);
@@ -5025,221 +5009,6 @@ html:not([dir="rtl"]) .np-navigation-option {
5025
5009
  padding: 0 var(--size-24);
5026
5010
  }
5027
5011
  }
5028
- .np-table {
5029
- width: 100%;
5030
- background-color: transparent;
5031
- }
5032
- .np-table-container {
5033
- padding: 8px;
5034
- padding: var(--size-8);
5035
- background-color: rgba(134,167,189,0.10196);
5036
- background-color: var(--color-background-neutral);
5037
- border-radius: 16px;
5038
- border-radius: var(--radius-medium);
5039
- }
5040
- .np-table-container--loading .np-table-header {
5041
- min-width: calc(160px * 2);
5042
- }
5043
- .np-table-container--center {
5044
- margin-right: auto;
5045
- margin-left: auto;
5046
- }
5047
- .np-table-container--full-width {
5048
- width: 100%;
5049
- }
5050
- .np-table-inner-container {
5051
- background-image: linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)), linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)), linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0)), linear-gradient(to left, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0));
5052
- background-position: left center, right center, left center, right center;
5053
- background-repeat: no-repeat;
5054
- background-color: var(--color-contrast-overlay);
5055
- background-size: 15px 100%, 15px 100%, 15px 100%, 15px 100%;
5056
- background-attachment: local, local, scroll, scroll;
5057
- overflow-x: auto;
5058
- border-radius: 10px;
5059
- }
5060
- .np-theme-personal--dark .np-table-inner-container {
5061
- background-image: linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)), linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)), linear-gradient(to right, #000000, rgba(0, 0, 0, 0)), linear-gradient(to left, #000000, rgba(0, 0, 0, 0));
5062
- }
5063
- .np-table-row:last-child .np-table-cell:first-child {
5064
- border-bottom-left-radius: 10px;
5065
- }
5066
- .np-table-row:last-child .np-table-cell:last-child {
5067
- border-bottom-right-radius: 10px;
5068
- }
5069
- .np-table-row--clickable:hover .np-table-cell {
5070
- background-color: var(--color-background-screen-hover);
5071
- cursor: pointer;
5072
- }
5073
- .np-table-row--separator .np-table-cell {
5074
- padding: 0;
5075
- }
5076
- .np-table-header,
5077
- .np-table-cell {
5078
- padding: 0;
5079
- }
5080
- .np-table-header:first-child,
5081
- .np-table-cell:first-child {
5082
- padding-left: 16px;
5083
- padding-left: var(--size-16);
5084
- }
5085
- .np-table-header:first-child .np-table-header-content,
5086
- .np-table-cell:first-child .np-table-header-content,
5087
- .np-table-header:first-child .np-table-cell-content,
5088
- .np-table-cell:first-child .np-table-cell-content {
5089
- padding-left: 0;
5090
- }
5091
- .np-table-header:last-child,
5092
- .np-table-cell:last-child {
5093
- padding-right: 16px;
5094
- padding-right: var(--size-16);
5095
- }
5096
- .np-table-header:last-child .np-table-header-content,
5097
- .np-table-cell:last-child .np-table-header-content,
5098
- .np-table-header:last-child .np-table-cell-content,
5099
- .np-table-cell:last-child .np-table-cell-content {
5100
- padding-right: 0;
5101
- }
5102
- .np-table-header .np-text-body-large-bold,
5103
- .np-table-cell .np-text-body-large-bold {
5104
- font-size: 0.875rem;
5105
- font-size: var(--font-size-14);
5106
- }
5107
- .np-table-header.np-table-header--right,
5108
- .np-table-cell.np-table-cell--right {
5109
- padding-right: calc(8px + 12px);
5110
- padding-right: calc(var(--size-8) + var(--size-12));
5111
- }
5112
- .np-table-header.np-table-header--right > .np-text-body-default,
5113
- .np-table-cell.np-table-cell--right > .np-text-body-default {
5114
- text-align: right;
5115
- }
5116
- .np-table-header.np-table-header--right .np-table-header-content,
5117
- .np-table-cell.np-table-cell--right .np-table-content {
5118
- justify-content: end;
5119
- }
5120
- .np-table-header-content,
5121
- .np-table-content {
5122
- display: flex;
5123
- align-items: center;
5124
- justify-content: start;
5125
- }
5126
- .np-table-header {
5127
- min-width: 160px;
5128
- padding-right: 8px;
5129
- padding-right: var(--size-8);
5130
- padding-bottom: 8px;
5131
- padding-bottom: var(--size-8);
5132
- padding-left: 8px;
5133
- padding-left: var(--size-8);
5134
- background-color: rgba(134,167,189,0.10196);
5135
- background-color: var(--color-background-neutral);
5136
- color: #37517e;
5137
- color: var(--color-content-primary);
5138
- }
5139
- .np-table-header-content {
5140
- padding-top: 5px;
5141
- padding-bottom: 5px;
5142
- white-space: nowrap;
5143
- }
5144
- .np-table-header--has-error {
5145
- color: var(--color-sentiment-negative);
5146
- }
5147
- .np-table-cell {
5148
- padding: 16px 8px;
5149
- padding: var(--size-16) var(--size-8);
5150
- }
5151
- .np-table-cell--primary {
5152
- min-width: 200px;
5153
- }
5154
- .np-table-cell--currency .np-text-body-default {
5155
- white-space: nowrap;
5156
- }
5157
- .np-table-cell--status .status-circle {
5158
- width: 24px;
5159
- height: 24px;
5160
- }
5161
- .np-table-cell--status .status-circle .status-icon > svg {
5162
- width: 21px;
5163
- height: 21px;
5164
- }
5165
- .np-table-cell .tw-chevron {
5166
- margin-left: 8px;
5167
- margin-left: var(--size-8);
5168
- }
5169
- .np-table-cell-separator {
5170
- margin-top: 4px;
5171
- margin-top: var(--size-4);
5172
- margin-bottom: 4px;
5173
- margin-bottom: var(--size-4);
5174
- height: 1px;
5175
- padding: 0;
5176
- background-color: rgba(134,167,189,0.10196);
5177
- background-color: var(--color-background-neutral);
5178
- }
5179
- .np-table-cell .np-text-body-default {
5180
- line-height: 1.375rem;
5181
- line-height: var(--line-height-22);
5182
- }
5183
- .np-table-cell .np-text-body-large-bold {
5184
- display: flex;
5185
- align-items: center;
5186
- color: #37517e;
5187
- color: var(--color-content-primary);
5188
- white-space: nowrap;
5189
- }
5190
- .np-table-cell .np-table-content--success {
5191
- color: var(--color-sentiment-positive);
5192
- }
5193
- .np-table-cell .np-table-content--error {
5194
- color: var(--color-sentiment-negative);
5195
- }
5196
- .np-table-cell .tw-loader {
5197
- margin: 150px auto;
5198
- }
5199
- @media (max-width: 320px) {
5200
- .np-table-cell .tw-loader {
5201
- margin-top: 70px;
5202
- margin-bottom: 70px;
5203
- }
5204
- }
5205
- .np-table-content {
5206
- gap: 12px;
5207
- gap: var(--size-12);
5208
- }
5209
- .np-table-content--success,
5210
- .np-table-content--error {
5211
- gap: 4px;
5212
- gap: var(--size-4);
5213
- }
5214
- .np-table-content--success .np-table-content-text,
5215
- .np-table-content--error .np-table-content-text {
5216
- line-height: 155%;
5217
- }
5218
- .np-table-content-media {
5219
- flex-shrink: 0;
5220
- }
5221
- .np-table-content-body {
5222
- display: flex;
5223
- flex-direction: column;
5224
- font-size: 0.75rem;
5225
- font-size: var(--font-size-12);
5226
- color: #768e9c;
5227
- color: var(--color-content-tertiary);
5228
- }
5229
- .np-table-content--reversed {
5230
- flex-direction: row-reverse;
5231
- }
5232
- .np-table-content--reversed .np-table-content-body {
5233
- align-items: end;
5234
- }
5235
- .np-table-empty-data {
5236
- display: flex;
5237
- align-items: center;
5238
- }
5239
- .np-table-empty-data .status-circle {
5240
- margin-right: 12px;
5241
- margin-right: var(--size-12);
5242
- }
5243
5012
  .np-tile {
5244
5013
  min-width: 120px;
5245
5014
  border-radius: 10px;
@@ -1,9 +1,3 @@
1
- .status-icon > svg {
2
- height: 32px;
3
- height: var(--size-32);
4
- width: 32px;
5
- width: var(--size-32);
6
- }
7
1
  .status-circle .light {
8
2
  color: var(--color-contrast);
9
3
  }
@@ -19,20 +13,6 @@
19
13
  .np-theme-personal .status-circle.pending .status-icon {
20
14
  color: var(--color-dark);
21
15
  }
22
- .status-circle-sm .status-icon > svg {
23
- height: 14px;
24
- height: var(--size-14);
25
- width: 14px;
26
- width: var(--size-14);
27
- }
28
- @media (max-width: 320px) {
29
- .status-circle-sm .status-icon > svg {
30
- width: 24px;
31
- width: var(--size-24);
32
- height: 24px;
33
- height: var(--size-24);
34
- }
35
- }
36
16
  .status-circle.negative,
37
17
  .status-circle.error {
38
18
  background-color: var(--color-sentiment-negative);
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAOA,KAAK,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEhD,KAAK,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAE9D,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAkBD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4CjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAQA,KAAK,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEhD,KAAK,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAE9D,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAkBD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8CjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes } from 'react';
2
- export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;
2
+ export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;
3
3
  export type Props = {
4
4
  /**
5
5
  * Modify underlying element, `div` by default
@@ -1 +1 @@
1
- {"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../../../../src/common/circle/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAGnD,MAAM,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE9D,MAAM,MAAM,KAAK,GAAG;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,QAAA,MAAM,MAAM;IAfV;;OAEG;SACE,KAAK,CAAC,WAAW;IACtB;;OAEG;WACI,SAAS;IAChB;;;OAGG;gBACS,OAAO;4EAyBnB,CAAC;AAEH,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../../../../src/common/circle/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAKnD,MAAM,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEzD,MAAM,MAAM,KAAK,GAAG;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAenC,QAAA,MAAM,MAAM;IA5BV;;OAEG;SACE,KAAK,CAAC,WAAW;IACtB;;OAEG;WACI,SAAS;IAChB;;;OAGG;gBACS,OAAO;4EA8CnB,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -1,7 +1,11 @@
1
1
  import { SizeSmall, SizeMedium, SizeLarge, Sentiment } from '../common';
2
+ /**
3
+ * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead
4
+ */
5
+ type LegacySizes = SizeSmall | SizeMedium | SizeLarge;
2
6
  export type StatusIconProps = {
3
- sentiment: `${Sentiment}`;
4
- size: SizeSmall | SizeMedium | SizeLarge;
7
+ sentiment?: `${Sentiment}`;
8
+ size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;
5
9
  };
6
10
  declare const StatusIcon: ({ sentiment, size: sizeProp }: StatusIconProps) => import("react").JSX.Element;
7
11
  export default StatusIcon;
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIcon.d.ts","sourceRoot":"","sources":["../../../src/statusIcon/StatusIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAC;AAI1F,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,GAAG,SAAS,EAAE,CAAC;IAC1B,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;CAC1C,CAAC;AAmBF,QAAA,MAAM,UAAU,kCAAsD,eAAe,gCAepF,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"StatusIcon.d.ts","sourceRoot":"","sources":["../../../src/statusIcon/StatusIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAC;AAI1F;;GAEG;AACH,KAAK,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;CACvD,CAAC;AAmBF,QAAA,MAAM,UAAU,kCAAoD,eAAe,gCAgBlF,CAAC;AAEF,eAAe,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-7b7608c",
3
+ "version": "0.0.0-experimental-c76c3bc",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -91,9 +91,9 @@
91
91
  "rollup": "^4.18.1",
92
92
  "rollup-preserve-directives": "^1.1.1",
93
93
  "storybook": "^8.2.2",
94
- "@transferwise/less-config": "3.1.0",
95
94
  "@transferwise/neptune-css": "14.19.1",
96
- "@wise/components-theming": "1.6.1"
95
+ "@wise/components-theming": "1.6.1",
96
+ "@transferwise/less-config": "3.1.0"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "@transferwise/icons": "^3.13.1",
@@ -1,10 +1,12 @@
1
1
  import { Size } from '../common';
2
- import { render, screen } from '../test-utils';
2
+ import { render, screen, mockMatchMedia } from '../test-utils';
3
3
 
4
4
  import avatarColorTestCases from './colors/avatarColorTestCases.json';
5
5
 
6
6
  import Avatar, { AvatarType } from '.';
7
7
 
8
+ mockMatchMedia();
9
+
8
10
  describe('Avatar', () => {
9
11
  it('renders a medium sized thumbnail Avatar with NO outline', () => {
10
12
  render(
@@ -1,9 +1,10 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { useMemo } from 'react';
3
3
 
4
- import { getBrandColorFromSeed, Theme } from '../common';
4
+ import { Breakpoint, getBrandColorFromSeed, Theme } from '../common';
5
5
 
6
6
  import Circle from '../common/circle';
7
+ import { useMedia } from '../common/hooks/useMedia';
7
8
 
8
9
  type NumericAvatarSize = 24 | 40 | 48 | 56 | 72;
9
10
 
@@ -63,7 +64,7 @@ const Avatar: React.FC<AvatarProps> = ({
63
64
  );
64
65
 
65
66
  const size = backwardsCompatibleSize(sizeFromProps);
66
-
67
+ const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
67
68
  return (
68
69
  <Circle
69
70
  size={size}
@@ -80,6 +81,8 @@ const Avatar: React.FC<AvatarProps> = ({
80
81
  fixedSize
81
82
  className="tw-avatar__content"
82
83
  style={{
84
+ // @ts-expect-error CSS custom props allowed
85
+ '--circle-icon-size': '16px',
83
86
  backgroundColor: backgroundColor || backgroundColorFromSeed,
84
87
  }}
85
88
  >
@@ -3,11 +3,11 @@
3
3
  exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar with a name AND profileType AND avatar url renders the image 1`] = `
4
4
  <div
5
5
  class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--thumbnail"
6
- style="--circle-size: 48px;"
6
+ style="--circle-size: 48px; --circle-icon-size: 24px;"
7
7
  >
8
8
  <div
9
9
  class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
10
- style="--circle-size: 48px;"
10
+ style="--circle-size: 48px; --circle-icon-size: 16px;"
11
11
  >
12
12
  <img
13
13
  alt=""
@@ -20,11 +20,11 @@ exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar w
20
20
  exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar with a name AND profileType renders as BUSINESS profile type with an icon 1`] = `
21
21
  <div
22
22
  class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
23
- style="--circle-size: 48px;"
23
+ style="--circle-size: 48px; --circle-icon-size: 24px;"
24
24
  >
25
25
  <div
26
26
  class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
27
- style="--circle-size: 48px;"
27
+ style="--circle-size: 48px; --circle-icon-size: 16px;"
28
28
  >
29
29
  <span
30
30
  class="tw-icon tw-icon-briefcase "
@@ -51,11 +51,11 @@ exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar w
51
51
  exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar with a name AND profileType renders as PERSONAL profile type with an icon 1`] = `
52
52
  <div
53
53
  class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
54
- style="--circle-size: 48px;"
54
+ style="--circle-size: 48px; --circle-icon-size: 24px;"
55
55
  >
56
56
  <div
57
57
  class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
58
- style="--circle-size: 48px;"
58
+ style="--circle-size: 48px; --circle-icon-size: 16px;"
59
59
  >
60
60
  <span
61
61
  class="tw-icon tw-icon-person "
@@ -88,11 +88,11 @@ exports[`FlowNavigationAvatar with a name AND profileType with a badge url passe
88
88
  >
89
89
  <div
90
90
  class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
91
- style="--circle-size: 48px;"
91
+ style="--circle-size: 48px; --circle-icon-size: 24px;"
92
92
  >
93
93
  <div
94
94
  class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
95
- style="--circle-size: 48px;"
95
+ style="--circle-size: 48px; --circle-icon-size: 16px;"
96
96
  >
97
97
  <span
98
98
  class="tw-icon tw-icon-person "
@@ -117,7 +117,7 @@ exports[`FlowNavigationAvatar with a name AND profileType with a badge url passe
117
117
  </div>
118
118
  <div
119
119
  class="np-circle d-flex align-items-center justify-content-center tw-badge__content"
120
- style="--circle-size: 24px;"
120
+ style="--circle-size: 24px; --circle-icon-size: 16px;"
121
121
  >
122
122
  <img
123
123
  alt="badge alt text"
@@ -130,11 +130,11 @@ exports[`FlowNavigationAvatar with a name AND profileType with a badge url passe
130
130
  exports[`FlowNavigationAvatar with a name AND profileType with nothing passed renders a personal icon 1`] = `
131
131
  <div
132
132
  class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
133
- style="--circle-size: 48px;"
133
+ style="--circle-size: 48px; --circle-icon-size: 24px;"
134
134
  >
135
135
  <div
136
136
  class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
137
- style="--circle-size: 48px;"
137
+ style="--circle-size: 48px; --circle-icon-size: 16px;"
138
138
  >
139
139
  <span
140
140
  class="tw-icon tw-icon-person "
@@ -1,7 +1,9 @@
1
- import { render, cleanup, screen } from '../test-utils';
1
+ import { render, cleanup, screen, mockMatchMedia } from '../test-utils';
2
2
 
3
3
  import Badge from '.';
4
4
 
5
+ mockMatchMedia();
6
+
5
7
  describe('Badge', () => {
6
8
  const defaultProps = {
7
9
  badge: <div />,
@@ -23,8 +23,8 @@
23
23
  }
24
24
  @media (max-width: 320px) {
25
25
  .np-circular-btn .tw-icon {
26
- top: 8px;
27
- top: var(--size-8);
26
+ top: 12px;
27
+ top: var(--size-12);
28
28
  }
29
29
  }
30
30
  .np-circular-btn .tw-icon > svg {
@@ -19,7 +19,7 @@
19
19
  .left(0);
20
20
 
21
21
  @media (--screen-400-zoom) {
22
- top: var(--size-8);
22
+ top: var(--size-12);
23
23
  }
24
24
 
25
25
  > svg {
@@ -38,7 +38,7 @@ const CircularButton = ({
38
38
  as="input"
39
39
  // @ts-expect-error it's input[type=button] element
40
40
  type="button"
41
- size={isTinyViewport ? 64 : 56}
41
+ size={isTinyViewport ? 72 : 56}
42
42
  aria-label={children}
43
43
  className={classes}
44
44
  disabled={disabled}