@transferwise/components 0.0.0-experimental-b7e52e5 → 0.0.0-experimental-57931af

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-b7e52e5",
3
+ "version": "0.0.0-experimental-57931af",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -94,14 +94,14 @@
94
94
  "rollup": "^4.18.1",
95
95
  "rollup-preserve-directives": "^1.1.1",
96
96
  "storybook": "^8.2.2",
97
- "@transferwise/neptune-css": "0.0.0-experimental-b7e52e5",
98
97
  "@wise/components-theming": "1.6.2",
98
+ "@transferwise/neptune-css": "0.0.0-experimental-57931af",
99
99
  "@transferwise/less-config": "3.1.1",
100
100
  "@wise/wds-configs": "0.0.0"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "@transferwise/icons": "^3.19.0",
104
- "@transferwise/neptune-css": "0.0.0-experimental-b7e52e5",
104
+ "@transferwise/neptune-css": "0.0.0-experimental-57931af",
105
105
  "@wise/art": "^2.16",
106
106
  "@wise/components-theming": "^1.0.0",
107
107
  "react": ">=18",
@@ -1,7 +1,7 @@
1
- import ListItem, { List } from '.';
2
- import { Button } from '../index';
3
- import AvatarView from '../avatarView';
4
1
  import { FastFlag } from '@transferwise/icons';
2
+ import Button from '../button';
3
+ import AvatarView from '../avatarView';
4
+ import ListItem, { List, type ListItemProps } from '.';
5
5
 
