@transferwise/components 46.158.0 → 46.159.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.
Files changed (201) hide show
  1. package/build/FlowNavigation/FlowNavigation.js +5 -14
  2. package/build/FlowNavigation/FlowNavigation.js.map +1 -1
  3. package/build/FlowNavigation/FlowNavigation.mjs +5 -14
  4. package/build/FlowNavigation/FlowNavigation.mjs.map +1 -1
  5. package/build/_deprecated/OverlayHeader/OverlayHeader.js +6 -41
  6. package/build/_deprecated/OverlayHeader/OverlayHeader.js.map +1 -1
  7. package/build/_deprecated/OverlayHeader/OverlayHeader.mjs +6 -41
  8. package/build/_deprecated/OverlayHeader/OverlayHeader.mjs.map +1 -1
  9. package/build/i18n/cs.json +5 -0
  10. package/build/i18n/cs.json.js +5 -0
  11. package/build/i18n/cs.json.js.map +1 -1
  12. package/build/i18n/cs.json.mjs +5 -0
  13. package/build/i18n/cs.json.mjs.map +1 -1
  14. package/build/i18n/de.json +5 -0
  15. package/build/i18n/de.json.js +5 -0
  16. package/build/i18n/de.json.js.map +1 -1
  17. package/build/i18n/de.json.mjs +5 -0
  18. package/build/i18n/de.json.mjs.map +1 -1
  19. package/build/i18n/es.json +5 -0
  20. package/build/i18n/es.json.js +5 -0
  21. package/build/i18n/es.json.js.map +1 -1
  22. package/build/i18n/es.json.mjs +5 -0
  23. package/build/i18n/es.json.mjs.map +1 -1
  24. package/build/i18n/fr.json +5 -0
  25. package/build/i18n/fr.json.js +5 -0
  26. package/build/i18n/fr.json.js.map +1 -1
  27. package/build/i18n/fr.json.mjs +5 -0
  28. package/build/i18n/fr.json.mjs.map +1 -1
  29. package/build/i18n/hu.json +5 -0
  30. package/build/i18n/hu.json.js +5 -0
  31. package/build/i18n/hu.json.js.map +1 -1
  32. package/build/i18n/hu.json.mjs +5 -0
  33. package/build/i18n/hu.json.mjs.map +1 -1
  34. package/build/i18n/id.json +5 -0
  35. package/build/i18n/id.json.js +5 -0
  36. package/build/i18n/id.json.js.map +1 -1
  37. package/build/i18n/id.json.mjs +5 -0
  38. package/build/i18n/id.json.mjs.map +1 -1
  39. package/build/i18n/it.json +5 -0
  40. package/build/i18n/it.json.js +5 -0
  41. package/build/i18n/it.json.js.map +1 -1
  42. package/build/i18n/it.json.mjs +5 -0
  43. package/build/i18n/it.json.mjs.map +1 -1
  44. package/build/i18n/ja.json +5 -0
  45. package/build/i18n/ja.json.js +5 -0
  46. package/build/i18n/ja.json.js.map +1 -1
  47. package/build/i18n/ja.json.mjs +5 -0
  48. package/build/i18n/ja.json.mjs.map +1 -1
  49. package/build/i18n/nl.json +5 -0
  50. package/build/i18n/nl.json.js +5 -0
  51. package/build/i18n/nl.json.js.map +1 -1
  52. package/build/i18n/nl.json.mjs +5 -0
  53. package/build/i18n/nl.json.mjs.map +1 -1
  54. package/build/i18n/pl.json +5 -0
  55. package/build/i18n/pl.json.js +5 -0
  56. package/build/i18n/pl.json.js.map +1 -1
  57. package/build/i18n/pl.json.mjs +5 -0
  58. package/build/i18n/pl.json.mjs.map +1 -1
  59. package/build/i18n/pt.json +5 -0
  60. package/build/i18n/pt.json.js +5 -0
  61. package/build/i18n/pt.json.js.map +1 -1
  62. package/build/i18n/pt.json.mjs +5 -0
  63. package/build/i18n/pt.json.mjs.map +1 -1
  64. package/build/i18n/ro.json +5 -0
  65. package/build/i18n/ro.json.js +5 -0
  66. package/build/i18n/ro.json.js.map +1 -1
  67. package/build/i18n/ro.json.mjs +5 -0
  68. package/build/i18n/ro.json.mjs.map +1 -1
  69. package/build/i18n/ru.json +5 -0
  70. package/build/i18n/ru.json.js +5 -0
  71. package/build/i18n/ru.json.js.map +1 -1
  72. package/build/i18n/ru.json.mjs +5 -0
  73. package/build/i18n/ru.json.mjs.map +1 -1
  74. package/build/i18n/th.json +5 -0
  75. package/build/i18n/th.json.js +5 -0
  76. package/build/i18n/th.json.js.map +1 -1
  77. package/build/i18n/th.json.mjs +5 -0
  78. package/build/i18n/th.json.mjs.map +1 -1
  79. package/build/i18n/uk.json +5 -0
  80. package/build/i18n/uk.json.js +5 -0
  81. package/build/i18n/uk.json.js.map +1 -1
  82. package/build/i18n/uk.json.mjs +5 -0
  83. package/build/i18n/uk.json.mjs.map +1 -1
  84. package/build/i18n/zh-HK.json +5 -0
  85. package/build/i18n/zh-HK.json.js +5 -0
  86. package/build/i18n/zh-HK.json.js.map +1 -1
  87. package/build/i18n/zh-HK.json.mjs +5 -0
  88. package/build/i18n/zh-HK.json.mjs.map +1 -1
  89. package/build/main.css +19 -4145
  90. package/build/styles/FlowNavigation/FlowNavigation.css +7 -13
  91. package/build/styles/ListItem/ListItem.css +1 -0
  92. package/build/styles/PocketSurface/PocketSurface.css +2 -11
  93. package/build/styles/SentimentSurface/SentimentSurface.css +0 -23
  94. package/build/styles/css/neptune.css +0 -2821
  95. package/build/styles/main.css +19 -4145
  96. package/build/styles/styles/less/neptune.css +0 -2821
  97. package/build/types/FlowNavigation/FlowNavigation.d.ts +2 -9
  98. package/build/types/FlowNavigation/FlowNavigation.d.ts.map +1 -1
  99. package/build/types/ListItem/_stories/variants/helpers.d.ts.map +1 -1
  100. package/build/types/_deprecated/OverlayHeader/OverlayHeader.d.ts.map +1 -1
  101. package/package.json +10 -10
  102. package/src/Accordion/_stories/Accordion.test.story.tsx +71 -0
  103. package/src/AvatarLayout/_stories/AvatarLayout.test.story.tsx +64 -0
  104. package/src/AvatarView/_stories/AvatarView.test.story.tsx +151 -0
  105. package/src/Button/LegacyButton/_stories/LegacyButton.test.story.tsx +22 -0
  106. package/src/Button/_stories/Button.test.story.tsx +65 -0
  107. package/src/Calendar/_stories/Calendar.test.story.tsx +73 -24
  108. package/src/Carousel/_stories/Carousel.test.story.tsx +59 -0
  109. package/src/Checkbox/_stories/Checkbox.test.story.tsx +20 -0
  110. package/src/CheckboxButton/_stories/CheckboxButton.test.story.tsx +17 -37
  111. package/src/Chevron/_stories/Chevron.test.story.tsx +26 -0
  112. package/src/Chips/_stories/Chips.test.story.tsx +39 -34
  113. package/src/CircularButton/_stories/CircularButton.test.story.tsx +0 -68
  114. package/src/DateInput/_stories/DateInput.test.story.tsx +13 -0
  115. package/src/DateLookup/_stories/DateLookup.rtl.test.story.tsx +88 -0
  116. package/src/Decision/_stories/Decision.test.story.tsx +79 -0
  117. package/src/DefinitionList/_stories/DefinitionList.test.story.tsx +54 -1
  118. package/src/Drawer/_stories/Drawer.rtl.test.story.tsx +58 -0
  119. package/src/ExpressiveMoneyInput/_stories/ExpressiveMoneyInput.rtl.test.story.tsx +118 -0
  120. package/src/Field/_stories/Field.test.story.tsx +46 -0
  121. package/src/FlowNavigation/FlowNavigation.css +7 -13
  122. package/src/FlowNavigation/FlowNavigation.less +6 -15
  123. package/src/FlowNavigation/FlowNavigation.tsx +6 -27
  124. package/src/FlowNavigation/_stories/FlowNavigation.story.tsx +0 -86
  125. package/src/FlowNavigation/_stories/FlowNavigation.test.story.tsx +44 -0
  126. package/src/Header/_stories/Header.test.story.tsx +27 -0
  127. package/src/Info/_stories/Info.rtl.test.story.tsx +64 -0
  128. package/src/Inputs/SelectInput/_stories/SelectInput.rtl.test.story.tsx +135 -0
  129. package/src/Inputs/_stories/InputGroup.test.story.tsx +69 -0
  130. package/src/Inputs/_stories/SearchInput.test.story.tsx +32 -0
  131. package/src/Inputs/_stories/TextArea.test.story.tsx +27 -0
  132. package/src/InstructionsList/_stories/InstructionsList.test.story.tsx +30 -0
  133. package/src/Label/_stories/Label.test.story.tsx +36 -0
  134. package/src/Link/_stories/Link.test.story.tsx +26 -0
  135. package/src/ListItem/ListItem.css +1 -0
  136. package/src/ListItem/_stories/{variants/ListItem.rtl.test.story.tsx → ListItem.rtl.test.story.tsx} +6 -10
  137. package/src/ListItem/_stories/variants/helpers.tsx +2 -6
  138. package/src/Logo/_stories/Logo.test.story.tsx +44 -0
  139. package/src/Modal/_stories/Modal.rtl.test.story.tsx +59 -0
  140. package/src/MoneyInput/_stories/MoneyInput.rtl.test.story.tsx +88 -0
  141. package/src/Nudge/_stories/Nudge.test.story.tsx +37 -0
  142. package/src/PhoneNumberInput/_stories/PhoneNumberInput.test.story.tsx +44 -0
  143. package/src/PocketSurface/PocketSurface.css +2 -11
  144. package/src/PocketSurface/PocketSurface.less +1 -1
  145. package/src/Popover/_stories/Popover.rtl.test.story.tsx +96 -0
  146. package/src/Progress/_stories/Progress.test.story.tsx +27 -0
  147. package/src/ProgressBar/_stories/ProgressBar.test.story.tsx +33 -0
  148. package/src/PromoCard/_stories/PromoCard.test.story.tsx +42 -0
  149. package/src/PromoCard/_stories/PromoCardGroup.test.story.tsx +51 -0
  150. package/src/Prompt/ActionPrompt/_stories/ActionPrompt.test.story.tsx +42 -1
  151. package/src/Prompt/CriticalBanner/_stories/CriticalBanner.test.story.tsx +34 -31
  152. package/src/Prompt/InfoPrompt/_stories/InfoPrompt.test.story.tsx +25 -0
  153. package/src/Prompt/InlinePrompt/_stories/InlinePrompt.test.story.tsx +27 -0
  154. package/src/Radio/_stories/Radio.test.story.tsx +61 -0
  155. package/src/RadioGroup/_stories/RadioGroup.test.story.tsx +56 -0
  156. package/src/Section/_stories/Section.test.story.tsx +29 -0
  157. package/src/SegmentedControl/_stories/SegmentedControl.test.story.tsx +45 -0
  158. package/src/SentimentSurface/SentimentSurface.css +0 -23
  159. package/src/SlidingPanel/_stories/SlidingPanel.rtl.test.story.tsx +70 -0
  160. package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +45 -0
  161. package/src/Snackbar/_stories/Snackbar.test.story.tsx +0 -31
  162. package/src/Stepper/_stories/Stepper.test.story.tsx +17 -0
  163. package/src/Switch/_stories/Switch.test.story.tsx +20 -26
  164. package/src/Table/_stories/Table.test.story.tsx +104 -0
  165. package/src/Tabs/_stories/Tabs.test.story.tsx +72 -0
  166. package/src/TextareaWithDisplayFormat/_stories/TextareaWithDisplayFormat.test.story.tsx +48 -0
  167. package/src/Tooltip/_stories/Tooltip.rtl.test.story.tsx +79 -0
  168. package/src/Typeahead/_stories/Typeahead.rtl.test.story.tsx +90 -0
  169. package/src/Upload/_stories/Upload.rtl.test.story.tsx +53 -0
  170. package/src/UploadInput/_stories/UploadInput.test.story.tsx +47 -0
  171. package/src/_deprecated/Alert/_stories/Alert.test.story.tsx +28 -1
  172. package/src/_deprecated/Card/_stories/Card.test.story.tsx +38 -0
  173. package/src/_deprecated/CriticalBanner/_stories/CriticalCommsBanner.test.story.tsx +18 -0
  174. package/src/_deprecated/InlineAlert/_stories/InlineAlert.test.story.tsx +26 -0
  175. package/src/_deprecated/OverlayHeader/OverlayHeader.tsx +2 -21
  176. package/src/_deprecated/OverlayHeader/_stories/OverlayHeader.test.story.tsx +42 -0
  177. package/src/_deprecated/Select/_stories/Select.rtl.test.story.tsx +71 -0
  178. package/src/common/BottomSheet/_stories/BottomSheet.test.story.tsx +23 -0
  179. package/src/common/Panel/_stories/Panel.story.tsx +107 -36
  180. package/src/i18n/cs.json +5 -0
  181. package/src/i18n/de.json +5 -0
  182. package/src/i18n/es.json +5 -0
  183. package/src/i18n/fr.json +5 -0
  184. package/src/i18n/hu.json +5 -0
  185. package/src/i18n/id.json +5 -0
  186. package/src/i18n/it.json +5 -0
  187. package/src/i18n/ja.json +5 -0
  188. package/src/i18n/nl.json +5 -0
  189. package/src/i18n/pl.json +5 -0
  190. package/src/i18n/pt.json +5 -0
  191. package/src/i18n/ro.json +5 -0
  192. package/src/i18n/ru.json +5 -0
  193. package/src/i18n/th.json +5 -0
  194. package/src/i18n/uk.json +5 -0
  195. package/src/i18n/zh-HK.json +5 -0
  196. package/src/main.css +19 -4145
  197. package/src/main.less +0 -1
  198. package/src/styles/less/neptune.css +0 -2821
  199. package/build/styles/_deprecated/OverlayHeader/OverlayHeader.css +0 -15
  200. package/src/_deprecated/OverlayHeader/OverlayHeader.css +0 -15
  201. package/src/_deprecated/OverlayHeader/OverlayHeader.less +0 -24
