@transferwise/components 46.169.0 → 46.169.1

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.
@@ -38,6 +38,7 @@
38
38
  "neptune.PhoneNumberInput.phoneNumberPrefix": "前缀",
39
39
  "neptune.Select.searchPlaceholder": "搜索",
40
40
  "neptune.SelectInput.noResultsFound": "找不到结果",
41
+ "neptune.Snackbar.escapeDismissHint": "按 Esc 键关闭。",
41
42
  "neptune.StatusIcon.iconLabel.error": "错误:",
42
43
  "neptune.StatusIcon.iconLabel.information": "信息:",
43
44
  "neptune.StatusIcon.iconLabel.pending": "待处理:",
@@ -42,6 +42,7 @@ var zhCN = {
42
42
  "neptune.PhoneNumberInput.phoneNumberPrefix": "前缀",
43
43
  "neptune.Select.searchPlaceholder": "搜索",
44
44
  "neptune.SelectInput.noResultsFound": "找不到结果",
45
+ "neptune.Snackbar.escapeDismissHint": "按 Esc 键关闭。",
45
46
  "neptune.StatusIcon.iconLabel.error": "错误:",
46
47
  "neptune.StatusIcon.iconLabel.information": "信息:",
47
48
  "neptune.StatusIcon.iconLabel.pending": "待处理:",
@@ -1 +1 @@
1
- {"version":3,"file":"zh-CN.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"zh-CN.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -38,6 +38,7 @@ var zhCN = {
38
38
  "neptune.PhoneNumberInput.phoneNumberPrefix": "前缀",
39
39
  "neptune.Select.searchPlaceholder": "搜索",
40
40
  "neptune.SelectInput.noResultsFound": "找不到结果",
41
+ "neptune.Snackbar.escapeDismissHint": "按 Esc 键关闭。",
41
42
  "neptune.StatusIcon.iconLabel.error": "错误:",
42
43
  "neptune.StatusIcon.iconLabel.information": "信息:",
43
44
  "neptune.StatusIcon.iconLabel.pending": "待处理:",
@@ -1 +1 @@
1
- {"version":3,"file":"zh-CN.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"zh-CN.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/build/main.css CHANGED
@@ -27257,12 +27257,14 @@ a[data-toggle="tooltip"] {
27257
27257
  }
27258
27258
  .wds-Button-avatars {
27259
27259
  display: inline-flex;
27260
+ flex-shrink: 0;
27260
27261
  }
27261
27262
  .wds-Button-avatars .np-avatar-view .np-avatar-view-content {
27262
27263
  color: var(--Button-color);
27263
27264
  }
27264
27265
  .wds-Button-icon {
27265
27266
  display: inline-block;
27267
+ flex-shrink: 0;
27266
27268
  }
27267
27269
  .wds-Button-icon--md {
27268
27270
  --Button-iconSize: 18px;
@@ -175,12 +175,14 @@
175
175
  }
176
176
  .wds-Button-avatars {
177
177
  display: inline-flex;
178
+ flex-shrink: 0;
178
179
  }
179
180
  .wds-Button-avatars .np-avatar-view .np-avatar-view-content {
180
181
  color: var(--Button-color);
181
182
  }
182
183
  .wds-Button-icon {
183
184
  display: inline-block;
185
+ flex-shrink: 0;
184
186
  }
185
187
  .wds-Button-icon--md {
186
188
  --Button-iconSize: 18px;
@@ -27257,12 +27257,14 @@ a[data-toggle="tooltip"] {
27257
27257
  }
27258
27258
  .wds-Button-avatars {
27259
27259
  display: inline-flex;
27260
+ flex-shrink: 0;
27260
27261
  }
27261
27262
  .wds-Button-avatars .np-avatar-view .np-avatar-view-content {
27262
27263
  color: var(--Button-color);
27263
27264
  }
27264
27265
  .wds-Button-icon {
27265
27266
  display: inline-block;
27267
+ flex-shrink: 0;
27266
27268
  }
27267
27269
  .wds-Button-icon--md {
27268
27270
  --Button-iconSize: 18px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "46.169.0",
3
+ "version": "46.169.1",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -175,12 +175,14 @@
175
175
  }
176
176
  .wds-Button-avatars {
177
177
  display: inline-flex;
178
+ flex-shrink: 0;
178
179
  }
179
180
  .wds-Button-avatars .np-avatar-view .np-avatar-view-content {
180
181
  color: var(--Button-color);
181
182
  }
182
183
  .wds-Button-icon {
183
184
  display: inline-block;
185
+ flex-shrink: 0;
184
186
  }
185
187
  .wds-Button-icon--md {
186
188
  --Button-iconSize: 18px;
@@ -159,6 +159,7 @@
159
159
 
160
160
  &-avatars {
161
161
  display: inline-flex;
162
+ flex-shrink: 0;
162
163
 
163
164
  .np-avatar-view .np-avatar-view-content {
164
165
  color: var(--Button-color);
@@ -168,6 +169,7 @@
168
169
  // Icon styles
169
170
  &-icon {
170
171
  display: inline-block;
172
+ flex-shrink: 0;
171
173
 
172
174
  &--md{
173
175
  --Button-iconSize: 18px;
@@ -265,3 +265,46 @@ export const RTLDiff: Story = {
265
265
  },
266
266
  }),
267
267
  };
268
+
269
+ export const IconsOnNarrowViewports: Story = {
270
+ parameters: {
271
+ chromatic: { viewports: [300, 320] },
272
+ },
273
+ render: () => (
274
+ <div style={{ display: 'grid', gap: '16px', width: '140px' }}>
275
+ {(['sm', 'md'] as const).map((size) =>
276
+ (['start', 'end'] as const).map((position) => (
277
+ <Button
278
+ key={`${size}-${position}`}
279
+ v2
280
+ size={size}
281
+ block
282
+ addonStart={position === 'start' ? { type: 'icon', value: <Freeze /> } : undefined}
283
+ addonEnd={position === 'end' ? { type: 'icon', value: <ArrowEnd /> } : undefined}
284
+ >
285
+ Recipients
286
+ </Button>
287
+ )),
288
+ )}
289
+ <Button v2 size="md" block addonStart={{ type: 'avatar', value: [{ asset: <Freeze /> }] }}>
290
+ Recipients
291
+ </Button>
292
+ </div>
293
+ ),
294
+ play: async ({ canvasElement }) => {
295
+ await document.fonts.ready;
296
+ const icons = canvasElement.querySelectorAll('.wds-Button-icon');
297
+ await expect(icons).toHaveLength(4);
298
+ for (const icon of icons) {
299
+ const size = icon.classList.contains('wds-Button-icon--sm') ? 16 : 18;
300
+ await expect(getComputedStyle(icon).flexShrink).toBe('0');
301
+ await expect(icon.getBoundingClientRect().width).toBeCloseTo(size, 1);
302
+ const svg = icon.querySelector('svg');
303
+ await expect(svg).not.toBeNull();
304
+ await expect(svg?.getBoundingClientRect().width).toBeCloseTo(size, 1);
305
+ await expect(svg?.getBoundingClientRect().height).toBeCloseTo(size, 1);
306
+ }
307
+ const avatars = canvasElement.querySelector('.wds-Button-avatars');
308
+ await expect(avatars && getComputedStyle(avatars).flexShrink).toBe('0');
309
+ },
310
+ };
@@ -38,6 +38,7 @@
38
38
  "neptune.PhoneNumberInput.phoneNumberPrefix": "前缀",
39
39
  "neptune.Select.searchPlaceholder": "搜索",
40
40
  "neptune.SelectInput.noResultsFound": "找不到结果",
41
+ "neptune.Snackbar.escapeDismissHint": "按 Esc 键关闭。",
41
42
  "neptune.StatusIcon.iconLabel.error": "错误:",
42
43
  "neptune.StatusIcon.iconLabel.information": "信息:",
43
44
  "neptune.StatusIcon.iconLabel.pending": "待处理:",
package/src/main.css CHANGED
@@ -27257,12 +27257,14 @@ a[data-toggle="tooltip"] {
27257
27257
  }
27258
27258
  .wds-Button-avatars {
27259
27259
  display: inline-flex;
27260
+ flex-shrink: 0;
27260
27261
  }
27261
27262
  .wds-Button-avatars .np-avatar-view .np-avatar-view-content {
27262
27263
  color: var(--Button-color);
27263
27264
  }
27264
27265
  .wds-Button-icon {
27265
27266
  display: inline-block;
27267
+ flex-shrink: 0;
27266
27268
  }
27267
27269
  .wds-Button-icon--md {
27268
27270
  --Button-iconSize: 18px;