@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
@@ -8,7 +8,7 @@ exports[`CircularButton defaults renders a button of type accent and priority pr
8
8
  <input
9
9
  aria-label="Add money"
10
10
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-1"
11
- style="--circle-size: var(--size-56);"
11
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
12
12
  type="button"
13
13
  />
14
14
  <span
@@ -46,7 +46,7 @@ exports[`CircularButton priorities renders primary buttons 1`] = `
46
46
  <input
47
47
  aria-label="Add money"
48
48
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-1"
49
- style="--circle-size: var(--size-56);"
49
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
50
50
  type="button"
51
51
  />
52
52
  <span
@@ -84,7 +84,7 @@ exports[`CircularButton priorities renders primary buttons 2`] = `
84
84
  <input
85
85
  aria-label="Add money"
86
86
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-positive btn-priority-1"
87
- style="--circle-size: var(--size-56);"
87
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
88
88
  type="button"
89
89
  />
90
90
  <span
@@ -122,7 +122,7 @@ exports[`CircularButton priorities renders primary buttons 3`] = `
122
122
  <input
123
123
  aria-label="Add money"
124
124
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-negative btn-priority-1"
125
- style="--circle-size: var(--size-56);"
125
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
126
126
  type="button"
127
127
  />
128
128
  <span
@@ -160,7 +160,7 @@ exports[`CircularButton priorities renders secondary buttons 1`] = `
160
160
  <input
161
161
  aria-label="Add money"
162
162
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-2"
163
- style="--circle-size: var(--size-56);"
163
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
164
164
  type="button"
165
165
  />
166
166
  <span
@@ -198,7 +198,7 @@ exports[`CircularButton priorities renders secondary buttons 2`] = `
198
198
  <input
199
199
  aria-label="Add money"
200
200
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-positive btn-priority-2"
201
- style="--circle-size: var(--size-56);"
201
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
202
202
  type="button"
203
203
  />
204
204
  <span
@@ -236,7 +236,7 @@ exports[`CircularButton priorities renders secondary buttons 3`] = `
236
236
  <input
237
237
  aria-label="Add money"
238
238
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-negative btn-priority-2"
239
- style="--circle-size: var(--size-56);"
239
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
240
240
  type="button"
241
241
  />
242
242
  <span
@@ -274,7 +274,7 @@ exports[`CircularButton types renders accent buttons 1`] = `
274
274
  <input
275
275
  aria-label="Add money"
276
276
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-1"
277
- style="--circle-size: var(--size-56);"
277
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
278
278
  type="button"
279
279
  />
280
280
  <span
@@ -312,7 +312,7 @@ exports[`CircularButton types renders negative buttons 1`] = `
312
312
  <input
313
313
  aria-label="Add money"
314
314
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-negative btn-priority-1"
315
- style="--circle-size: var(--size-56);"
315
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
316
316
  type="button"
317
317
  />
318
318
  <span
@@ -350,7 +350,7 @@ exports[`CircularButton types renders positive buttons 1`] = `
350
350
  <input
351
351
  aria-label="Add money"
352
352
  class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-positive btn-priority-1"
353
- style="--circle-size: var(--size-56);"
353
+ style="--circle-size: var(--size-56); --circle-icon-size: 28px;"
354
354
  type="button"
355
355
  />
356
356
  <span
@@ -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
+ }
@@ -3,4 +3,10 @@
3
3
  width: var(--circle-size);
4
4
  height: var(--circle-size);
5
5
  flex-shrink: 0;
6
+
7
+ // has custom icon sizes
8
+ .tw-icon > svg {
9
+ height: var(--circle-icon-size);
10
+ width: var(--circle-icon-size);
11
+ }
6
12
  }
@@ -1,7 +1,9 @@
1
1
  import { HTMLAttributes, forwardRef } from 'react';
2
2
  import { clsx } from 'clsx';
3
+ import { useMedia } from '../hooks/useMedia';
4
+ import { Breakpoint } from '../propsValues/breakpoint';
3
5
 
4
- export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;
6
+ export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;
5
7
 