@@ -2,6 +2,9 @@ import RadioGroup, { RadioGroupProps } from '../RadioGroup';
2
2
  import Field from '../../Field/Field';
3
3
  import { Meta, StoryObj } from '@storybook/react-webpack5';
4
4
  import { fn } from 'storybook/test';
5
+ import { Flag } from '@wise/art';
6
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
7
+ import AvatarView from '../../AvatarView';
5
8
 
6
9
  const meta = {
7
10
  component: RadioGroup,
@@ -60,3 +63,56 @@ export const FieldsWithoutPrompt = {
60
63
  );
61
64
  },
62
65
  } satisfies Story;
66
+
67
+ export const RTLDiff: Story<string> = {
68
+ render: () => (
69
+ <>
70
+ <RadioGroup
71
+ name="radio-group-rtl-basic"
72
+ selectedValue="option-1"
73
+ radios={[
74
+ { value: 'option-1', label: 'Option one' },
75
+ { value: 'option-2', label: 'Option two' },
76
+ { value: 'option-3', label: 'Option three' },
77
+ ]}
78
+ onChange={() => {}}
79
+ />
80
+ <RadioGroup
81
+ name="radio-group-rtl-secondary"
82
+ selectedValue="option-a"
83
+ radios={[
84
+ { value: 'option-a', label: 'Option A', secondary: 'Secondary text for A' },
85
+ { value: 'option-b', label: 'Option B', secondary: 'Secondary text for B' },
86
+ ]}
87
+ onChange={() => {}}
88
+ />
89
+ <RadioGroup
90
+ name="radio-group-rtl-avatar"
91
+ selectedValue="option-x"
92
+ radios={[
93
+ {
94
+ value: 'option-x',
95
+ label: 'Option X',
96
+ avatar: (
97
+ <AvatarView size={40}>
98
+ <Flag code="IM" />
99
+ </AvatarView>
100
+ ),
101
+ },
102
+ {
103
+ value: 'option-y',
104
+ label: 'Option Y',
105
+ secondary: 'With secondary and avatar',
106
+ avatar: (
107
+ <AvatarView size={40}>
108
+ <Flag code="IM" />
109
+ </AvatarView>
110
+ ),
111
+ },
112
+ ]}
113
+ onChange={() => {}}
114
+ />
115
+ </>
116
+ ),
117
+ ...withRTLDiff(),
118
+ };
@@ -0,0 +1,29 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+
3
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
4
+ import Header from '../../Header';
5
+ import Section from '..';
6
+
7
+ export default {
8
+ component: Section,
9
+ title: 'Content/Section/Tests',
10
+ tags: ['!autodocs', '!manifest'],
11
+ } satisfies Meta<typeof Section>;
12
+
13
+ type Story = StoryObj<typeof Section>;
14
+
15
+ export const RTLDiff: Story = {
16
+ render: () => (
17
+ <>
18
+ <Section>
19
+ <Header title="Default section" />
20
+ Section content without horizontal padding.
21
+ </Section>
22
+ <Section withHorizontalPadding>
23
+ <Header title="With horizontal padding" />
24
+ Section content with horizontal padding applied.
25
+ </Section>
26
+ </>
27
+ ),
28
+ ...withRTLDiff(),
29
+ };
@@ -0,0 +1,45 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
3
+ import SegmentedControl from '../SegmentedControl';
4
+
5
+ export default {
6
+ component: SegmentedControl,
7
+ title: 'Forms/SegmentedControl/Tests',
8
+ tags: ['!autodocs', '!manifest'],
9
+ } satisfies Meta<typeof SegmentedControl>;
10
+
11
+ type Story = StoryObj<typeof SegmentedControl>;
12
+
13
+ const inputSegments = [
14
+ { id: 'seg-one', label: 'One', value: 'one' },
15
+ { id: 'seg-two', label: 'Two', value: 'two' },
16
+ { id: 'seg-three', label: 'Three', value: 'three' },
17
+ ] as const;
18
+
19
+ const viewSegments = [
20
+ { id: 'seg-alpha', label: 'Alpha', value: 'alpha', controls: 'panel-alpha' },
21
+ { id: 'seg-beta', label: 'Beta', value: 'beta', controls: 'panel-beta' },
22
+ { id: 'seg-gamma', label: 'Gamma', value: 'gamma', controls: 'panel-gamma' },
23
+ ] as const;
24
+
25
+ export const RTLDiff: Story = {
26
+ render: () => (
27
+ <>
28
+ <SegmentedControl
29
+ name="rtl-input"
30
+ mode="input"
31
+ segments={inputSegments}
32
+ value="one"
33
+ onChange={() => {}}
34
+ />
35
+ <SegmentedControl
36
+ name="rtl-view"
37
+ mode="view"
38
+ segments={viewSegments}
39
+ value="alpha"
40
+ onChange={() => {}}
41
+ />
42
+ </>
43
+ ),
44
+ ...withRTLDiff(),
45
+ };
@@ -25,7 +25,6 @@
25
25
  --color-sentiment-border-overlay: rgba(203,39,47,0.30196);
