@transferwise/components 46.159.0 → 46.159.2

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 (190) hide show
  1. package/build/i18n/cs.json +5 -0
  2. package/build/i18n/cs.json.js +5 -0
  3. package/build/i18n/cs.json.js.map +1 -1
  4. package/build/i18n/cs.json.mjs +5 -0
  5. package/build/i18n/cs.json.mjs.map +1 -1
  6. package/build/i18n/de.json +5 -0
  7. package/build/i18n/de.json.js +5 -0
  8. package/build/i18n/de.json.js.map +1 -1
  9. package/build/i18n/de.json.mjs +5 -0
  10. package/build/i18n/de.json.mjs.map +1 -1
  11. package/build/i18n/es.json +5 -0
  12. package/build/i18n/es.json.js +5 -0
  13. package/build/i18n/es.json.js.map +1 -1
  14. package/build/i18n/es.json.mjs +5 -0
  15. package/build/i18n/es.json.mjs.map +1 -1
  16. package/build/i18n/fr.json +5 -0
  17. package/build/i18n/fr.json.js +5 -0
  18. package/build/i18n/fr.json.js.map +1 -1
  19. package/build/i18n/fr.json.mjs +5 -0
  20. package/build/i18n/fr.json.mjs.map +1 -1
  21. package/build/i18n/hu.json +5 -0
  22. package/build/i18n/hu.json.js +5 -0
  23. package/build/i18n/hu.json.js.map +1 -1
  24. package/build/i18n/hu.json.mjs +5 -0
  25. package/build/i18n/hu.json.mjs.map +1 -1
  26. package/build/i18n/id.json +5 -0
  27. package/build/i18n/id.json.js +5 -0
  28. package/build/i18n/id.json.js.map +1 -1
  29. package/build/i18n/id.json.mjs +5 -0
  30. package/build/i18n/id.json.mjs.map +1 -1
  31. package/build/i18n/it.json +5 -0
  32. package/build/i18n/it.json.js +5 -0
  33. package/build/i18n/it.json.js.map +1 -1
  34. package/build/i18n/it.json.mjs +5 -0
  35. package/build/i18n/it.json.mjs.map +1 -1
  36. package/build/i18n/ja.json +5 -0
  37. package/build/i18n/ja.json.js +5 -0
  38. package/build/i18n/ja.json.js.map +1 -1
  39. package/build/i18n/ja.json.mjs +5 -0
  40. package/build/i18n/ja.json.mjs.map +1 -1
  41. package/build/i18n/nl.json +5 -0
  42. package/build/i18n/nl.json.js +5 -0
  43. package/build/i18n/nl.json.js.map +1 -1
  44. package/build/i18n/nl.json.mjs +5 -0
  45. package/build/i18n/nl.json.mjs.map +1 -1
  46. package/build/i18n/pl.json +5 -0
  47. package/build/i18n/pl.json.js +5 -0
  48. package/build/i18n/pl.json.js.map +1 -1
  49. package/build/i18n/pl.json.mjs +5 -0
  50. package/build/i18n/pl.json.mjs.map +1 -1
  51. package/build/i18n/pt.json +5 -0
  52. package/build/i18n/pt.json.js +5 -0
  53. package/build/i18n/pt.json.js.map +1 -1
  54. package/build/i18n/pt.json.mjs +5 -0
  55. package/build/i18n/pt.json.mjs.map +1 -1
  56. package/build/i18n/ro.json +5 -0
  57. package/build/i18n/ro.json.js +5 -0
  58. package/build/i18n/ro.json.js.map +1 -1
  59. package/build/i18n/ro.json.mjs +5 -0
  60. package/build/i18n/ro.json.mjs.map +1 -1
  61. package/build/i18n/ru.json +5 -0
  62. package/build/i18n/ru.json.js +5 -0
  63. package/build/i18n/ru.json.js.map +1 -1
  64. package/build/i18n/ru.json.mjs +5 -0
  65. package/build/i18n/ru.json.mjs.map +1 -1
  66. package/build/i18n/th.json +5 -0
  67. package/build/i18n/th.json.js +5 -0
  68. package/build/i18n/th.json.js.map +1 -1
  69. package/build/i18n/th.json.mjs +5 -0
  70. package/build/i18n/th.json.mjs.map +1 -1
  71. package/build/i18n/uk.json +5 -0
  72. package/build/i18n/uk.json.js +5 -0
  73. package/build/i18n/uk.json.js.map +1 -1
  74. package/build/i18n/uk.json.mjs +5 -0
  75. package/build/i18n/uk.json.mjs.map +1 -1
  76. package/build/i18n/zh-HK.json +5 -0
  77. package/build/i18n/zh-HK.json.js +5 -0
  78. package/build/i18n/zh-HK.json.js.map +1 -1
  79. package/build/i18n/zh-HK.json.mjs +5 -0
  80. package/build/i18n/zh-HK.json.mjs.map +1 -1
  81. package/build/main.css +4 -4104
  82. package/build/styles/ListItem/ListItem.css +1 -0
  83. package/build/styles/PocketSurface/PocketSurface.css +2 -11
  84. package/build/styles/SentimentSurface/SentimentSurface.css +0 -23
  85. package/build/styles/css/neptune-addons.css +1841 -0
  86. package/build/styles/css/neptune-core.css +2092 -0
  87. package/build/styles/css/neptune.css +0 -2821
  88. package/build/styles/main.css +4 -4104
  89. package/build/styles/styles/less/neptune-addons.css +1841 -0
  90. package/build/styles/styles/less/neptune-core.css +2092 -0
  91. package/build/styles/styles/less/neptune.css +0 -2821
  92. package/build/types/ListItem/_stories/variants/helpers.d.ts.map +1 -1
  93. package/package.json +10 -10
  94. package/src/Accordion/_stories/Accordion.test.story.tsx +71 -0
  95. package/src/AvatarLayout/_stories/AvatarLayout.test.story.tsx +64 -0
  96. package/src/AvatarView/_stories/AvatarView.test.story.tsx +151 -0
  97. package/src/Button/LegacyButton/_stories/LegacyButton.test.story.tsx +22 -0
  98. package/src/Button/_stories/Button.test.story.tsx +65 -0
  99. package/src/Calendar/_stories/Calendar.test.story.tsx +73 -24
  100. package/src/Carousel/_stories/Carousel.test.story.tsx +59 -0
  101. package/src/Checkbox/_stories/Checkbox.test.story.tsx +20 -0
  102. package/src/CheckboxButton/_stories/CheckboxButton.test.story.tsx +17 -37
  103. package/src/Chevron/_stories/Chevron.test.story.tsx +26 -0
  104. package/src/Chips/_stories/Chips.test.story.tsx +39 -34
  105. package/src/CircularButton/_stories/CircularButton.test.story.tsx +0 -68
  106. package/src/DateInput/_stories/DateInput.test.story.tsx +13 -0
  107. package/src/DateLookup/_stories/DateLookup.rtl.test.story.tsx +88 -0
  108. package/src/Decision/_stories/Decision.test.story.tsx +79 -0
  109. package/src/DefinitionList/_stories/DefinitionList.test.story.tsx +54 -1
  110. package/src/Drawer/_stories/Drawer.rtl.test.story.tsx +58 -0
  111. package/src/ExpressiveMoneyInput/_stories/ExpressiveMoneyInput.rtl.test.story.tsx +118 -0
  112. package/src/Field/_stories/Field.test.story.tsx +46 -0
  113. package/src/FlowNavigation/AnimatedLabel/AnimatedLabel.less +0 -1
  114. package/src/FlowNavigation/_stories/FlowNavigation.test.story.tsx +44 -0
  115. package/src/Header/_stories/Header.test.story.tsx +27 -0
  116. package/src/Info/_stories/Info.rtl.test.story.tsx +64 -0
  117. package/src/Inputs/SelectInput/_stories/SelectInput.rtl.test.story.tsx +135 -0
  118. package/src/Inputs/_stories/InputGroup.test.story.tsx +69 -0
  119. package/src/Inputs/_stories/SearchInput.test.story.tsx +32 -0
  120. package/src/Inputs/_stories/TextArea.test.story.tsx +27 -0
  121. package/src/InstructionsList/_stories/InstructionsList.test.story.tsx +30 -0
  122. package/src/Label/_stories/Label.test.story.tsx +36 -0
  123. package/src/Link/_stories/Link.test.story.tsx +26 -0
  124. package/src/ListItem/ListItem.css +1 -0
  125. package/src/ListItem/_stories/{variants/ListItem.rtl.test.story.tsx → ListItem.rtl.test.story.tsx} +6 -10
  126. package/src/ListItem/_stories/variants/helpers.tsx +2 -6
  127. package/src/Logo/_stories/Logo.test.story.tsx +44 -0
  128. package/src/Modal/_stories/Modal.rtl.test.story.tsx +59 -0
  129. package/src/MoneyInput/_stories/MoneyInput.rtl.test.story.tsx +88 -0
  130. package/src/Nudge/_stories/Nudge.test.story.tsx +37 -0
  131. package/src/PhoneNumberInput/_stories/PhoneNumberInput.test.story.tsx +44 -0
  132. package/src/PocketSurface/PocketSurface.css +2 -11
  133. package/src/PocketSurface/PocketSurface.less +1 -1
  134. package/src/Popover/_stories/Popover.rtl.test.story.tsx +96 -0
  135. package/src/Progress/_stories/Progress.test.story.tsx +27 -0
  136. package/src/ProgressBar/_stories/ProgressBar.test.story.tsx +33 -0
  137. package/src/PromoCard/_stories/PromoCard.test.story.tsx +42 -0
  138. package/src/PromoCard/_stories/PromoCardGroup.test.story.tsx +51 -0
  139. package/src/Prompt/ActionPrompt/_stories/ActionPrompt.test.story.tsx +42 -1
  140. package/src/Prompt/CriticalBanner/_stories/CriticalBanner.test.story.tsx +34 -31
  141. package/src/Prompt/InfoPrompt/_stories/InfoPrompt.test.story.tsx +25 -0
  142. package/src/Prompt/InlinePrompt/_stories/InlinePrompt.test.story.tsx +27 -0
  143. package/src/Radio/_stories/Radio.test.story.tsx +61 -0
  144. package/src/RadioGroup/_stories/RadioGroup.test.story.tsx +56 -0
  145. package/src/Section/_stories/Section.test.story.tsx +29 -0
  146. package/src/SegmentedControl/_stories/SegmentedControl.test.story.tsx +45 -0
  147. package/src/SentimentSurface/SentimentSurface.css +0 -23
  148. package/src/SlidingPanel/_stories/SlidingPanel.rtl.test.story.tsx +70 -0
  149. package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +45 -0
  150. package/src/Snackbar/_stories/Snackbar.test.story.tsx +0 -31
  151. package/src/Stepper/_stories/Stepper.test.story.tsx +17 -0
  152. package/src/Switch/_stories/Switch.test.story.tsx +20 -26
  153. package/src/Table/_stories/Table.test.story.tsx +104 -0
  154. package/src/Tabs/_stories/Tabs.test.story.tsx +72 -0
  155. package/src/TextareaWithDisplayFormat/_stories/TextareaWithDisplayFormat.test.story.tsx +48 -0
  156. package/src/Tooltip/_stories/Tooltip.rtl.test.story.tsx +79 -0
  157. package/src/Typeahead/_stories/Typeahead.rtl.test.story.tsx +90 -0
  158. package/src/Upload/_stories/Upload.rtl.test.story.tsx +53 -0
  159. package/src/UploadInput/_stories/UploadInput.test.story.tsx +47 -0
  160. package/src/_deprecated/Alert/_stories/Alert.test.story.tsx +28 -1
  161. package/src/_deprecated/Card/_stories/Card.test.story.tsx +38 -0
  162. package/src/_deprecated/CriticalBanner/_stories/CriticalCommsBanner.test.story.tsx +18 -0
  163. package/src/_deprecated/InlineAlert/_stories/InlineAlert.test.story.tsx +26 -0
  164. package/src/_deprecated/OverlayHeader/_stories/OverlayHeader.test.story.tsx +42 -0
  165. package/src/_deprecated/Select/_stories/Select.rtl.test.story.tsx +71 -0
  166. package/src/common/BottomSheet/_stories/BottomSheet.test.story.tsx +23 -0
  167. package/src/i18n/cs.json +5 -0
  168. package/src/i18n/de.json +5 -0
  169. package/src/i18n/es.json +5 -0
  170. package/src/i18n/fr.json +5 -0
  171. package/src/i18n/hu.json +5 -0
  172. package/src/i18n/id.json +5 -0
  173. package/src/i18n/it.json +5 -0
  174. package/src/i18n/ja.json +5 -0
  175. package/src/i18n/nl.json +5 -0
  176. package/src/i18n/pl.json +5 -0
  177. package/src/i18n/pt.json +5 -0
  178. package/src/i18n/ro.json +5 -0
  179. package/src/i18n/ru.json +5 -0
  180. package/src/i18n/th.json +5 -0
  181. package/src/i18n/uk.json +5 -0
  182. package/src/i18n/zh-HK.json +5 -0
  183. package/src/main.css +4 -4104
  184. package/src/styles/less/alerts.less +1 -2
  185. package/src/styles/less/neptune-addons.css +1841 -0
  186. package/src/styles/less/neptune-addons.less +4 -0
  187. package/src/styles/less/neptune-core.css +2092 -0
  188. package/src/styles/less/neptune-core.less +4 -0
  189. package/src/styles/less/neptune.bundle.less +11 -11
  190. package/src/styles/less/neptune.css +0 -2821