6
8
  export type Props = {
7
9
  /**
@@ -19,6 +21,19 @@ export type Props = {
19
21
  fixedSize?: boolean;
20
22
  } & HTMLAttributes<HTMLDivElement>;
21
23
 
24
+ /**
25
+ * circle like components has custom sizes for icons
26
+ */
27
+ const MAP_ICON_SIZE = {
28
+ 16: 12,
29
+ 24: 16,
30
+ 32: 18,
31
+ 40: 20,
32
+ 48: 24,
33
+ 56: 28,
34
+ 72: 36,
35
+ };
36
+
22
37
  const Circle = forwardRef(function Circle(
23
38
  {
24
39
  as: Element = 'div',
@@ -31,11 +46,19 @@ const Circle = forwardRef(function Circle(
31
46
  }: Props,
32
47
  ref,
33
48
  ) {
49
+ const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
34
50
  return (
35
51
  <Element
36
52
  {...props}
37
53
  ref={ref}
38
- style={{ ...style, '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})` }}
54
+ style={{
55
+ '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})`,
56
+ '--circle-icon-size':
57
+ isTinyViewport && !fixedSize
58
+ ? `${MAP_ICON_SIZE[size] / 2}px`
59
+ : `${MAP_ICON_SIZE[size]}px`,
60
+ ...style,
61
+ }}
39
62
  className={clsx('np-circle', 'd-flex align-items-center justify-content-center', className)}
40
63
  >
41
64
  {children}
@@ -22,11 +22,11 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
22
22
  >
23
23
  <div
24
24
  class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
25
- style="--circle-size: 48px;"
25
+ style="--circle-size: 48px; --circle-icon-size: 24px;"
26
26
  >
27
27
  <div
28
28
  class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
29
- style="--circle-size: 48px;"
29
+ style="--circle-size: 48px; --circle-icon-size: 16px;"
30
30
  >
31
31
  TM
32
32
  </div>
@@ -139,11 +139,11 @@ exports[`FlowNavigation renders as expected 1`] = `
139
139
  >
140
140
  <div
141
141
  class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
142
- style="--circle-size: 48px;"
142
+ style="--circle-size: 48px; --circle-icon-size: 24px;"
143
143
  >
144
144
  <div
145
145
  class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
146
- style="--circle-size: 48px;"
146
+ style="--circle-size: 48px; --circle-icon-size: 16px;"
147
147
  >
148
148
  TM
149
149
  </div>
package/src/i18n/en.json CHANGED
@@ -30,8 +30,6 @@
30
30
  "neptune.Summary.statusDone": "Item done",
31
31
  "neptune.Summary.statusNotDone": "Item to do",
32
32
  "neptune.Summary.statusPending": "Item pending",
33
- "neptune.Table.emptyData": "No results found",
34
- "neptune.Table.refreshPage": "Refresh page",
35
33
  "neptune.Upload.csButtonText": "Upload another file?",
36
34
  "neptune.Upload.csFailureText": "Upload failed. Please, try again",
37
35
  "neptune.Upload.csSuccessText": "Upload complete!",
package/src/main.css CHANGED
@@ -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;
package/src/main.less CHANGED
@@ -60,7 +60,6 @@
60
60
  @import "./summary/Summary.less";
61
61
  @import "./switch/Switch.less";
62
62
  @import "./tabs/Tabs.less";
63
- @import "./table/Table.less";
64
63
  @import "./tile/Tile.less";
65
64
  @import "./tooltip/Tooltip.less";
66
65
  @import "./typeahead/Typeahead.less";
@@ -1,9 +1,11 @@
1
1
  import Avatar, { AvatarType } from '../avatar';
2
2
  import { Size } from '../common';
3
- import { render } from '../test-utils';
3
+ import { render, mockMatchMedia } from '../test-utils';
4
4
 
5
5
  import OverlayHeader from '.';
6
6
 
7
+ mockMatchMedia();
8
+
7
9
  describe('OverlayHeader', () => {
8
10
  const props = {
9
11
  avatar: (
@@ -19,11 +19,11 @@ exports[`OverlayHeader renders as expected 1`] = `
19
19
  >
20
20
  <div
21
21
  class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
22
- style="--circle-size: 48px;"
22
+ style="--circle-size: 48px; --circle-icon-size: 24px;"
23
23
  >
24
24
  <div
25
25
  class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
26
- style="--circle-size: 48px;"
26
+ style="--circle-size: 48px; --circle-icon-size: 16px;"
27
27
  >
28
28
  TM
29
29
  </div>
@@ -1,8 +1,10 @@
1
- import { render, fireEvent, screen } from '@testing-library/react';
1
+ import { render, fireEvent, screen, mockMatchMedia } from '../test-utils';
2
2
  import React from 'react';
3
3
 
4
4
  import PromoCard, { PromoCardProps, PromoCardCheckedProps, PromoCardLinkProps } from './PromoCard';
5
5
 
6
+ mockMatchMedia();
7
+
6
8
  describe('PromoCard', () => {
7
9
  const defaultProps = {
8
10
  title: 'Test Title',
@@ -1,8 +1,9 @@
1
1
  import Avatar, { AvatarType } from '../avatar';
2
- import { render } from '../test-utils';
2
+ import { render, mockMatchMedia } from '../test-utils';
3
3
 
4
4
  import Radio from '.';
5
5
 
6
+ mockMatchMedia();
6
7
  jest.mock('../common/hooks');
7
8
 
8
9
  describe('Radio', () => {
@@ -35,11 +35,11 @@ exports[`Radio shows the avatar when supplied 1`] = `
35
35
  >
36
36
  <div
37
37
  class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
38
- style="--circle-size: 48px;"
38
+ style="--circle-size: 48px; --circle-icon-size: 24px;"
39
39
  >
40
40
  <div
41
41
  class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
42
- style="--circle-size: 48px;"
42
+ style="--circle-size: 48px; --circle-icon-size: 16px;"
43
43
  >
44
44
  HD
45
45
  </div>
@@ -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,8 +1,3 @@
1
- .status-icon > svg {
2
- height: var(--size-32);
3
- width: var(--size-32);
4
- }
5
-
6
1
  .status-circle {
7
2
  .light {
8
3
  color: var(--color-contrast);
@@ -22,18 +17,6 @@
22
17
  }
23
18
  }
24
19
  }
25
-
26
- &-sm {
27
- .status-icon > svg {
28
- height: var(--size-14);
29
- width: var(--size-14);
30
-
31
- @media (--screen-400-zoom) {
32
- width: var(--size-24);
33
- height: var(--size-24);
34
- }
35
- }
36
- }
37
20
  }
38
21
 
39
22
  .status-circle.negative,
@@ -1,15 +1,12 @@
1
- import { Sentiment, Size, SizeLarge, SizeMedium, SizeSmall } from '../common';
1
+ import { Sentiment, Size } from '../common';
2
2
  import { render, cleanup, screen, mockMatchMedia } from '../test-utils';
3
3
 
4
- import StatusIcon from '.';
4
+ import StatusIcon, { type StatusIconProps } from '.';
5
5
 
6
6
  mockMatchMedia();
7
7
 
8
8
  describe('StatusIcon', () => {
9
- const renderStatusIcon = (props?: {
10
- sentiment?: Sentiment;
11
- size?: SizeLarge | SizeMedium | SizeSmall;
12
- }) => {
9
+ const renderStatusIcon = (props?: StatusIconProps) => {
13
10
  return render(
14
11
  <StatusIcon
15
12
  sentiment={props?.sentiment || Sentiment.NEUTRAL}
@@ -25,23 +22,8 @@ describe('StatusIcon', () => {
25
22
 
26
23
  expect(screen.getByTestId('status-icon')).toHaveClass('neutral');
27
24
  expect(screen.getByTestId('status-icon')).toHaveClass('status-circle');
28
- expect(screen.getByTestId('status-icon')).toHaveClass('status-circle-md');
29
25
  });
30
26
 
31
- it.each([
32
- [Size.SMALL as const, 'status-circle-sm'],
33
- [Size.MEDIUM as const, 'status-circle-md'],
34
- [Size.LARGE as const, 'status-circle-lg'],
35
- ])(
36
- "if prop 'size' equals '%s' is passed, renders the status icon with class '%s'",
37
- (size, expectedClass) => {
38
- renderStatusIcon({ size });
39
-
40
- expect(screen.getByTestId('status-icon')).toHaveClass(expectedClass);
41
- cleanup();
42
- },
43
- );
44
-
45
27
  it.each([
46
28
  [Sentiment.NEGATIVE, Sentiment.NEGATIVE],
47
29
  [Sentiment.NEUTRAL, Sentiment.NEUTRAL],