26
26
  }
27
27
 
28
-
29
28
  .wds-sentiment-negative-light-elevated {
30
29
  --color-sentiment-content-primary: #FFFFFF;
31
30
  --color-sentiment-content-primary-hover: #F5CCCC;
@@ -48,7 +47,6 @@
48
47
  --color-sentiment-border-overlay: rgba(255,255,255,0.30196);
49
48
  }
50
49
 
51
-
52
50
  .wds-sentiment-neutral-light-base {
53
51
  --color-sentiment-content-primary: #454745;
54
52
  --color-sentiment-content-primary-hover: #353635;
@@ -71,7 +69,6 @@
71
69
  --color-sentiment-border-overlay: rgba(69,71,69,0.30196);
72
70
  }
73
71
 
74
-
75
72
  .wds-sentiment-neutral-light-elevated {
76
73
  --color-sentiment-content-primary: #F1F1ED;
77
74
  --color-sentiment-content-primary-hover: #E7E7E1;
@@ -94,7 +91,6 @@
94
91
  --color-sentiment-border-overlay: rgba(241,241,237,0.30196);
95
92
  }
96
93
 
97
-
98
94
  .wds-sentiment-proposition-light-base {
99
95
  --color-sentiment-content-primary: #0E0F0C;
100
96
  --color-sentiment-content-primary-hover: #0A2826;
@@ -117,7 +113,6 @@
117
113
  --color-sentiment-border-overlay: rgba(14,15,12,0.30196);
118
114
  }