@@ -0,0 +1,26 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
3
+ import Link from '..';
4
+
5
+ export default {
6
+ component: Link,
7
+ title: 'Typography/Link/Tests',
8
+ tags: ['!autodocs', '!manifest'],
9
+ } satisfies Meta<typeof Link>;
10
+
11
+ type Story = StoryObj<typeof Link>;
12
+
13
+ export const RTLDiff: Story = {
14
+ render: () => (
15
+ <>
16
+ <Link href="#" target="_blank">
17
+ External link with navigate-away icon
18
+ </Link>
19
+ <br />
20
+ <Link href="#" target="_blank" type="link-large">
21
+ Large external link with navigate-away icon
22
+ </Link>
23
+ </>
24
+ ),
25
+ ...withRTLDiff(),
26
+ };
@@ -619,6 +619,7 @@
619
619
  .wds-list-item-spotlight-inactive {
620
620
  background-color: rgba(134, 167, 189, 0.025);
621
621
  }
622
+
622
623
  @supports (color: color-mix(in lch, red, blue)) {
623
624
  .wds-list-item-spotlight-inactive {
624
625
  background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
@@ -1,22 +1,18 @@
1
1
  import { Meta } from '@storybook/react-webpack5';
2
- import { ListItem, type ListItemProps } from '../../ListItem';
3
- import { VariantStory } from './helpers';
4
- import { withVariantConfig } from '../../../../.storybook/helpers';
2
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
3
+ import { ListItem, type ListItemProps } from '../ListItem';
4
+ import { VariantStory } from './variants/helpers';
5
5
 
6
6
  export default {
7
7
  component: ListItem,
8
- title: 'Content/ListItem/Tests/variants/rtl',
8
+ title: 'Content/ListItem/Tests/RTL Diff',
9
9
  tags: ['!autodocs', '!manifest'],
10
- parameters: {
11
- controls: { disable: true },
12
- actions: { disable: true },
13
- knobs: { disable: true },
14
- },
10
+ ...withRTLDiff({ width: 'stretch' }),
15
11
  } satisfies Meta<ListItemProps>;
16
12
 
17
13
  const Default = {
18
14
  ...VariantStory,
19
- ...withVariantConfig(['rtl'], VariantStory),
15
+ parameters: { variants: [] },
20
16
  args: { variant: 'rtl' },
21
17
  };
22
18
 
@@ -141,12 +141,8 @@ export const VariantStory: VariantStory = {
141
141
 
142
142
  return (
143
143
  <List>
144
- {instances.map((instance) => (
145
- <ListItem
146
- key={`${variant}-${controlType}-${JSON.stringify(instance)}`}
147
- control={control}
148
- {...instance}
149
- />
144
+ {instances.map((instance, index) => (
145
+ <ListItem key={`${variant}-${controlType}-${index}`} control={control} {...instance} />
150
146
  ))}
151
147
  </List>
152
148
  );
@@ -1,5 +1,6 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
 
3
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
3
4
  import Logo, { LogoType } from '..';
4
5
  import { LogoFormat } from '../Logo';
5
6
  import type { LogoSize } from '../Logo';
@@ -93,3 +94,46 @@ export const Sizes = () => (
93
94
  )}
94
95
  </div>
95
96
  );
97
+
98
+ const rtlSizes: LogoSize[] = [16, 20, 24, 36];
99
+
100
+ export const RTLDiff: Story = {
101
+ render: () => (
102
+ <>
103
+ <div
104
+ style={{
105
+ display: 'grid',
106
+ gridTemplateColumns: `repeat(${rtlSizes.length}, min-content)`,
107
+ gap: '1rem',
108
+ alignItems: 'center',
109
+ }}
110
+ >
111
+ {rtlSizes.map((size) => (
112
+ <Logo key={`compact-${size}`} size={size} display="compact" />
113
+ ))}
114
+ </div>
115
+
116
+ <div
117
+ style={{
118
+ display: 'grid',
119
+ gridTemplateColumns: `repeat(${rtlSizes.length}, min-content)`,
120
+ gap: '1rem',
121
+ alignItems: 'center',
122
+ }}
123
+ >
124
+ {rtlSizes.map((size) => (
125
+ <Logo key={`full-${size}`} size={size} display="full" />
126
+ ))}
127
+ </div>
128
+
129
+ {Object.values(LogoType).map((type) => (
130
+ <Logo key={`primary-${type}`} type={type} format="primary-lockup" display="full" />
131
+ ))}
132
+
133
+ {Object.values(LogoType).map((type) => (
134
+ <Logo key={`secondary-${type}`} type={type} format="secondary-lockup" display="full" />
135
+ ))}
136
+ </>
137
+ ),
138
+ ...withRTLDiff(),
139
+ };
@@ -0,0 +1,59 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+
3
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
4
+ import { Button, Modal } from '../..';
5
+
6
+ export default {
7
+ component: Modal,
8
+ title: 'Dialogs/Modal/Tests/RTL Diff',
9
+ tags: ['!autodocs', '!manifest'],
10
+ } satisfies Meta<typeof Modal>;
11
+
12
+ type Story = StoryObj<typeof Modal>;
13
+
14
+ const iframeDiff = withRTLDiff({ renderAs: 'iframe' });
15
+
16
+ export const WithTitleAndFooter: Story = {
17
+ render: () => (
18
+ <Modal
19
+ open
20
+ title="Modal title"
21
+ body="Body content for the modal dialog."
22
+ footer={
23
+ <Button v2 block>
24
+ Confirm
25
+ </Button>
26
+ }
27
+ onClose={() => {}}
28
+ />
29
+ ),
30
+ ...iframeDiff,
31
+ };
32
+
33
+ export const WithoutFooter: Story = {
34
+ render: () => (
35
+ <Modal
36
+ open
37
+ title="Modal without footer"
38
+ body="Body content without a footer."
39
+ onClose={() => {}}
40
+ />
41
+ ),
42
+ ...iframeDiff,
43
+ };
44
+
45
+ export const WithoutTitle: Story = {
46
+ render: () => (
47
+ <Modal
48
+ open
49
+ body="Body content without a title."
50
+ footer={
51
+ <Button v2 block>
52
+ Done
53
+ </Button>
54
+ }
55
+ onClose={() => {}}
56
+ />
57
+ ),
58
+ ...iframeDiff,
59
+ };
@@ -0,0 +1,88 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { userEvent, within } from 'storybook/test';
3
+
4
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
5
+ import Field from '../../Field/Field';
6
+ import MoneyInput from '..';
7
+
8
+ export default {
9
+ component: MoneyInput,
10
+ title: 'Forms/MoneyInput/Tests/RTL Diff',
11
+ tags: ['!autodocs', '!manifest'],
12
+ } satisfies Meta<typeof MoneyInput>;
13
+
14
+ type Story = StoryObj<typeof MoneyInput>;
15
+
16
+ const eurCurrency = {
17
+ value: 'EUR',
18
+ label: 'EUR',
19
+ note: 'Euro',
20
+ currency: 'eur',
21
+ } as const;
22
+
23
+ const gbpCurrency = {
24
+ value: 'GBP',
25
+ label: 'GBP',
26
+ note: 'British pound',
27
+ currency: 'gbp',
28
+ } as const;
29
+
30
+ const multipleCurrencies = [eurCurrency, gbpCurrency] as const;
31
+
32
+ const sharedProps = {
33
+ amount: 1000,
34
+ id: 'money-input',
35
+ onAmountChange: () => {},
36
+ onCurrencyChange: () => {},
37
+ } as const;
38
+
39
+ export const TriggerVariants: Story = {
40
+ render: () => (
41
+ <>
42
+ <Field label="Single currency — large (flag + code)">
43
+ <MoneyInput {...sharedProps} size="lg" currencies={[]} selectedCurrency={eurCurrency} />
44
+ </Field>
45
+ <Field label="Single currency — medium (flag + code)">
46
+ <MoneyInput {...sharedProps} size="md" currencies={[]} selectedCurrency={eurCurrency} />
47
+ </Field>
48
+ <Field label="Single currency — small (code only)">
49
+ <MoneyInput {...sharedProps} size="sm" currencies={[]} selectedCurrency={eurCurrency} />
50
+ </Field>
51
+ <Field label="Multiple currencies — large (select trigger with flag)">
52
+ <MoneyInput
53
+ {...sharedProps}
54
+ size="lg"
55
+ currencies={multipleCurrencies}
56
+ selectedCurrency={eurCurrency}
57
+ />
58
+ </Field>
59
+ <Field label="Multiple currencies — small (select trigger without flag)">
60
+ <MoneyInput
61
+ {...sharedProps}
62
+ size="sm"
63
+ currencies={multipleCurrencies}
64
+ selectedCurrency={eurCurrency}
65
+ />
66
+ </Field>
67
+ </>
68
+ ),
69
+ ...withRTLDiff(),
70
+ };
71
+
72
+ export const OpenDropdown: Story = {
73
+ render: () => (
74
+ <MoneyInput
75
+ {...sharedProps}
76
+ size="lg"
77
+ currencies={multipleCurrencies}
78
+ selectedCurrency={eurCurrency}
79
+ />
80
+ ),
81
+ play: async ({ canvasElement }) => {
82
+ const canvas = within(canvasElement);
83
+ const trigger = canvas.queryByRole('combobox');
84
+ if (!trigger) return;
85
+ await userEvent.click(trigger);
86
+ },
87
+ ...withRTLDiff({ renderAs: 'iframe', width: '80%' }),
88
+ };
@@ -0,0 +1,37 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
3
+ import Nudge from '../Nudge';
4
+
5
+ export default {
6
+ component: Nudge,
7
+ title: 'Prompts/Nudge/Tests',
8
+ tags: ['!autodocs', '!manifest'],
9
+ } satisfies Meta<typeof Nudge>;
10
+
11
+ type Story = StoryObj<typeof Nudge>;
12
+
13
+ export const RTLDiff: Story = {
14
+ render: () => (
15
+ <>
16
+ <Nudge
17
+ mediaName="globe"
18
+ title="With media and dismiss"
19
+ link="Link"
20
+ href="#"
21
+ onDismiss={() => {}}
22
+ />
23
+ <div style={{ marginTop: 16 }} />
24
+ <Nudge
25
+ mediaName="globe"
26
+ title="With media, action, and dismiss"
27
+ action={{ text: 'Learn more', href: '#' }}
28
+ onDismiss={() => {}}
29
+ />
30
+ <div style={{ marginTop: 16 }} />
31
+ <Nudge title="Without media, with dismiss" link="Link" href="#" onDismiss={() => {}} />
32
+ <div style={{ marginTop: 16 }} />
33
+ <Nudge title="Without media, no dismiss" link="Link" href="#" />
34
+ </>
35
+ ),
36
+ ...withRTLDiff(),
37
+ };
@@ -0,0 +1,44 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+
3
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
4
+ import Field from '../../Field/Field';
5
+ import PhoneNumberInput from '..';
6
+
7
+ export default {
8
+ component: PhoneNumberInput,
9
+ title: 'Forms/PhoneNumberInput/Tests',
10
+ tags: ['!autodocs', '!manifest'],
11
+ } satisfies Meta<typeof PhoneNumberInput>;
12
+
13
+ type Story = StoryObj<typeof PhoneNumberInput>;
14
+
15
+ /**
16
+ * The country code selector sits on the inline-start side of the phone number input.
17
+ * In RTL the two elements should swap sides — the selector moves to the right and
18
+ * the text field moves to the left. This diff verifies the flex row reverses correctly.
19
+ *
20
+ * Size variants are included because the size prop changes the input-group class and
21
+ * may affect spacing between the two sub-inputs.
22
+ */
23
+ export const RTLDiff: Story = {
24
+ render: () => (
25
+ <>
26
+ <Field label="Default (md)">
27
+ <PhoneNumberInput onChange={() => {}} />
28
+ </Field>
29
+
30
+ <Field label="Small (sm)">
31
+ <PhoneNumberInput size="sm" onChange={() => {}} />
32
+ </Field>
33
+
34
+ <Field label="Large (lg)">
35
+ <PhoneNumberInput size="lg" onChange={() => {}} />
36
+ </Field>
37
+
38
+ <Field label="With initial value">
39
+ <PhoneNumberInput initialValue="+447573135343" onChange={() => {}} />
40
+ </Field>
41
+ </>
42
+ ),
43
+ ...withRTLDiff(),
44
+ };
@@ -21,7 +21,6 @@
21
21
  --color-background-screen: #a0e1e1;
22
22
  }
23
23
 
24
-
25
24
  .wds-pocket-bright-orange {
26
25
  --color-content-primary: #260a2f;
27
26
  --color-content-secondary: #110415;
@@ -40,7 +39,6 @@
40
39
  --color-background-screen: #ffc091;
41
40
  }
42
41
 
43
-
44
42
  .wds-pocket-bright-pink {
45
43
  --color-content-primary: #320707;
46
44
  --color-content-secondary: #160303;
@@ -59,7 +57,6 @@
59
57
  --color-background-screen: #ffd7ef;
60
58
  }
61
59
 
62
-
63
60
  .wds-pocket-bright-yellow {
64
61
  --color-content-primary: #3a341c;
65
62
  --color-content-secondary: #110f08;
@@ -78,7 +75,6 @@
78
75
  --color-background-screen: #ffeb69;
79
76
  }
80
77
 
81
-
82
78
  .wds-pocket-dark-charcoal {
83
79
  --color-content-primary: #a0e1e1;
84
80
  --color-content-secondary: #ecf9f9;
@@ -97,7 +93,6 @@
97
93
  --color-background-screen: #21231d;
98
94
  }
99
95
 
100
-
101
96
  .wds-pocket-dark-gold {
102
97
  --color-content-primary: #ffeb69;
103
98
  --color-content-secondary: #fffce5;
@@ -116,7 +111,6 @@
116
111
  --color-background-screen: #3a341c;
117
112
  }
118
113
 
119
-
120
114
  .wds-pocket-dark-maroon {
121
115
  --color-content-primary: #ffd7ef;
122
116
  --color-content-secondary: #ffe5f5;
@@ -135,7 +129,6 @@
135
129
  --color-background-screen: #320707;
136
130
  }
137
131
 
138
-
139
132
  .wds-pocket-dark-purple {
140
133
  --color-content-primary: #ffc091;
141
134
  --color-content-secondary: #fff0e5;
@@ -153,11 +146,9 @@
153
146
  --color-interactive-control-active: #471358;
154
147
  --color-background-screen: #260a2f;
155
148
  }
156
-
157
-
158
149
  .wds-pocket-surface {
159
150
  background-color: #ffffff;
160
151
  background-color: var(--color-background-screen);
161
- color: #37517e;
162
- color: var(--color-content-primary);
152
+ color: #5d7079;
153
+ color: var(--color-content-secondary);
163
154
  }
@@ -2,5 +2,5 @@
2
2
 
3
3
  .wds-pocket-surface {
4
4
  background-color: var(--color-background-screen);
5
- color: var(--color-content-primary);
5
+ color: var(--color-content-secondary);
6
6
  }
@@ -0,0 +1,96 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { userEvent, within } from 'storybook/test';
3
+
4
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
5
+ import Button from '../../Button';
6
+ import { Position } from '../../common';
7
+ import Popover from '..';
8
+
9
+ export default {
10
+ component: Popover,
11
+ title: 'Dialogs/Popover/Tests/RTL Diff',
12
+ tags: ['!autodocs', '!manifest'],
13
+ } satisfies Meta<typeof Popover>;
14
+
15
+ type Story = StoryObj<typeof Popover>;
16
+
17
+ const iframeDiff = withRTLDiff({ renderAs: 'iframe' });
18
+
19
+ const containerStyle: React.CSSProperties = {
20
+ display: 'flex',
21
+ justifyContent: 'center',
22
+ alignItems: 'center',
23
+ minHeight: '24rem',
24
+ width: '100%',
25
+ };
26
+
27
+ const clickTrigger = async ({ canvasElement }: { canvasElement: HTMLElement }) => {
28
+ const canvas = within(canvasElement);
29
+ const trigger = canvas.queryByRole('button');
30
+ if (!trigger) return;
31
+ await userEvent.click(trigger);
32
+ };
33
+
34
+ export const PlacementRight: Story = {
35
+ render: () => (
36
+ <div style={containerStyle}>
37
+ <Popover
38
+ preferredPlacement={Position.RIGHT}
39
+ title="Guaranteed rate"
40
+ content="You'll get this rate as long as we receive your 10 EUR within the next 51 hours."
41
+ >
42
+ <Button v2>Placement right</Button>
43
+ </Popover>
44
+ </div>
45
+ ),
46
+ play: clickTrigger,
47
+ ...iframeDiff,
48
+ };
49
+
50
+ export const PlacementLeft: Story = {
51
+ render: () => (
52
+ <div style={containerStyle}>
53
+ <Popover
54
+ preferredPlacement={Position.LEFT}
55
+ title="Guaranteed rate"
56
+ content="You'll get this rate as long as we receive your 10 EUR within the next 51 hours."
57
+ >
58
+ <Button v2>Placement left</Button>
59
+ </Popover>
60
+ </div>
61
+ ),
62
+ play: clickTrigger,
63
+ ...iframeDiff,
64
+ };
65
+
66
+ export const PlacementTop: Story = {
67
+ render: () => (
68
+ <div style={containerStyle}>
69
+ <Popover
70
+ preferredPlacement={Position.TOP}
71
+ title="Guaranteed rate"
72
+ content="You'll get this rate as long as we receive your 10 EUR within the next 51 hours."
73
+ >
74
+ <Button v2>Placement top</Button>
75
+ </Popover>
76
+ </div>
77
+ ),
78
+ play: clickTrigger,
79
+ ...iframeDiff,
80
+ };
81
+
82
+ export const PlacementBottom: Story = {
83
+ render: () => (
84
+ <div style={containerStyle}>
85
+ <Popover
86
+ preferredPlacement={Position.BOTTOM}
87
+ title="Guaranteed rate"
88
+ content="You'll get this rate as long as we receive your 10 EUR within the next 51 hours."
89
+ >
90
+ <Button v2>Placement bottom</Button>
91
+ </Popover>
92
+ </div>
93
+ ),
94
+ play: clickTrigger,
95
+ ...iframeDiff,
96
+ };
@@ -0,0 +1,27 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+
3
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
4
+ import Progress from '..';
5
+
6
+ export default {
7
+ component: Progress,
8
+ title: 'Other/Progress/Tests',
9
+ tags: ['!autodocs', '!manifest'],
10
+ } satisfies Meta<typeof Progress>;
11
+
12
+ type Story = StoryObj<typeof Progress>;
13
+
14
+ /**
15
+ * The native <progress> element fills in the inline direction,
16
+ * so partial progress flips from left-to-right to right-to-left in RTL.
17
+ */
18
+ export const RTLDiff: Story = {
19
+ render: () => (
20
+ <>
21
+ <Progress id="progress-quarter" progress={{ value: 25, max: 100 }} />
22
+ <Progress id="progress-half" progress={{ value: 50, max: 100 }} />
23
+ <Progress id="progress-three-quarters" progress={{ value: 75, max: 100 }} />
24
+ </>
25
+ ),
26
+ ...withRTLDiff(),
27
+ };
@@ -0,0 +1,33 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+
3
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
4
+ import ProgressBar from '..';
5
+
6
+ export default {
7
+ component: ProgressBar,
8
+ title: 'Content/ProgressBar/Tests',
9
+ tags: ['!autodocs', '!manifest'],
10
+ } satisfies Meta<typeof ProgressBar>;
11
+
12
+ type Story = StoryObj<typeof ProgressBar>;
13
+
14
+ export const RTLDiff: Story = {
15
+ render: () => (
16
+ <>
17
+ <ProgressBar
18
+ id="progress-bar-with-description"
19
+ title="Send 5,550 GBP"
20
+ description="You have 3 days to reach your goal."
21
+ progress={{ value: 50, max: 100 }}
22
+ textEnd="200 GBP to go"
23
+ />
24
+ <ProgressBar
25
+ id="progress-bar-without-description"
26
+ title="Total limit"
27
+ progress={{ value: 800, max: 1000 }}
28
+ textEnd="200 GBP remaining"
29
+ />
30
+ </>
31
+ ),
32
+ ...withRTLDiff(),
33
+ };
@@ -0,0 +1,42 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
3
+ import PromoCard from '..';
4
+
5
+ export default {
6
+ component: PromoCard,
7
+ title: 'Layouts/PromoCard/Tests',
8
+ tags: ['!autodocs', '!manifest'],
9
+ } satisfies Meta<typeof PromoCard>;
10
+
11
+ type Story = StoryObj<typeof PromoCard>;
12
+
13
+ export const RTLDiff: Story = {
14
+ render: () => (
15
+ <>
16
+ <PromoCard
17
+ title="Link with arrow"
18
+ description="Indicator arrow icon flips in RTL."
19
+ href="#"
20
+ indicatorLabel="Free"
21
+ imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
22
+ />
23
+ <PromoCard
24
+ title="Checkbox checked"
25
+ description="Check icon positioned at the end."
26
+ type="checkbox"
27
+ defaultChecked
28
+ indicatorLabel="Selected"
29
+ imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
30
+ />
31
+ <PromoCard
32
+ title="Download indicator"
33
+ description="Download icon in the indicator area."
34
+ href="#"
35
+ download="file.pdf"
36
+ indicatorLabel="Download"
37
+ imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
38
+ />
39
+ </>
40
+ ),
41
+ ...withRTLDiff(),
42
+ };