@transferwise/components 0.0.0-experimental-3e2f565 → 0.0.0-experimental-80bf5cd

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.
@@ -31,7 +31,7 @@ interface StoryConfig {
31
31
  *
32
32
  * @default undefined
33
33
  */
34
- variants?: ('default' | 'light' | 'dark' | 'rtl' | 'mobile' | '400%')[];
34
+ variants?: ('default' | 'light' | 'dark' | 'bright-green' | 'forest-green' | 'rtl' | 'mobile' | '400%')[];
35
35
  }
36
36
  /**
37
37
  * Utility function for creating variants of a CSFv3 story.
@@ -1 +1 @@
1
- {"version":3,"file":"story-config.d.ts","sourceRoot":"","sources":["../../../src/test-utils/story-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAarB,CAAC;AAEF,UAAU,WAAW;IACnB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,CAAC,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC;CACzE;AAmBD;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,IAAI,eACjB,QAAQ,CAAC,IAAI,CAAC,gBACb,WAAW,KACxB,QAAQ,CAAC,IAAI,CAoBf,CAAC"}
1
+ {"version":3,"file":"story-config.d.ts","sourceRoot":"","sources":["../../../src/test-utils/story-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAarB,CAAC;AAEF,UAAU,WAAW;IACnB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,CACP,SAAS,GACT,OAAO,GACP,MAAM,GACN,cAAc,GACd,cAAc,GACd,KAAK,GACL,QAAQ,GACR,MAAM,CACT,EAAE,CAAC;CACL;AAmBD;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,IAAI,eACjB,QAAQ,CAAC,IAAI,CAAC,gBACb,WAAW,KACxB,QAAQ,CAAC,IAAI,CAoBf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-3e2f565",
3
+ "version": "0.0.0-experimental-80bf5cd",
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-3e2f565",
95
+ "@transferwise/neptune-css": "0.0.0-experimental-80bf5cd",
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-3e2f565",
100
+ "@transferwise/neptune-css": "0.0.0-experimental-80bf5cd",
101
101
  "@wise/art": "^2.16",
102
102
  "@wise/components-theming": "^1.0.0",
103
103
  "react": ">=18",
@@ -9,7 +9,7 @@ import Alert, { AlertArrowPosition, type AlertProps as FullAlertProps } from './
9
9
 
10
10
  export default {
11
11
  component: Alert,
12
- title: 'Feedback/Alert',
12
+ title: 'Feed-back/Alert',
13
13
  args: {
14
14
  type: Sentiment.POSITIVE,
15
15
  message:
@@ -5,7 +5,7 @@ import { Button, Field, SelectInput, Sentiment } from '..';
5
5
  import Alert, { type AlertProps } from './Alert';
6
6
 
7
7
  const meta = {
8
- title: 'Feedback/Alert/tests',
8
+ title: 'Feed-back/Alert/Tests',
9
9
  component: Alert,
10
10
  argTypes: {},
11
11
  args: {
@@ -1,9 +1,10 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
  import { fn } from '@storybook/test';
3
- import { Freeze, ArrowRight } from '@transferwise/icons';
3
+ import { Freeze, ArrowRight, ArrowLeft } from '@transferwise/icons';
4
4
  import { Flag } from '@wise/art';
5
5
  import Button from './Button.resolver';
6
- import type { ButtonProps } from './Button.types';
6
+ import type { ButtonProps, ButtonPriority } from './Button.types';
7
+ import { storyConfig } from '../test-utils';
7
8
 
8
9
  const withContainer = (Story: any) => (
9
10
  <div style={{ display: 'flex', justifyContent: 'center' }}>
@@ -636,3 +637,120 @@ export const WithAvatarAndIcon: Story = {
636
637
  argTypes: hideControls(['href', 'target', 'as', 'children', 'testId']),
637
638
  parameters: augmentIconProps(),
638
639
  };
640
+
641
+ const buttonPriorities = ['primary', 'secondary', 'tertiary', 'minimal'] as const;
642
+ const buttonSizes = ['sm', 'md', 'lg'] as const;
643
+
644
+ export const AllVariants = storyConfig(
645
+ {
646
+ tags: ['!autodocs'],
647
+ parameters: {
648
+ padding: '0',
649
+ },
650
+ render: () => (
651
+ <div
652
+ className="button-variants"
653
+ style={{ display: 'flex', flexWrap: 'wrap', gap: '16px', maxWidth: '1200px' }}
654
+ >
655
+ {buttonPriorities.map((priority) =>
656
+ buttonSizes.map((size) => (
657
+ <div
658
+ key={`${priority}-default-${size}`}
659
+ style={{ flex: '1 0 30%', marginBottom: '16px', justifyContent: 'space-between' }}
660
+ >
661
+ <Button
662
+ v2
663
+ priority={priority as ButtonPriority}
664
+ size={size}
665
+ iconStart={ArrowLeft}
666
+ iconEnd={ArrowRight}
667
+ avatars={[{ asset: <Freeze /> }]}
668
+ block
669
+ href="https://wise.com"
670
+ target="_blank"
671
+ >
672
+ {`${priority} default ${size}`}
673
+ </Button>
674
+ <Button
675
+ className="m-t-1 m-b-1"
676
+ v2
677
+ priority={priority as ButtonPriority}
678
+ size={size}
679
+ iconStart={ArrowLeft}
680
+ iconEnd={ArrowRight}
681
+ avatars={[{ asset: <Freeze /> }, { asset: <Freeze /> }]}
682
+ block
683
+ disabled
684
+ >
685
+ {`${priority} default ${size} Disabled`}
686
+ </Button>
687
+ <Button
688
+ v2
689
+ priority={priority as ButtonPriority}
690
+ size={size}
691
+ iconStart={ArrowLeft}
692
+ iconEnd={ArrowRight}
693
+ avatars={[{ asset: <Freeze /> }]}
694
+ block
695
+ loading
696
+ >
697
+ {`${priority} default ${size} Loading`}
698
+ </Button>
699
+ </div>
700
+ )),
701
+ )}
702
+ {['primary', 'secondary'].map((priority) =>
703
+ buttonSizes.map((size) => (
704
+ <div
705
+ key={`${priority}-negative-${size}`}
706
+ style={{ flex: '1 0 30%', marginBottom: '16px', justifyContent: 'space-between' }}
707
+ >
708
+ <Button
709
+ v2
710
+ sentiment="negative"
711
+ priority={priority as ButtonPriority}
712
+ size={size}
713
+ iconStart={ArrowLeft}
714
+ iconEnd={ArrowRight}
715
+ avatars={[{ asset: <Freeze /> }]}
716
+ block
717
+ href="https://wise.com"
718
+ target="_blank"
719
+ >
720
+ {`${priority} negative ${size}`}
721
+ </Button>
722
+ <Button
723
+ className="m-t-1 m-b-1"
724
+ v2
725
+ sentiment="negative"
726
+ priority={priority as ButtonPriority}
727
+ size={size}
728
+ iconStart={ArrowLeft}
729
+ iconEnd={ArrowRight}
730
+ avatars={[{ asset: <Freeze /> }]}
731
+ block
732
+ disabled
733
+ >
734
+ {`${priority} negative ${size} Disabled`}
735
+ </Button>
736
+ <Button
737
+ v2
738
+ sentiment="negative"
739
+ priority={priority as ButtonPriority}
740
+ size={size}
741
+ iconStart={ArrowLeft}
742
+ iconEnd={ArrowRight}
743
+ avatars={[{ asset: <Freeze /> }]}
744
+ block
745
+ loading
746
+ >
747
+ {`${priority} negative ${size} Loading`}
748
+ </Button>
749
+ </div>
750
+ )),
751
+ )}
752
+ </div>
753
+ ),
754
+ },
755
+ { variants: ['default', 'dark', 'bright-green', 'forest-green'] },
756
+ );
@@ -4,7 +4,7 @@ import CriticalCommsBanner from '.';
4
4
 
5
5
  export default {
6
6
  component: CriticalCommsBanner,
7
- title: 'Feedback/CriticalCommsBanner',
7
+ title: 'Feed-back/CriticalCommsBanner',
8
8
  tags: ['autodocs'],
9
9
  } satisfies Meta<typeof CriticalCommsBanner>;
10
10
 
@@ -12,7 +12,7 @@ import Info from '../info';
12
12
 
13
13
  export default {
14
14
  component: Field,
15
- title: 'Field',
15
+ title: 'Forms/Field',
16
16
  tags: ['autodocs'],
17
17
  argTypes: {
18
18
  messageIconLabel: {
@@ -3,7 +3,7 @@ import { Label } from './Label';
3
3
 
4
4
  export default {
5
5
  component: Label,
6
- title: 'Label',
6
+ title: 'Dialogs/Label',
7
7
  tags: ['autodocs'],
8
8
  };
9
9
 
@@ -5,7 +5,7 @@ import { Nudge } from '..';
5
5
 
6
6
  export default {
7
7
  component: Nudge,
8
- title: 'Feedback/Nudge',
8
+ title: 'Feed-back/Nudge',
9
9
  };
10
10
 
11
11
  export const Default = () => {
@@ -1,7 +1,15 @@
1
1
  declare module '@storybook/react' {
2
2
  interface Parameters {
3
3
  /** Prefer using `storyConfig` for configuring variants */
4
- variants?: ('default' | 'light' | 'dark' | 'rtl' | (string & Record<string, unknown>))[];
4
+ variants?: (
5
+ | 'default'
6
+ | 'light'
7
+ | 'dark'
8
+ | 'bright-green'
9
+ | 'forest-green'
10
+ | 'rtl'
11
+ | (string & Record<string, unknown>)
12
+ )[];
5
13
  /** Used by Chromatic */
6
14
  chromatic?: ChromaticParameters;
7
15
  viewport?: {
@@ -30,7 +30,16 @@ interface StoryConfig {
30
30
  *
31
31
  * @default undefined
32
32
  */
33
- variants?: ('default' | 'light' | 'dark' | 'rtl' | 'mobile' | '400%')[];
33
+ variants?: (
34
+ | 'default'
35
+ | 'light'
36
+ | 'dark'
37
+ | 'bright-green'
38
+ | 'forest-green'
39
+ | 'rtl'
40
+ | 'mobile'
41
+ | '400%'
42
+ )[];
34
43
  }
35
44
 
36
45
  const getViewportWidth = (viewport: (typeof viewports)[keyof typeof viewports]) => {