119
115
 
120
-
121
116
  .wds-sentiment-proposition-light-elevated {
122
117
  --color-sentiment-content-primary: #FFFFFF;
123
118
  --color-sentiment-content-primary-hover: #EAF9F9;
@@ -140,7 +135,6 @@
140
135
  --color-sentiment-border-overlay: rgba(255,255,255,0.30196);
141
136
  }
142
137
 
143
-
144
138
  .wds-sentiment-success-light-base {
145
139
  --color-sentiment-content-primary: #054D28;
146
140
  --color-sentiment-content-primary-hover: #043A1E;
@@ -163,7 +157,6 @@
163
157
  --color-sentiment-border-overlay: rgba(5,77,40,0.30196);
164
158
  }
165
159
 
166
-
167
160
  .wds-sentiment-success-light-elevated {
168
161
  --color-sentiment-content-primary: #CEF1B8;
169
162
  --color-sentiment-content-primary-hover: #E0FFCC;
@@ -186,7 +179,6 @@
186
179
  --color-sentiment-border-overlay: rgba(206,241,184,0.30196);
187
180
  }
188
181
 
189
-
190
182
  .wds-sentiment-warning-light-base {
191
183
  --color-sentiment-content-primary: #4A3B1C;
192
184
  --color-sentiment-content-primary-hover: #302612;
@@ -209,7 +201,6 @@
209
201
  --color-sentiment-border-overlay: rgba(74,59,28,0.30196);
210
202
  }