6
6
  export default {
7
7
  component: ListItem,
@@ -9,22 +9,27 @@ export default {
9
9
  };
10
10
 
11
11
  export const LongText = () => {
12
+ const sharedProps: Partial<ListItemProps> = {
13
+ media: <AvatarView profileName="Super Pepa" badge={{ icon: <FastFlag /> }} />,
14
+ action: (
15
+ <Button v2 size="sm" onClick={() => {}}>
16
+ Action
17
+ </Button>
18
+ ),
19
+ };
20
+
12
21
  return (
13
22
  <div style={{ width: '35rem' }}>
14
23
  <List>
15
24
  <ListItem
16
- title="Wise"
25
+ {...sharedProps}
26
+ title="Default behaviour"
17
27
  value="This is a test of a long word dontbreakme dontbreakme dontbreakme breakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakme word."
18
- media={<AvatarView profileName="Super Pepa" badge={{ icon: <FastFlag /> }} />}
19
- action={
20
- <Button v2 size="sm" onClick={() => {}}>
21
- Action
22
- </Button>
23
- }
24
28
  />
25
29
 
26
30
  <ListItem
27
- title="Wise"
31
+ {...sharedProps}
32
+ title="Wrapping the long word with a 'span.text-word-break'"
28
33
  value={
29
34
  <>
30
35
  {'This is a test of a a very long word dontbreakme dontbreakme dontbreakme '}
@@ -34,12 +39,12 @@ export const LongText = () => {
34
39
  {' word.'}
35
40
  </>
36
41
  }
37
- media={<AvatarView profileName="Super Pepa" badge={{ icon: <FastFlag /> }} />}
38
- action={
39
- <Button v2 size="sm" onClick={() => {}}>
40
- Action
41
- </Button>
42
- }
42
+ />
43
+
44
+ <ListItem
45
+ {...sharedProps}
46
+ title="Using '&amp;shy;' HTML entitty"
47
+ value="This is a test of a a very long word dontbreakme dontbreakme dontbreakme break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me word."
43
48
  />
44
49
  </List>
45
50
  </div>
@@ -1,7 +1,6 @@
1
1
  import { Home as HomeIcon } from '@transferwise/icons';
2
2
  import { Status } from '../common';
3
- import Summary from './Summary';
4
- import { InfoPresentation } from '../info';
3
+ import Summary, { type SummaryProps } from '.';
5
4
 
6
5
  export default {
7
6
  component: Summary,
@@ -9,46 +8,47 @@ export default {
9
8
  };
10
9
 
11
10
  export const LongText = () => {
11
+ const sharedProps: Partial<SummaryProps> = {
12
+ action: {
13
+ text: 'Change address',
14
+ href: '#change-address',
15
+ 'aria-label': ' Click here to change address',
16
+ },
17
+ as: 'li',
18
+ icon: <HomeIcon size={24} />,
19
+ status: Status.NOT_DONE,
20
+ info: {
21
+ title: 'Title',
22
+ },
23
+ };
12
24
  return (
13
- <ul style={{ width: '30rem' }}>
25
+ <ul style={{ width: '34rem' }}>
14
26
  <Summary
15
- action={{
16
- text: 'Change address',
17
- href: '#change-address',
18
- 'aria-label': ' Click here to change address',
19
- }}
20
- as="li"
21
- description="This is a test of a a very long word dontbreakme dontbreakme dontbreakme breakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakme word."
22
- icon={<HomeIcon size={24} />}
23
- title="Summary title"
24
- status={Status.NOT_DONE}
25
- info={{
26
- title: 'Title',
27
- }}
27
+ title="Default behaviour"
28
+ description="This is a test of a a very long word dontbreakme dontbreakme dontbreakme dontbreakme dontbreakme breakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakme word."
29
+ {...sharedProps}
28
30
  />
29
31
 
30
32
  <Summary
31
- action={{
32
- text: 'Change address',
33
- href: '#change-address',
34
- 'aria-label': ' Click here to change address',
35
- }}
36
- as="li"
33
+ title="Wrapping the long word with a 'span.text-word-break'"
37
34
  description={
38
35
  <>
39
- {'This is a test of a a very long word dontbreakme dontbreakme dontbreakme '}
36
+ {
37
+ 'This is a test of a a very long word dontbreakme dontbreakme dontbreakme dontbreakme dontbreakme '
38
+ }
40
39
  <span className="text-word-break">
41
40
  breakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakme
42
41
  </span>
43
42
  {' word.'}
44
43
  </>
45
44
  }
46
- icon={<HomeIcon size={24} />}
47
- title="Summary title"
48
- status={Status.NOT_DONE}
49
- info={{
50
- title: 'Title',
51
- }}
45
+ {...sharedProps}
46
+ />
47
+
48
+ <Summary
49
+ title="Using '&amp;shy;' HTML entitty"
50
+ description="This is a test of a a very long word dontbreakme dontbreakme dontbreakme dontbreakme dontbreakme break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me word."
51
+ {...sharedProps}
52
52
  />
53
53
  </ul>
54
54
  );
@@ -184,7 +184,9 @@ describe('Upload Component', () => {
184
184
 
185
185
  await waitForUpload();
186
186
 
187
- expect(await screen.findByText(/File type not supported. Please try again with a different file/i)).toBeInTheDocument();
187
+ expect(
188
+ await screen.findByText(/File type not supported. Please try again with a different file/i),
189
+ ).toBeInTheDocument();
188
190
  });
189
191
 
190
192
  test('should handle canceling the upload', async () => {
@@ -27,7 +27,7 @@ describe('ProcessingStep', () => {
27
27
  expect(processing).toBeInTheDocument();
28
28
  });
29
29
  });
30
-
30
+
31
31
  test('renders ProcessIndicator with default status', () => {
32
32
  expect(screen.getByText(PROCESSING_STEP_PROPS.psProcessingText)).toBeInTheDocument();
33
33
  });
@@ -66,11 +66,11 @@ describe('uploadImageStep', () => {
66
66
  const errorIconLabel = 'Error icon label';
67
67
  const errorMessage = 'Maximum filesize is 2MB.';
68
68
  const { container } = render(
69
- <UploadImageStep
70
- {...UPLOADIMAGE_STEP_PROPS}
69
+ <UploadImageStep
70
+ {...UPLOADIMAGE_STEP_PROPS}
71
71
  errorMessage={errorMessage}
72
- errorIconLabel={errorIconLabel}
73
- />
72
+ errorIconLabel={errorIconLabel}
73
+ />,
74
74
  );
75
75
 
76
76
  expect(screen.getByLabelText(errorIconLabel)).toBeInTheDocument();