@transferwise/components 0.0.0-experimental-1d18c88 → 0.0.0-experimental-5b8e94e

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-1d18c88",
3
+ "version": "0.0.0-experimental-5b8e94e",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -92,12 +92,12 @@
92
92
  "rollup-preserve-directives": "^1.1.1",
93
93
  "storybook": "^8.2.2",
94
94
  "@transferwise/less-config": "3.1.0",
95
- "@transferwise/neptune-css": "0.0.0-experimental-1d18c88",
95
+ "@transferwise/neptune-css": "0.0.0-experimental-5b8e94e",
96
96
  "@wise/components-theming": "1.6.1"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "@transferwise/icons": "^3.13.1",
100
- "@transferwise/neptune-css": "0.0.0-experimental-1d18c88",
100
+ "@transferwise/neptune-css": "0.0.0-experimental-5b8e94e",
101
101
  "@wise/art": "^2.16",
102
102
  "@wise/components-theming": "^1.0.0",
103
103
  "react": ">=18",
@@ -11,6 +11,28 @@ const withContainer = (Story: any) => (
11
11
  </div>
12
12
  );
13
13
 
14
+ /**
15
+ * Used for showing multiple components within a Canvas.
16
+ * @decorator
17
+ */
18
+ const withComponentGrid =
19
+ (maxWidth = 'auto') =>
20
+ (Story: any) => (
21
+ <div
22
+ style={{
23
+ width: '100%',
24
+ placeItems: 'center',
25
+ justifyContent: 'center',
26
+ display: 'flex',
27
+ flexWrap: 'wrap',
28
+ gap: '2rem',
29
+ maxWidth,
30
+ }}
31
+ >
32
+ <Story />
33
+ </div>
34
+ );
35
+
14
36
  /**
15
37
  * Not all stories need access to all controls as it causes unnecessary UI noise.
16
38
  */
@@ -47,24 +69,6 @@ const augmentIconProps = ({ start = 'Freeze', end = 'ArrowRight' } = {}) => ({
47
69
  },
48
70
  });
49
71
 
50
- /**
51
- * Used for showing multiple components within a Canvas.
52
- * @decorator
53
- */
54
- const withComponentGrid = (columns: number) => (Story: any) => (
55
- <div
56
- style={{
57
- display: 'grid',
58
- gap: '2rem',
59
- gridTemplateColumns: `repeat(${columns}, auto)`,
60
- justifyItems: 'center',
61
- alignItems: 'center',
62
- }}
63
- >
64
- <Story />
65
- </div>
66
- );
67
-
68
72
  /**
69
73
  * Convenience controls for previewing rich markup,
70
74
  * not otherwise possible via Storybook
@@ -308,7 +312,7 @@ export const Sentiment: StoryObj<PreviewStoryArgs> = {
308
312
  previewIconEnd: false,
309
313
  previewAvatars: false,
310
314
  },
311
- decorators: [withComponentGrid(2)],
315
+ decorators: [withComponentGrid('30rem')],
312
316
  parameters: augmentIconProps(),
313
317
  };
314
318
 
@@ -347,7 +351,7 @@ export const Priority: StoryObj<PreviewStoryArgs> = {
347
351
  previewIconEnd: false,
348
352
  previewAvatars: false,
349
353
  },
350
- decorators: [withComponentGrid(4)],
354
+ decorators: [withComponentGrid()],
351
355
  };
352
356
 
353
357
  /**
@@ -381,7 +385,7 @@ export const Size: StoryObj<PreviewStoryArgs> = {
381
385
  previewIconEnd: false,
382
386
  previewAvatars: false,
383
387
  },
384
- decorators: [withComponentGrid(3)],
388
+ decorators: [withComponentGrid()],
385
389
  };
386
390
 
387
391
  /**
@@ -417,7 +421,7 @@ export const Disabled: StoryObj<PreviewStoryArgs> = {
417
421
 
418
422
  return (
419
423
  <Button {...props} {...previewProps}>
420
- Button as anchor
424
+ Disabled button
421
425
  </Button>
422
426
  );
423
427
  },
@@ -464,7 +468,7 @@ export const DisplayBlock: StoryObj<PreviewStoryArgs> = {
464
468
 
465
469
  return (
466
470
  <Button {...props} {...previewProps}>
467
- Button as anchor
471
+ Full-width button
468
472
  </Button>
469
473
  );
470
474
  },
@@ -529,7 +533,7 @@ export const WithIcons: StoryObj<PreviewStoryArgs> = {
529
533
  size: 'md',
530
534
  },
531
535
  parameters: augmentIconProps(),
532
- decorators: [withComponentGrid(3)],
536
+ decorators: [withComponentGrid()],
533
537
  };
534
538
 
535
539
  /**
@@ -599,7 +603,7 @@ export const WithAvatars: StoryObj<PreviewStoryArgs> = {
599
603
  },
600
604
  },
601
605
  },
602
- decorators: [withComponentGrid(4)],
606
+ decorators: [withComponentGrid()],
603
607
  };
604
608
 
605
609
  /**