211
203
 
212
-
213
204
  .wds-sentiment-warning-light-elevated {
214
205
  --color-sentiment-content-primary: #4A3B1C;
215
206
  --color-sentiment-content-primary-hover: #302612;
@@ -232,7 +223,6 @@
232
223
  --color-sentiment-border-overlay: rgba(74,59,28,0.30196);
233
224
  }
234
225
 
235
-
236
226
  .wds-sentiment-negative-dark-base {
237
227
  --color-sentiment-content-primary: #FFA8AD;
238
228
  --color-sentiment-content-primary-hover: #FFBDC0;
@@ -255,7 +245,6 @@
255
245
  --color-sentiment-border-overlay: rgba(255,168,173,0.30196);
256
246
  }
257
247
 
258
-
259
248
  .wds-sentiment-negative-dark-elevated {
260
249
  --color-sentiment-content-primary: #410B0D;
261
250
  --color-sentiment-content-primary-hover: #641115;
@@ -278,7 +267,6 @@
278
267
  --color-sentiment-border-overlay: rgba(65,11,13,0.30196);
279
268
  }
280
269
 
281
-
282
270
  .wds-sentiment-neutral-dark-base {
283
271
  --color-sentiment-content-primary: #F1F1ED;
284
272
  --color-sentiment-content-primary-hover: #E7E7E1;
@@ -301,7 +289,6 @@
301
289
  --color-sentiment-border-overlay: rgba(241,241,237,0.30196);
302
290
  }
303
291
 
304
-
305
292
  .wds-sentiment-neutral-dark-elevated {
306
293
  --color-sentiment-content-primary: #2A2C29;
307
294
  --color-sentiment-content-primary-hover: #414441;
@@ -324,7 +311,6 @@
324
311
  --color-sentiment-border-overlay: rgba(42,44,41,0.30196);
325
312
  }
326
313
 
327
-
328
314
  .wds-sentiment-proposition-dark-base {
329
315
  --color-sentiment-content-primary: #FFFFFF;
330
316
  --color-sentiment-content-primary-hover: #EAF9F9;
@@ -347,7 +333,6 @@
347
333
  --color-sentiment-border-overlay: rgba(255,255,255,0.30196);
348
334
  }
349
335
 
350
-
351
336
  .wds-sentiment-proposition-dark-elevated {
352
337
  --color-sentiment-content-primary: #0E0F0C;
353
338
  --color-sentiment-content-primary-hover: #0A2826;
@@ -370,7 +355,6 @@
370
355
  --color-sentiment-border-overlay: rgba(14,15,12,0.30196);
371
356
  }
372
357
 
373
-
374
358
  .wds-sentiment-success-dark-base {
375
359
  --color-sentiment-content-primary: #CEF1B8;
376
360
  --color-sentiment-content-primary-hover: #E0FFCC;
@@ -393,7 +377,6 @@
393
377
  --color-sentiment-border-overlay: rgba(206,241,184,0.30196);
394
378
  }
395
379
 
396
-
397
380
  .wds-sentiment-success-dark-elevated {
398
381
  --color-sentiment-content-primary: #252C20;
399
382
  --color-sentiment-content-primary-hover: #323B2B;
@@ -416,7 +399,6 @@
416
399
  --color-sentiment-border-overlay: rgba(37,44,32,0.30196);
417
400
  }
418
401
 
419
-
420
402
  .wds-sentiment-warning-dark-base {
421
403
  --color-sentiment-content-primary: #FADC65;
422
404
  --color-sentiment-content-primary-hover: #F9D648;
@@ -439,7 +421,6 @@
439
421
  --color-sentiment-border-overlay: rgba(250,220,101,0.30196);
440
422
  }
441
423
 
442
-
443
424
  .wds-sentiment-warning-dark-elevated {
444
425
  --color-sentiment-content-primary: #3A3523;
445
426
  --color-sentiment-content-primary-hover: #504930;
@@ -461,13 +442,9 @@
461
442
  --color-sentiment-background-surface-active: #F8CD20;
462
443
  --color-sentiment-border-overlay: rgba(58,53,35,0.30196);
463
444
  }
464
-
465
-
466
445
  .wds-sentiment-surface {
467
446
  --ring-outline-color: var(--color-sentiment-content-primary, var(--color-content-primary));
468
447
  }
469
-
470
-
471
448
  .wds-sentiment-surface--hasBaseStyles {
472
449
  background-color: var(--color-sentiment-background-surface);
473
450
  color: var(--color-sentiment-content-primary);
@@ -0,0 +1,70 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+
3
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
4
+ import SlidingPanel from '../SlidingPanel';
5
+
6
+ export default {
7
+ component: SlidingPanel,
8
+ title: 'Dialogs/SlidingPanel/Tests/RTL Diff',
9
+ tags: ['!autodocs', '!manifest'],
10
+ } satisfies Meta<typeof SlidingPanel>;
11
+
12
+ type Story = StoryObj<typeof SlidingPanel>;
13
+
14
+ const iframeDiff = withRTLDiff({ renderAs: 'iframe' });
15
+
16
+ const containerStyle: React.CSSProperties = {
17
+ position: 'relative',
18
+ width: 300,
19
+ height: 120,
20
+ overflow: 'hidden',
21
+ border: '1px dashed #ccc',
22
+ };
23
+
24
+ const panelContentStyle: React.CSSProperties = {
25
+ padding: '16px',
26
+ };
27
+
28
+ export const PositionLeft: Story = {
29
+ render: () => (
30
+ <div style={containerStyle}>
31
+ <SlidingPanel open position="left">
32
+ <div style={panelContentStyle}>Left panel content</div>
33
+ </SlidingPanel>
34
+ </div>
35
+ ),
36
+ ...iframeDiff,
37
+ };
38
+
39
+ export const PositionRight: Story = {
40
+ render: () => (
41
+ <div style={containerStyle}>
42
+ <SlidingPanel open position="right">
43
+ <div style={panelContentStyle}>Right panel content</div>
44
+ </SlidingPanel>
45
+ </div>
46
+ ),
47
+ ...iframeDiff,
48
+ };
49
+
50
+ export const PositionLeftWithBorder: Story = {
51
+ render: () => (
52
+ <div style={containerStyle}>
53
+ <SlidingPanel open position="left" showSlidingPanelBorder>
54
+ <div style={panelContentStyle}>Left panel with border</div>
55
+ </SlidingPanel>
56
+ </div>
57
+ ),
58
+ ...iframeDiff,
59
+ };
60
+
61
+ export const PositionRightWithBorder: Story = {
62
+ render: () => (
63
+ <div style={containerStyle}>
64
+ <SlidingPanel open position="right" showSlidingPanelBorder>
65
+ <div style={panelContentStyle}>Right panel with border</div>
66
+ </SlidingPanel>
67
+ </div>
68
+ ),
69
+ ...iframeDiff,
70
+ };
@@ -0,0 +1,45 @@
1
+ import { useState } from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
3
+
4
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
5
+ import { Snackbar } from '../Snackbar';
6
+
7
+ export default {
8
+ component: Snackbar,
9
+ title: 'Dialogs/Snackbar/Tests/RTL Diff',
10
+ tags: ['!autodocs', '!manifest'],
11
+ } satisfies Meta<typeof Snackbar>;
12
+
13
+ type Story = StoryObj<typeof Snackbar>;
14
+
15
+ const TIMEOUT = 10_000_000;
16
+ const iframeDiff = withRTLDiff({ renderAs: 'iframe' });
17
+
18
+ function RenderWithAction() {
19
+ const [timestamp] = useState(() => Date.now());
20
+
21
+ return (
22
+ <Snackbar
23
+ text={<span>Transfer completed successfully</span>}
24
+ timestamp={timestamp}
25
+ timeout={TIMEOUT}
26
+ action={{ label: 'View' }}
27
+ />
28
+ );
29
+ }
30
+
31
+ function RenderWithoutAction() {
32
+ const [timestamp] = useState(() => Date.now());
33
+
34
+ return <Snackbar text={<span>Settings saved</span>} timestamp={timestamp} timeout={TIMEOUT} />;
35
+ }
36
+
37
+ export const WithAction: Story = {
38
+ render: () => <RenderWithAction />,
39
+ ...iframeDiff,
40
+ };
41
+
42
+ export const WithoutAction: Story = {
43
+ render: () => <RenderWithoutAction />,
44
+ ...iframeDiff,
45
+ };
@@ -103,37 +103,6 @@ export const DarkMode = {
103
103
  ...withVariantConfig(['dark'], Default),
104
104
  };
105
105
 
106
- const switchToRTL = async (context: { canvasElement: HTMLElement }) => {
107
- await Default.play(context);
108
- // the snackbar is outside the storybook dom so the RTL variant doesn't apply
109
- const body = document.querySelector('div.storybook-container');
110
- if (body) {
111
- body.setAttribute('dir', 'rtl');
112
- }
113
- const snackbar = document.querySelector('div.snackbar');
114
- if (snackbar) {
115
- snackbar.setAttribute('dir', 'rtl');
116
- }
117
- };
118
-
119
- export const RTL = {
120
- ...Default,
121
- args: {
122
- ...Default.args,
123
- },
124
- play: switchToRTL,
125
- ...withVariantConfig(['rtl'], Default),
126
- };
127
-
128
- export const RTLMobile = {
129
- ...Default,
130
- args: {
131
- ...RTL.args,
132
- },
133
- play: switchToRTL,
134
- ...withVariantConfig(['rtl', 'mobile'], Default),
135
- };
136
-
137
106
  export const Zoom400 = {
138
107
  ...Default,
139
108
  args: {
@@ -1,6 +1,7 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import { fn, within, expect, screen } from 'storybook/test';
3
3
  import Stepper from '../Stepper';
4
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
4
5
 
5
6
  const STEPS = [
6
7
  {
@@ -88,3 +89,19 @@ export const ProgressbarWidth: Story = {
88
89
  steps: STEPS,
89
90
  },
90
91
  };
92
+
93
+ const RTL_STEPS = [{ label: 'Amount' }, { label: 'You' }, { label: 'Review' }, { label: 'Pay' }];
94
+
95
+ export const RTLDiff: Story = {
96
+ args: {
97
+ steps: RTL_STEPS,
98
+ },
99
+ render: () => (
100
+ <div style={{ width: '80%', marginLeft: 'auto', marginRight: 'auto' }}>
101
+ <Stepper steps={RTL_STEPS} activeStep={0} />
102
+ <Stepper steps={RTL_STEPS} activeStep={2} />
103
+ <Stepper steps={RTL_STEPS} activeStep={4} />
104
+ </div>
105
+ ),
106
+ ...withRTLDiff(),
107
+ };
@@ -3,6 +3,7 @@ import { expect, userEvent, within } from 'storybook/test';
3
3
  import { useState } from 'react';
4
4
 
5
5
  import { withVariantConfig } from '../../../.storybook/helpers';
6
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
6
7
  import Field from '../../Field/Field';
7
8
  import Switch from '../Switch';
8
9
 
@@ -83,32 +84,6 @@ export const KeyboardInteraction: Story = {
83
84
  },
84
85
  };
85
86
 
86
- /** Switch rendered in RTL mode. */
87
- export const RTL: Story = {
88
- render: function Render() {
89
- const [unchecked, setUnchecked] = useState(false);
90
- const [checked, setChecked] = useState(true);
91
-
92
- return (
93
- <div style={{ display: 'flex', flexDirection: 'column', gap: '16px', padding: '16px' }}>
94
- <Field label="Unchecked">
95
- <Switch checked={unchecked} onClick={() => setUnchecked((v) => !v)} />
96
- </Field>
97
- <Field label="Checked">
98
- <Switch checked={checked} onClick={() => setChecked((v) => !v)} />
99
- </Field>
100
- <Field label="Disabled (off)">
101
- <Switch checked={false} disabled onClick={() => {}} />
102
- </Field>
103
- <Field label="Disabled (on)">
104
- <Switch checked disabled onClick={() => {}} />
105
- </Field>
106
- </div>
107
- );
108
- },
109
- ...withVariantConfig(['rtl']),
110
- };
111
-
112
87
  /** Switch at 400% zoom for accessibility testing. */
113
88
  export const Zoom400: Story = {
114
89
  render: function Render() {
@@ -121,3 +96,22 @@ export const Zoom400: Story = {
121
96
  },
122
97
  ...withVariantConfig(['400%']),
123
98
  };
99
+
100
+ /**
101
+ * The switch thumb translates horizontally: in LTR checked state it moves right,
102
+ * in RTL checked state it moves left (via [dir="rtl"] CSS). This diff verifies
103
+ * the thumb direction flips correctly between writing modes.
104
+ */
105
+ export const RTLDiff: Story = {
106
+ render: () => (
107
+ <>
108
+ <Field label="Unchecked">
109
+ <Switch checked={false} onClick={() => {}} />
110
+ </Field>
111
+ <Field label="Checked">
112
+ <Switch checked onClick={() => {}} />
113
+ </Field>
114
+ </>
115
+ ),
116
+ ...withRTLDiff(),
117
+ };
@@ -0,0 +1,104 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { DirectDebits } from '@transferwise/icons';
3
+
4
+ import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
5
+ import Table from '..';
6
+ import { TableHeaderType } from '../Header/TableHeader';
7
+ import { TableRowType, TableRowClickableType } from '../Row/TableRow';
8
+
9
+ const headers: TableHeaderType[] = [
10
+ { header: 'Employee', width: '200px' },
11
+ { header: 'Location' },
12
+ { header: 'Payment', alignment: 'right' },
13
+ { header: 'Status' },
14
+ ];
15
+
16
+ const rows: TableRowType[] = [
17
+ {
18
+ cells: [
19
+ {
20
+ cell: {
21
+ type: 'leading',
22
+ primaryText: 'Bob Brown',
23
+ secondaryText: 'Software Engineer',
24
+ avatar: { profileName: 'Bob Brown', badge: { flagCode: 'GBP' } },
25
+ },
26
+ },
27
+ { cell: { type: 'text', text: 'FR, Paris' } },
28
+ {
29
+ cell: {
30
+ type: 'currency',
31
+ primaryCurrency: { amount: 12345.67, currency: 'eur' },
32
+ secondaryCurrency: { amount: 11000.0, currency: 'gbp' },
33
+ },
34
+ alignment: 'right',
35
+ },
36
+ {
37
+ cell: {
38
+ type: 'status',
39
+ primaryText: 'Cancelled',
40
+ secondaryText: '1 day ago',
41
+ sentiment: 'negative',
42
+ },
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ cells: [
48
+ {
49
+ cell: {
50
+ type: 'leading',
51
+ primaryText: 'Jan Kowalski',
52
+ secondaryText: 'Product Manager',
53
+ avatar: { asset: <DirectDebits />, badge: { status: 'warning' } },
54
+ },
55
+ },
56
+ { cell: { type: 'text', text: 'US, New York' } },
57
+ {
58
+ cell: {
59
+ type: 'currency',
60
+ primaryCurrency: { amount: 23456.78, currency: 'usd' },
61
+ secondaryCurrency: { amount: 21000.0, currency: 'gbp' },
62
+ },
63
+ alignment: 'right',
64
+ },
65
+ {
66
+ cell: {
67
+ type: 'status',
68
+ primaryText: 'Paid',
69
+ secondaryText: 'Yesterday',
70
+ sentiment: 'positive',
71
+ },
72
+ },
73
+ ],
74
+ },
75
+ ];
76
+
77
+ export default {
78
+ component: Table,
79
+ title: 'Content/Table/Tests',
80
+ tags: ['!autodocs', '!manifest'],
81
+ } satisfies Meta<typeof Table>;
82
+
83
+ type Story = StoryObj<typeof Table>;
84
+
85
+ export const RTLDiff: Story = {
86
+ render: () => (
87
+ <>
88
+ <Table data={{ headers, rows }} />
89
+ <Table
90
+ data={{
91
+ headers,
92
+ rows,
93
+ onRowClick: (rowData: TableRowType | TableRowClickableType) => {
94
+ void rowData;
95
+ },
96
+ }}
97
+ />
98
+ <Table data={{ headers, rows }} fullWidth={false} />
99
+ <Table data={{ headers, rows: [] }} />
100
+ <Table data={{ headers, rows }} loading />
101
+ </>
102
+ ),
103
+ ...withRTLDiff(),
104
+ };