@transferwise/components 0.0.0-experimental-db6cf60 → 0.0.0-experimental-4678400

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 (405) hide show
  1. package/build/Body/Body.js +1 -1
  2. package/build/Body/Body.js.map +1 -1
  3. package/build/Body/Body.mjs +1 -1
  4. package/build/Body/Body.mjs.map +1 -1
  5. package/build/Calendar/DayCalendar/Table/DayCalendarTable.js +1 -1
  6. package/build/Calendar/DayCalendar/Table/DayCalendarTable.js.map +1 -1
  7. package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs +1 -1
  8. package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs.map +1 -1
  9. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js +1 -1
  10. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js.map +1 -1
  11. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs +1 -1
  12. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs.map +1 -1
  13. package/build/Calendar/TableLink/TableLink.js +1 -1
  14. package/build/Calendar/TableLink/TableLink.js.map +1 -1
  15. package/build/Calendar/TableLink/TableLink.mjs +1 -1
  16. package/build/Calendar/TableLink/TableLink.mjs.map +1 -1
  17. package/build/ExpressiveMoneyInput/AmountInput/AmountInput.js +1 -1
  18. package/build/ExpressiveMoneyInput/AmountInput/AmountInput.js.map +1 -1
  19. package/build/ExpressiveMoneyInput/AmountInput/AmountInput.mjs +1 -1
  20. package/build/ExpressiveMoneyInput/AmountInput/AmountInput.mjs.map +1 -1
  21. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js +1 -1
  22. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js.map +1 -1
  23. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs +1 -1
  24. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs.map +1 -1
  25. package/build/Header/Header.js +8 -57
  26. package/build/Header/Header.js.map +1 -1
  27. package/build/Header/Header.mjs +9 -58
  28. package/build/Header/Header.mjs.map +1 -1
  29. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js +2 -2
  30. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +1 -1
  31. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs +2 -2
  32. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +1 -1
  33. package/build/Inputs/SelectInput/Option/SelectInputOption.js +1 -1
  34. package/build/Inputs/SelectInput/Option/SelectInputOption.js.map +1 -1
  35. package/build/Inputs/SelectInput/Option/SelectInputOption.mjs +1 -1
  36. package/build/Inputs/SelectInput/Option/SelectInputOption.mjs.map +1 -1
  37. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js +3 -3
  38. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +1 -1
  39. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +3 -3
  40. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +1 -1
  41. package/build/Inputs/SelectInput/Popover/SelectInputPopover.js +2 -2
  42. package/build/Inputs/SelectInput/Popover/SelectInputPopover.js.map +1 -1
  43. package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs +2 -2
  44. package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs.map +1 -1
  45. package/build/Label/Label.js +1 -1
  46. package/build/Label/Label.js.map +1 -1
  47. package/build/Label/Label.mjs +1 -1
  48. package/build/Label/Label.mjs.map +1 -1
  49. package/build/Stepper/Stepper.js +1 -1
  50. package/build/Stepper/Stepper.js.map +1 -1
  51. package/build/Stepper/Stepper.mjs +1 -1
  52. package/build/Stepper/Stepper.mjs.map +1 -1
  53. package/build/Table/Header/TableHeader.js +1 -1
  54. package/build/Table/Header/TableHeader.js.map +1 -1
  55. package/build/Table/Header/TableHeader.mjs +1 -1
  56. package/build/Table/Header/TableHeader.mjs.map +1 -1
  57. package/build/Tabs/Tab/Tab.js +1 -1
  58. package/build/Tabs/Tab/Tab.js.map +1 -1
  59. package/build/Tabs/Tab/Tab.mjs +1 -1
  60. package/build/Tabs/Tab/Tab.mjs.map +1 -1
  61. package/build/Tag/Tag.js +1 -1
  62. package/build/Tag/Tag.js.map +1 -1
  63. package/build/Tag/Tag.mjs +1 -1
  64. package/build/Tag/Tag.mjs.map +1 -1
  65. package/build/Typeahead/TypeaheadOption/TypeaheadOption.js +2 -2
  66. package/build/Typeahead/TypeaheadOption/TypeaheadOption.js.map +1 -1
  67. package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs +2 -2
  68. package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs.map +1 -1
  69. package/build/Upload/Steps/UploadImageStep/UploadImageStep.js +2 -2
  70. package/build/Upload/Steps/UploadImageStep/UploadImageStep.js.map +1 -1
  71. package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs +2 -2
  72. package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs.map +1 -1
  73. package/build/_deprecated/ActionButton/ActionButton.js +1 -1
  74. package/build/_deprecated/ActionButton/ActionButton.js.map +1 -1
  75. package/build/_deprecated/ActionButton/ActionButton.mjs +1 -1
  76. package/build/_deprecated/ActionButton/ActionButton.mjs.map +1 -1
  77. package/build/_deprecated/Avatar/Avatar.js +1 -1
  78. package/build/_deprecated/Avatar/Avatar.js.map +1 -1
  79. package/build/_deprecated/Avatar/Avatar.mjs +1 -1
  80. package/build/_deprecated/Avatar/Avatar.mjs.map +1 -1
  81. package/build/_deprecated/Select/Select.js +2 -2
  82. package/build/_deprecated/Select/Select.js.map +1 -1
  83. package/build/_deprecated/Select/Select.mjs +2 -2
  84. package/build/_deprecated/Select/Select.mjs.map +1 -1
  85. package/build/common/PropsValues/typography.js +6 -0
  86. package/build/common/PropsValues/typography.js.map +1 -1
  87. package/build/common/PropsValues/typography.mjs +6 -0
  88. package/build/common/PropsValues/typography.mjs.map +1 -1
  89. package/build/index.js +0 -2
  90. package/build/index.js.map +1 -1
  91. package/build/index.mjs +0 -1
  92. package/build/index.mjs.map +1 -1
  93. package/build/main.css +8673 -2355
  94. package/build/styles/Accordion/Accordion.css +7 -6
  95. package/build/styles/Body/Body.css +1 -1
  96. package/build/styles/Calendar/Calendar.css +11 -4
  97. package/build/styles/Calendar/TableLink/TableLink.css +11 -4
  98. package/build/styles/Chips/Chip/Chip.css +5 -3
  99. package/build/styles/Decision/Decision.css +4 -3
  100. package/build/styles/Emphasis/Emphasis.css +1 -1
  101. package/build/styles/ExpressiveMoneyInput/AmountInput/AmountInput.css +2 -1
  102. package/build/styles/ExpressiveMoneyInput/ExpressiveMoneyInput.css +2 -1
  103. package/build/styles/Header/Header.css +0 -46
  104. package/build/styles/Inputs/Input/Input.css +69 -57
  105. package/build/styles/Inputs/TextArea/TextArea.css +69 -57
  106. package/build/styles/Label/Label.css +3 -0
  107. package/build/styles/Markup/Markup.css +2 -2
  108. package/build/styles/MoneyInput/MoneyInput.css +9 -6
  109. package/build/styles/Nudge/Nudge.css +3 -3
  110. package/build/styles/Popover/Popover.css +4 -43
  111. package/build/styles/ProgressBar/ProgressBar.css +3 -2
  112. package/build/styles/Prompt/PrimitivePrompt/PrimitivePrompt.css +2 -1
  113. package/build/styles/Snackbar/Snackbar.css +1 -1
  114. package/build/styles/Table/Table.css +18 -8
  115. package/build/styles/Tabs/Tabs.css +3 -3
  116. package/build/styles/Tag/Tag.css +1 -1
  117. package/build/styles/Tile/Tile.css +4 -3
  118. package/build/styles/Typeahead/Typeahead.css +4 -2
  119. package/build/styles/UploadInput/UploadInput.css +1 -1
  120. package/build/styles/_deprecated/ActionButton/ActionButton.css +3 -4
  121. package/build/styles/_deprecated/Avatar/Avatar.css +2 -2
  122. package/build/styles/_deprecated/CriticalBanner/CriticalCommsBanner.css +2 -1
  123. package/build/styles/_deprecated/Select/Select.css +49 -14
  124. package/build/styles/_deprecated/Summary/Summary.css +2 -2
  125. package/build/styles/common/Circle/Circle.css +1 -1
  126. package/build/styles/common/Option/Option.css +4 -4
  127. package/build/styles/css/accordion.css +22 -44
  128. package/build/styles/css/badge.css +2 -2
  129. package/build/styles/css/button-groups.css +29 -6
  130. package/build/styles/css/buttons.css +35 -11
  131. package/build/styles/css/decision.css +22 -44
  132. package/build/styles/css/dropdowns.css +39 -54
  133. package/build/styles/css/droppable.css +28 -6
  134. package/build/styles/css/footer.css +41 -10
  135. package/build/styles/css/input-groups.css +205 -162
  136. package/build/styles/css/list-group.css +1 -42
  137. package/build/styles/css/modals.css +1 -1
  138. package/build/styles/css/navbar.css +66 -81
  139. package/build/styles/css/navs.css +8 -8
  140. package/build/styles/css/neptune-addons.css +15 -0
  141. package/build/styles/css/neptune-core.css +5887 -524
  142. package/build/styles/css/neptune.css +8348 -1945
  143. package/build/styles/css/panels.css +2 -2
  144. package/build/styles/css/popovers.css +39 -56
  145. package/build/styles/css/progress-bars.css +2 -2
  146. package/build/styles/css/sequences.css +14 -9
  147. package/build/styles/css/table.css +7 -7
  148. package/build/styles/css/tooltip.css +28 -6
  149. package/build/styles/less/legacy-variables.less +3 -3
  150. package/build/styles/less/neptune-tokens.less +0 -48
  151. package/build/styles/main.css +8673 -2355
  152. package/build/styles/props/neptune-tokens.css +805 -3
  153. package/build/styles/styles/less/accordion.css +22 -44
  154. package/build/styles/styles/less/badge.css +2 -2
  155. package/build/styles/styles/less/button-groups.css +29 -6
  156. package/build/styles/styles/less/buttons.css +35 -11
  157. package/build/styles/styles/less/decision.css +22 -44
  158. package/build/styles/styles/less/dropdowns.css +39 -54
  159. package/build/styles/styles/less/droppable.css +28 -6
  160. package/build/styles/styles/less/footer.css +41 -10
  161. package/build/styles/styles/less/forms/bootstrap-forms.css +153 -100
  162. package/build/styles/styles/less/forms/checkbox-radio.css +3 -3
  163. package/build/styles/styles/less/input-groups.css +205 -162
  164. package/build/styles/styles/less/list-group.css +1 -42
  165. package/build/styles/styles/less/modals.css +1 -1
  166. package/build/styles/styles/less/navbar.css +66 -81
  167. package/build/styles/styles/less/navs.css +8 -8
  168. package/build/styles/styles/less/neptune-addons.css +15 -0
  169. package/build/styles/styles/less/neptune-core.css +5887 -524
  170. package/build/styles/styles/less/neptune.css +8348 -1945
  171. package/build/styles/styles/less/panels.css +2 -2
  172. package/build/styles/styles/less/popovers.css +39 -56
  173. package/build/styles/styles/less/progress-bars.css +2 -2
  174. package/build/styles/styles/less/sequences.css +14 -9
  175. package/build/styles/styles/less/table.css +7 -7
  176. package/build/styles/styles/less/tooltip.css +28 -6
  177. package/build/types/ExpressiveMoneyInput/AmountInput/AmountInput.d.ts.map +1 -1
  178. package/build/types/Header/Header.d.ts +4 -31
  179. package/build/types/Header/Header.d.ts.map +1 -1
  180. package/build/types/Header/index.d.ts +1 -2
  181. package/build/types/Header/index.d.ts.map +1 -1
  182. package/build/types/common/PropsValues/typography.d.ts +13 -1
  183. package/build/types/common/PropsValues/typography.d.ts.map +1 -1
  184. package/build/types/index.d.ts +1 -3
  185. package/build/types/index.d.ts.map +1 -1
  186. package/package.json +2 -2
  187. package/src/Accordion/Accordion.css +7 -6
  188. package/src/Accordion/Accordion.less +7 -6
  189. package/src/Body/Body.css +1 -1
  190. package/src/Body/Body.less +1 -1
  191. package/src/Body/Body.test.tsx +4 -4
  192. package/src/Body/Body.tsx +2 -2
  193. package/src/Calendar/Calendar.css +11 -4
  194. package/src/Calendar/DayCalendar/Table/DayCalendarTable.tsx +2 -2
  195. package/src/Calendar/MonthCalendar/Table/MonthCalendarTable.tsx +1 -1
  196. package/src/Calendar/TableLink/TableLink.css +11 -4
  197. package/src/Calendar/TableLink/TableLink.less +14 -4
  198. package/src/Calendar/TableLink/TableLink.tsx +1 -1
  199. package/src/Chips/Chip/Chip.css +5 -3
  200. package/src/Chips/Chip/Chip.less +3 -2
  201. package/src/CircularButton/_stories/CircularButton.story.tsx +6 -16
  202. package/src/DateInput/_stories/DateInput.rtl.test.story.tsx +46 -0
  203. package/src/Decision/Decision.css +4 -3
  204. package/src/Decision/Decision.less +4 -3
  205. package/src/DefinitionList/_stories/DefinitionList.story.tsx +1 -1
  206. package/src/Display/_stories/Display.story.tsx +20 -6
  207. package/src/Emphasis/Emphasis.css +1 -1
  208. package/src/Emphasis/Emphasis.less +1 -1
  209. package/src/ExpressiveMoneyInput/AmountInput/AmountInput.css +2 -1
  210. package/src/ExpressiveMoneyInput/AmountInput/AmountInput.less +2 -1
  211. package/src/ExpressiveMoneyInput/AmountInput/AmountInput.tsx +1 -4
  212. package/src/ExpressiveMoneyInput/ExpressiveMoneyInput.css +2 -1
  213. package/src/FlowNavigation/AnimatedLabel/AnimatedLabel.tsx +1 -1
  214. package/src/Header/Header.css +0 -46
  215. package/src/Header/Header.less +1 -63
  216. package/src/Header/Header.test.tsx +1 -133
  217. package/src/Header/Header.tsx +11 -107
  218. package/src/Header/_stories/Header.story.tsx +2 -97
  219. package/src/Header/_stories/Header.test.story.tsx +0 -32
  220. package/src/Header/index.ts +1 -2
  221. package/src/Inputs/Input/Input.css +69 -57
  222. package/src/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.tsx +2 -2
  223. package/src/Inputs/SelectInput/Option/SelectInputOption.tsx +1 -1
  224. package/src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +3 -3
  225. package/src/Inputs/SelectInput/Popover/SelectInputPopover.tsx +2 -2
  226. package/src/Inputs/SelectInput/_stories/SelectInput.story.tsx +1 -1
  227. package/src/Inputs/TextArea/TextArea.css +69 -57
  228. package/src/Inputs/_common.less +16 -10
  229. package/src/Label/Label.css +3 -0
  230. package/src/Label/Label.less +8 -0
  231. package/src/Label/Label.tsx +1 -1
  232. package/src/Markup/Markup.css +2 -2
  233. package/src/Markup/Markup.less +2 -2
  234. package/src/MoneyInput/MoneyInput.css +9 -6
  235. package/src/MoneyInput/MoneyInput.less +10 -7
  236. package/src/Nudge/Nudge.css +3 -3
  237. package/src/Nudge/Nudge.less +3 -3
  238. package/src/PocketSurface/_stories/PocketSurface.story.tsx +2 -2
  239. package/src/Popover/Popover.css +4 -43
  240. package/src/Popover/Popover.less +2 -2
  241. package/src/ProgressBar/ProgressBar.css +3 -2
  242. package/src/ProgressBar/ProgressBar.less +12 -11
  243. package/src/Prompt/PrimitivePrompt/PrimitivePrompt.css +2 -1
  244. package/src/Prompt/PrimitivePrompt/PrimitivePrompt.less +2 -1
  245. package/src/SentimentSurface/_stories/SentimentSurface.story.tsx +1 -1
  246. package/src/Snackbar/Snackbar.css +1 -1
  247. package/src/Snackbar/Snackbar.less +1 -1
  248. package/src/Stepper/Stepper.tsx +1 -1
  249. package/src/Table/Header/TableHeader.tsx +1 -1
  250. package/src/Table/StatusText/TableStatusText.test.tsx +5 -5
  251. package/src/Table/Table.css +18 -8
  252. package/src/Table/Table.less +20 -9
  253. package/src/Tabs/Tab/Tab.tsx +1 -1
  254. package/src/Tabs/Tabs.css +3 -3
  255. package/src/Tabs/Tabs.less +3 -3
  256. package/src/Tag/Tag.css +1 -1
  257. package/src/Tag/Tag.less +1 -1
  258. package/src/Tag/Tag.tsx +1 -1
  259. package/src/Tag/_stories/Tag.story.tsx +1 -1
  260. package/src/Tile/Tile.css +4 -3
  261. package/src/Tile/Tile.less +4 -3
  262. package/src/Typeahead/Typeahead.css +4 -2
  263. package/src/Typeahead/Typeahead.less +2 -1
  264. package/src/Typeahead/TypeaheadOption/TypeaheadOption.tsx +2 -2
  265. package/src/Upload/Steps/UploadImageStep/UploadImageStep.tsx +2 -2
  266. package/src/UploadInput/UploadInput.css +1 -1
  267. package/src/UploadInput/UploadInput.less +7 -4
  268. package/src/_deprecated/ActionButton/ActionButton.css +3 -4
  269. package/src/_deprecated/ActionButton/ActionButton.less +4 -5
  270. package/src/_deprecated/ActionButton/ActionButton.tsx +1 -1
  271. package/src/_deprecated/Avatar/Avatar.css +2 -2
  272. package/src/_deprecated/Avatar/Avatar.less +2 -2
  273. package/src/_deprecated/Avatar/Avatar.tsx +1 -1
  274. package/src/_deprecated/CriticalBanner/CriticalCommsBanner.css +2 -1
  275. package/src/_deprecated/CriticalBanner/CriticalCommsBanner.less +2 -1
  276. package/src/_deprecated/NavigationOption/_stories/NavigationOption.story.tsx +6 -6
  277. package/src/_deprecated/Select/Select.css +49 -14
  278. package/src/_deprecated/Select/Select.less +14 -10
  279. package/src/_deprecated/Select/Select.tsx +2 -2
  280. package/src/_deprecated/Summary/Summary.css +2 -2
  281. package/src/_deprecated/Summary/Summary.less +2 -2
  282. package/src/common/Circle/Circle.css +1 -1
  283. package/src/common/Circle/Circle.less +1 -1
  284. package/src/common/Option/Option.css +4 -4
  285. package/src/common/Option/Option.less +4 -4
  286. package/src/common/PropsValues/typography.ts +20 -1
  287. package/src/index.ts +1 -3
  288. package/src/main.css +8673 -2355
  289. package/src/main.less +3 -3
  290. package/src/styles/less/accordion.css +22 -44
  291. package/src/styles/less/addons/_background-utilities.less +5 -0
  292. package/src/styles/less/badge.css +2 -2
  293. package/src/styles/less/badge.less +2 -2
  294. package/src/styles/less/button-groups.css +29 -6
  295. package/src/styles/less/button-groups.less +3 -2
  296. package/src/styles/less/buttons.css +35 -11
  297. package/src/styles/less/buttons.less +7 -7
  298. package/src/styles/less/core/_fonts.less +7 -75
  299. package/src/styles/less/core/_scaffolding.less +4 -4
  300. package/src/styles/less/core/_typography-utilities.less +3 -3
  301. package/src/styles/less/core/_typography.less +81 -235
  302. package/src/styles/less/core/fonts/_fonts-ar.less +86 -0
  303. package/src/styles/less/core/fonts/_fonts-base.less +99 -0
  304. package/src/styles/less/core/fonts/_fonts-he.less +8 -0
  305. package/src/styles/less/core/fonts/_fonts-ja.less +4247 -0
  306. package/src/styles/less/core/fonts/_fonts-ko.less +1079 -0
  307. package/src/styles/less/core/fonts/_fonts-th.less +8 -0
  308. package/src/styles/less/core/fonts/_fonts-zh.less +872 -0
  309. package/src/styles/less/decision.css +22 -44
  310. package/src/styles/less/decision.less +2 -2
  311. package/src/styles/less/dropdowns.css +39 -54
  312. package/src/styles/less/dropdowns.less +8 -7
  313. package/src/styles/less/droppable.css +28 -6
  314. package/src/styles/less/droppable.less +4 -4
  315. package/src/styles/less/footer.css +41 -10
  316. package/src/styles/less/footer.less +4 -3
  317. package/src/styles/less/forms/bootstrap-forms.css +153 -100
  318. package/src/styles/less/forms/bootstrap-forms.less +85 -72
  319. package/src/styles/less/forms/checkbox-radio.css +3 -3
  320. package/src/styles/less/forms/checkbox-radio.less +3 -3
  321. package/src/styles/less/input-groups.css +205 -162
  322. package/src/styles/less/input-groups.less +23 -9
  323. package/src/styles/less/list-group.css +1 -42
  324. package/src/styles/less/list-group.less +8 -5
  325. package/src/styles/less/mixins/_reset-text.less +1 -1
  326. package/src/styles/less/mixins/_text-emphasis.less +7 -1
  327. package/src/styles/less/modals.css +1 -1
  328. package/src/styles/less/modals.less +1 -1
  329. package/src/styles/less/navbar.css +66 -81
  330. package/src/styles/less/navbar.less +19 -19
  331. package/src/styles/less/navs.css +8 -8
  332. package/src/styles/less/navs.less +8 -8
  333. package/src/styles/less/neptune-addons.css +15 -0
  334. package/src/styles/less/neptune-core.css +5887 -524
  335. package/src/styles/less/neptune.bundle.less +4 -0
  336. package/src/styles/less/neptune.css +8348 -1945
  337. package/src/styles/less/panels.css +2 -2
  338. package/src/styles/less/panels.less +2 -2
  339. package/src/styles/less/popovers.css +39 -56
  340. package/src/styles/less/popovers.less +7 -7
  341. package/src/styles/less/progress-bars.css +2 -2
  342. package/src/styles/less/progress-bars.less +2 -2
  343. package/src/styles/less/sequences.css +14 -9
  344. package/src/styles/less/sequences.less +15 -10
  345. package/src/styles/less/table.css +7 -7
  346. package/src/styles/less/table.less +7 -7
  347. package/src/styles/less/tooltip.css +28 -6
  348. package/src/styles/less/tooltip.less +1 -1
  349. package/src/styles/variables/legacy-variables.less +3 -3
  350. package/build/CardContainer/CardContainer.js +0 -30
  351. package/build/CardContainer/CardContainer.js.map +0 -1
  352. package/build/CardContainer/CardContainer.mjs +0 -26
  353. package/build/CardContainer/CardContainer.mjs.map +0 -1
  354. package/build/Header/HeaderActionButton.js +0 -70
  355. package/build/Header/HeaderActionButton.js.map +0 -1
  356. package/build/Header/HeaderActionButton.mjs +0 -65
  357. package/build/Header/HeaderActionButton.mjs.map +0 -1
  358. package/build/styles/CardContainer/CardContainer.css +0 -78
  359. package/build/styles/fonts/inter-cyrillic-ext-variable-wghtOnly-normal.woff2 +0 -0
  360. package/build/styles/fonts/inter-cyrillic-variable-wghtOnly-normal.woff2 +0 -0
  361. package/build/styles/fonts/inter-greek-ext-variable-wghtOnly-normal.woff2 +0 -0
  362. package/build/styles/fonts/inter-greek-variable-wghtOnly-normal.woff2 +0 -0
  363. package/build/styles/fonts/inter-latin-ext-variable-wghtOnly-normal.woff2 +0 -0
  364. package/build/styles/fonts/inter-latin-variable-wghtOnly-normal.woff2 +0 -0
  365. package/build/styles/fonts/inter-vietnamese-variable-wghtOnly-normal.woff2 +0 -0
  366. package/build/styles/fonts/rubik/rubik-body-cyrillic-330-normal.woff2 +0 -0
  367. package/build/styles/fonts/rubik/rubik-body-cyrillic-600-normal.woff2 +0 -0
  368. package/build/styles/fonts/rubik/rubik-body-cyrillic-ext-330-normal.woff2 +0 -0
  369. package/build/styles/fonts/rubik/rubik-body-cyrillic-ext-600-normal.woff2 +0 -0
  370. package/build/styles/fonts/rubik/rubik-cyrillic-900-normal.woff2 +0 -0
  371. package/build/styles/fonts/rubik/rubik-cyrillic-ext-900-normal.woff2 +0 -0
  372. package/build/types/CardContainer/CardContainer.d.ts +0 -8
  373. package/build/types/CardContainer/CardContainer.d.ts.map +0 -1
  374. package/build/types/CardContainer/CardContainer.types.d.ts +0 -32
  375. package/build/types/CardContainer/CardContainer.types.d.ts.map +0 -1
  376. package/build/types/CardContainer/_stories/helpers.d.ts +0 -3
  377. package/build/types/CardContainer/_stories/helpers.d.ts.map +0 -1
  378. package/build/types/CardContainer/index.d.ts +0 -3
  379. package/build/types/CardContainer/index.d.ts.map +0 -1
  380. package/build/types/Header/HeaderActionButton.d.ts +0 -53
  381. package/build/types/Header/HeaderActionButton.d.ts.map +0 -1
  382. package/src/CardContainer/CardContainer.css +0 -78
  383. package/src/CardContainer/CardContainer.less +0 -111
  384. package/src/CardContainer/CardContainer.test.tsx +0 -103
  385. package/src/CardContainer/CardContainer.tsx +0 -36
  386. package/src/CardContainer/CardContainer.types.ts +0 -36
  387. package/src/CardContainer/_stories/CardContainer.story.tsx +0 -99
  388. package/src/CardContainer/_stories/CardContainer.test.story.tsx +0 -375
  389. package/src/CardContainer/_stories/CardContainer.withHeader.story.tsx +0 -149
  390. package/src/CardContainer/_stories/helpers.tsx +0 -50
  391. package/src/CardContainer/index.ts +0 -2
  392. package/src/Header/HeaderActionButton.tsx +0 -125
  393. package/src/styles/fonts/inter-cyrillic-ext-variable-wghtOnly-normal.woff2 +0 -0
  394. package/src/styles/fonts/inter-cyrillic-variable-wghtOnly-normal.woff2 +0 -0
  395. package/src/styles/fonts/inter-greek-ext-variable-wghtOnly-normal.woff2 +0 -0
  396. package/src/styles/fonts/inter-greek-variable-wghtOnly-normal.woff2 +0 -0
  397. package/src/styles/fonts/inter-latin-ext-variable-wghtOnly-normal.woff2 +0 -0
  398. package/src/styles/fonts/inter-latin-variable-wghtOnly-normal.woff2 +0 -0
  399. package/src/styles/fonts/inter-vietnamese-variable-wghtOnly-normal.woff2 +0 -0
  400. package/src/styles/fonts/rubik/rubik-body-cyrillic-330-normal.woff2 +0 -0
  401. package/src/styles/fonts/rubik/rubik-body-cyrillic-600-normal.woff2 +0 -0
  402. package/src/styles/fonts/rubik/rubik-body-cyrillic-ext-330-normal.woff2 +0 -0
  403. package/src/styles/fonts/rubik/rubik-body-cyrillic-ext-600-normal.woff2 +0 -0
  404. package/src/styles/fonts/rubik/rubik-cyrillic-900-normal.woff2 +0 -0
  405. package/src/styles/fonts/rubik/rubik-cyrillic-ext-900-normal.woff2 +0 -0
@@ -1,103 +0,0 @@
1
- import Header from '../Header';
2
- import { render, screen } from '../test-utils';
3
- import CardContainer from './CardContainer';
4
- import type { CardContainerSpotlight } from './CardContainer.types';
5
-
6
- describe('CardContainer', () => {
7
- const content = 'Container content';
8
-
9
- describe('rendering', () => {
10
- it('renders children', () => {
11
- render(<CardContainer>{content}</CardContainer>);
12
- expect(screen.getByText(content)).toBeInTheDocument();
13
- });
14
-
15
- it('renders as a section by default', () => {
16
- render(<CardContainer data-testid="container">{content}</CardContainer>);
17
- expect(screen.getByTestId('container').tagName).toBe('SECTION');
18
- });
19
-
20
- it.each(['div', 'article'] as const)('renders as %s when as is provided', (as) => {
21
- render(
22
- <CardContainer as={as} data-testid="container">
23
- {content}
24
- </CardContainer>,
25
- );
26
- expect(screen.getByTestId('container').tagName).toBe(as.toUpperCase());
27
- });
28
-
29
- it('applies className to the root element', () => {
30
- render(
31
- <CardContainer className="custom-class" data-testid="container">
32
- {content}
33
- </CardContainer>,
34
- );
35
- expect(screen.getByTestId('container')).toHaveClass('wds-card-container', 'custom-class');
36
- });
37
-
38
- it('spreads unknown props onto the root element', () => {
39
- render(
40
- <CardContainer aria-label="Cards" data-testid="container">
41
- {content}
42
- </CardContainer>,
43
- );
44
- expect(screen.getByTestId('container')).toHaveAttribute('aria-label', 'Cards');
45
- });
46
-
47
- it('renders a composed Header as a direct child', () => {
48
- render(
49
- <CardContainer data-testid="container">
50
- <Header as="h3" title="Cards" />
51
- {content}
52
- </CardContainer>,
53
- );
54
- const heading = screen.getByRole('heading', { level: 3, name: 'Cards' });
55
- expect(heading.parentElement).toBe(screen.getByTestId('container'));
56
- });
57
- });
58
-
59
- describe('spotlight', () => {
60
- it('has no spotlight modifier by default', () => {
61
- render(<CardContainer data-testid="container">{content}</CardContainer>);
62
- const root = screen.getByTestId('container');
63
- expect(root).not.toHaveClass('wds-card-container--active');
64
- expect(root).not.toHaveClass('wds-card-container--inactive');
65
- });
66
-
67
- it.each<CardContainerSpotlight>(['active', 'inactive'])(
68
- 'renders the %s spotlight modifier',
69
- (spotlight) => {
70
- render(
71
- <CardContainer spotlight={spotlight} data-testid="container">
72
- {content}
73
- </CardContainer>,
74
- );
75
- expect(screen.getByTestId('container')).toHaveClass(`wds-card-container--${spotlight}`);
76
- },
77
- );
78
-
79
- it('draws a decorative dashed border for the inactive spotlight', () => {
80
- render(
81
- <CardContainer spotlight="inactive" data-testid="container">
82
- {content}
83
- </CardContainer>,
84
- );
85
- expect(
86
- screen.getByTestId('container').querySelector('.wds-card-container__border'),
87
- ).toHaveAttribute('aria-hidden', 'true');
88
- });
89
-
90
- it.each<CardContainerSpotlight | undefined>(['active', undefined])(
91
- 'draws no dashed border for spotlight %s',
92
- (spotlight) => {
93
- render(
94
- <CardContainer spotlight={spotlight} data-testid="container">
95
- {content}
96
- </CardContainer>,
97
- );
98
- const root = screen.getByTestId('container');
99
- expect(root.querySelector('.wds-card-container__border')).not.toBeInTheDocument();
100
- },
101
- );
102
- });
103
- });
@@ -1,36 +0,0 @@
1
- import { clsx } from 'clsx';
2
- import { forwardRef } from 'react';
3
-
4
- import type { CardContainerProps } from './CardContainer.types';
5
-
6
- /**
7
- * A bounded surface that groups related content. It has no slots of its own: compose a `Header`
8
- * and any other content as children, and the card stacks them with no gap between them.
9
- */
10
- const CardContainer = forwardRef<HTMLElement, CardContainerProps>(
11
- ({ spotlight, children, as: Element = 'section', className, ...props }, ref) => {
12
- return (
13
- <Element
14
- ref={ref as React.Ref<HTMLElement & HTMLDivElement>}
15
- className={clsx(
16
- 'wds-card-container',
17
- spotlight && `wds-card-container--${spotlight}`,
18
- className,
19
- )}
20
- {...props}
21
- >
22
- {children}
23
-
24
- {spotlight === 'inactive' && (
25
- <svg aria-hidden="true" className="wds-card-container__border">
26
- <rect />
27
- </svg>
28
- )}
29
- </Element>
30
- );
31
- },
32
- );
33
-
34
- CardContainer.displayName = 'CardContainer';
35
-
36
- export default CardContainer;
@@ -1,36 +0,0 @@
1
- import type { HTMLAttributes, ReactNode } from 'react';
2
-
3
- /**
4
- * Highlights the card, matching `ListItem`'s `spotlight`.
5
- *
6
- * - `active` — live content the user can act on. Raised, with a soft shadow and a hairline border.
7
- * - `inactive` — a feature the user has not set up yet. Recessed, with a dashed stroke.
8
- *
9
- * Without a spotlight the card is flat, with a solid stroke, for content that is present but not
10
- * actionable.
11
- */
12
- export type CardContainerSpotlight = 'active' | 'inactive';
13
-
14
- export interface CardContainerProps extends HTMLAttributes<HTMLElement> {
15
- /**
16
- * Highlights the card as live content (`active`) or as a feature not set up yet (`inactive`).
17
- * Leave unset for a flat card.
18
- * @default undefined
19
- */
20
- spotlight?: CardContainerSpotlight;
21
-
22
- /**
23
- * Content, stacked with no gap. A `Header` is spaced from the content after it.
24
- * @default undefined
25
- */
26
- children?: ReactNode;
27
-
28
- /**
29
- * Element rendered as the root.
30
- * @default 'section'
31
- */
32
- as?: 'section' | 'div' | 'article';
33
-
34
- className?: string;
35
- 'data-testid'?: string;
36
- }
@@ -1,99 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-webpack5';
2
-
3
- import {
4
- createSandboxStory,
5
- globalScope,
6
- } from '../../../.storybook/components/sandbox/SandboxEditor';
7
- import Body from '../../Body';
8
- import CardContainer from '..';
9
- import type { CardContainerSpotlight } from '..';
10
- import { CardsList, SampleContent } from './helpers';
11
-
12
- /**
13
- * A bounded surface that groups related content. It has no slots of its own: any content passed
14
- * as children is stacked with no gap, inside the card's padding.
15
- *
16
- * To give a card a title, a title link or actions, compose a `Header` as its first child — see the
17
- * **With Header** stories.
18
- */
19
- const meta: Meta<typeof CardContainer> = {
20
- component: CardContainer,
21
- title: 'Layouts/CardContainer',
22
- tags: ['early-access'],
23
- argTypes: {
24
- spotlight: {
25
- control: 'radio',
26
- options: [undefined, 'active', 'inactive'],
27
- table: {
28
- defaultValue: { summary: 'undefined' },
29
- type: { summary: 'CardContainerSpotlight' },
30
- },
31
- },
32
- as: {
33
- control: 'radio',
34
- options: ['section', 'div', 'article'],
35
- table: { defaultValue: { summary: "'section'" }, type: { summary: 'string' } },
36
- },
37
- children: {
38
- control: false,
39
- table: { type: { summary: 'ReactNode' } },
40
- },
41
- className: { control: 'text', table: { type: { summary: 'string' } } },
42
- 'data-testid': { control: 'text', table: { type: { summary: 'string' } } },
43
- },
44
- args: {
45
- spotlight: 'active',
46
- as: 'section',
47
- },
48
- };
49
-
50
- export default meta;
51
-
52
- type Story = StoryObj<typeof CardContainer>;
53
-
54
- /** Experiment with the card's props. */
55
- export const Playground: Story = {
56
- render: (args) => (
57
- <CardContainer {...args}>
58
- <SampleContent />
59
- </CardContainer>
60
- ),
61
- };
62
-
63
- export const Sandbox = createSandboxStory({
64
- code: `<CardContainer spotlight="active">
65
- <Body>Your virtual card is ready to use.</Body>
66
- <Body>Spend in 40+ currencies with the real exchange rate.</Body>
67
- </CardContainer>`,
68
- scope: { ...globalScope, CardContainer },
69
- });
70
-
71
- /**
72
- * `spotlight` matches `ListItem`'s: `active` is raised, for live content, and `inactive` is
73
- * recessed with a dashed stroke, for a feature not set up yet. Without a spotlight the card is
74
- * flat.
75
- */
76
- export const Spotlight: Story = {
77
- parameters: { controls: { disable: true } },
78
- render: () => (
79
- <div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '480px' }}>
80
- {([undefined, 'active', 'inactive'] as (CardContainerSpotlight | undefined)[]).map(
81
- (spotlight) => (
82
- <CardContainer key={spotlight ?? 'none'} spotlight={spotlight}>
83
- <Body>Spotlight: {spotlight ?? 'not set'}</Body>
84
- </CardContainer>
85
- ),
86
- )}
87
- </div>
88
- ),
89
- };
90
-
91
- /** A `List` placed directly in the card is inset by a further 8px on each side. */
92
- export const WithList: Story = {
93
- parameters: { controls: { disable: true } },
94
- render: () => (
95
- <CardContainer>
96
- <CardsList />
97
- </CardContainer>
98
- ),
99
- };
@@ -1,375 +0,0 @@
1
- import { Card, Jar, Plus, Settings, Travel } from '@transferwise/icons';
2
- import { Meta, StoryObj } from '@storybook/react-webpack5';
3
- import { useTheme } from '@wise/components-theming';
4
-
5
- import { useRtlDiffI18n, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
6
- import { withVariantConfig } from '../../../.storybook/helpers';
7
- import Body from '../../Body';
8
- import Header from '../../Header';
9
- import List from '../../List';
10
- import ListItem from '../../ListItem';
11
- import type { ListItemProps } from '../../ListItem';
12
- import Title from '../../Title';
13
- import CardContainer from '..';
14
- import type { CardContainerProps, CardContainerSpotlight } from '..';
15
-
16
- const meta: Meta<typeof CardContainer> = {
17
- component: CardContainer,
18
- tags: ['!autodocs', '!manifest'],
19
- title: 'Layouts/CardContainer/Tests',
20
- };
21
- export default meta;
22
- type Story = StoryObj<CardContainerProps>;
23
-
24
- const SPOTLIGHTS: (CardContainerSpotlight | undefined)[] = [undefined, 'active', 'inactive'];
25
-
26
- const ThemeTitle = () => {
27
- const { theme, screenMode } = useTheme();
28
- return (
29
- <Title type="title-subsection">
30
- {theme} / {screenMode}
31
- </Title>
32
- );
33
- };
34
-
35
- /**
36
- * Every spotlight against every theme. The `active` spotlight's resting shadow is only applied in
37
- * the light `personal`, `business` and `platform` themes; every `dark`, `bright-green` and
38
- * `forest-green` column should show a flat surface.
39
- */
40
- export const AllVariants: Story = {
41
- ...withVariantConfig([
42
- 'default',
43
- 'dark',
44
- 'bright-green',
45
- 'forest-green',
46
- 'business',
47
- 'business--bright-green',
48
- 'business--forest-green',
49
- 'platform',
50
- 'platform--forest-green',
51
- ]),
52
- render: () => (
53
- <div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '420px' }}>
54
- <ThemeTitle />
55
- {SPOTLIGHTS.map((spotlight) => (
56
- <CardContainer key={spotlight ?? 'none'} spotlight={spotlight}>
57
- <Header
58
- as="h3"
59
- title={`Spotlight: ${spotlight ?? 'not set'}`}
60
- titleAction={{ href: '#target' }}
61
- action={{ label: 'Order card', icon: <Plus size={16} /> }}
62
- actionSecondary={{ 'aria-label': 'Settings', icon: <Settings size={16} /> }}
63
- />
64
- <Body>First line of content.</Body>
65
- <Body>Second line, to show the content stacks flush.</Body>
66
- </CardContainer>
67
- ))}
68
- </div>
69
- ),
70
- };
71
-
72
- /** A composed `Header` with every combination of title link and the two action slots. */
73
- export const HeaderCombinations: Story = {
74
- render: () => (
75
- <div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '420px' }}>
76
- <CardContainer>
77
- <Header as="h3" title="Title only" />
78
- <Body>Content</Body>
79
- </CardContainer>
80
-
81
- <CardContainer>
82
- <Header as="h3" title="Title as link" titleAction={{ href: '#target' }} />
83
- <Body>Content</Body>
84
- </CardContainer>
85
-
86
- <CardContainer>
87
- <Header
88
- as="h3"
89
- title="A title link long enough to wrap onto a second line, with its chevron after the last word"
90
- titleAction={{ href: '#target' }}
91
- />
92
- <Body>Content</Body>
93
- </CardContainer>
94
-
95
- <CardContainer>
96
- <Header as="h3" title="Leading action only" action={{ label: 'Order card' }} />
97
- <Body>Content</Body>
98
- </CardContainer>
99
-
100
- <CardContainer>
101
- <Header as="h3" title="Secondary action only" actionSecondary={{ label: 'Manage' }} />
102
- <Body>Content</Body>
103
- </CardContainer>
104
-
105
- <CardContainer>
106
- <Header
107
- as="h3"
108
- title="Both actions, icon only"
109
- action={{ 'aria-label': 'Add', icon: <Plus size={16} /> }}
110
- actionSecondary={{ 'aria-label': 'Settings', icon: <Settings size={16} /> }}
111
- />
112
- <Body>Content</Body>
113
- </CardContainer>
114
-
115
- <CardContainer>
116
- <Header
117
- as="h3"
118
- title="A title long enough to wrap onto more than a single line next to its actions"
119
- titleAction={{ href: '#target' }}
120
- action={{ label: 'Order card', icon: <Plus size={16} /> }}
121
- actionSecondary={{ 'aria-label': 'Settings', icon: <Settings size={16} /> }}
122
- />
123
- <Body>Content</Body>
124
- </CardContainer>
125
-
126
- <CardContainer>
127
- <Header as="h3" title="Header only" action={{ label: 'Order card' }} />
128
- </CardContainer>
129
-
130
- <CardContainer>
131
- <Body>No header — the content starts at the card&apos;s top padding.</Body>
132
- </CardContainer>
133
- </div>
134
- ),
135
- };
136
-
137
- const LIST_ITEMS = [
138
- { title: '•••• 1582', subtitle: 'Current account', icon: <Card /> },
139
- { title: '•••• 9982', subtitle: 'Jar', icon: <Jar /> },
140
- { title: '•••• 5507', subtitle: 'Travel', icon: <Travel /> },
141
- ];
142
-
143
- const CardListItem = ({
144
- index,
145
- spotlight,
146
- }: {
147
- index: number;
148
- spotlight?: ListItemProps['spotlight'];
149
- }) => {
150
- const { title, subtitle, icon } = LIST_ITEMS[index];
151
- return (
152
- <ListItem
153
- title={title}
154
- subtitle={subtitle}
155
- spotlight={spotlight}
156
- media={<ListItem.AvatarView>{icon}</ListItem.AvatarView>}
157
- control={<ListItem.Navigation href={`#item-${index}`} />}
158
- />
159
- );
160
- };
161
-
162
- /**
163
- * A composed `List` with every mix of spotlight and non-spotlight items. Non-spotlight items draw
164
- * their hover and focus backgrounds 8px out of bounds, into the card's padding.
165
- */
166
- export const ListCombinations: Story = {
167
- render: () => (
168
- <div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '420px' }}>
169
- <CardContainer>
170
- <Header as="h3" title="Non-spotlight items" titleAction={{ href: '#target' }} />
171
- <List>
172
- <CardListItem index={0} />
173
- <CardListItem index={1} />
174
- <CardListItem index={2} />
175
- </List>
176
- </CardContainer>
177
-
178
- <CardContainer>
179
- <Header as="h3" title="Active spotlight items" />
180
- <List>
181
- <CardListItem index={0} spotlight="active" />
182
- <CardListItem index={1} spotlight="active" />
183
- </List>
184
- </CardContainer>
185
-
186
- <CardContainer>
187
- <Header as="h3" title="Inactive spotlight items" />
188
- <List>
189
- <CardListItem index={0} spotlight="inactive" />
190
- <CardListItem index={1} spotlight="inactive" />
191
- </List>
192
- </CardContainer>
193
-
194
- <CardContainer>
195
- <Header as="h3" title="Active and inactive spotlight items" />
196
- <List>
197
- <CardListItem index={0} spotlight="active" />
198
- <CardListItem index={1} spotlight="inactive" />
199
- </List>
200
- </CardContainer>
201
-
202
- <CardContainer>
203
- <Header
204
- as="h3"
205
- title="Spotlight and non-spotlight items"
206
- action={{ label: 'Order card', icon: <Plus size={16} /> }}
207
- />
208
- <List>
209
- <CardListItem index={0} spotlight="active" />
210
- <CardListItem index={1} />
211
- <CardListItem index={2} />
212
- </List>
213
- </CardContainer>
214
-
215
- <CardContainer spotlight="active">
216
- <Header as="h3" title="Single non-spotlight item in an active card" />
217
- <List>
218
- <CardListItem index={0} />
219
- </List>
220
- </CardContainer>
221
-
222
- <CardContainer spotlight="inactive">
223
- <Header as="h3" title="Single spotlight item in an inactive card" />
224
- <List>
225
- <CardListItem index={0} spotlight="active" />
226
- </List>
227
- </CardContainer>
228
-
229
- <CardContainer>
230
- <List>
231
- <CardListItem index={0} />
232
- <CardListItem index={1} />
233
- </List>
234
- </CardContainer>
235
- </div>
236
- ),
237
- };
238
-
239
- /**
240
- * Two spotlighted cards side by side: one with a title-only `Header` and text, the other with
241
- * action buttons and a `List`. Each header is at least as tall as the 32px action buttons, so the
242
- * first line of content starts at the same height in both cards.
243
- */
244
- export const SideBySide: Story = {
245
- render: () => (
246
- <div style={{ display: 'flex', gap: '24px', maxWidth: '900px' }}>
247
- <div style={{ flex: 1 }}>
248
- <CardContainer spotlight="active">
249
- <Header as="h3" title="Balance" />
250
- <Body>Your virtual card is ready to use.</Body>
251
- <Body>Spend in 40+ currencies with the real exchange rate.</Body>
252
- </CardContainer>
253
- </div>
254
- <div style={{ flex: 1 }}>
255
- <CardContainer spotlight="active">
256
- <Header
257
- as="h3"
258
- title="Cards"
259
- titleAction={{ href: '#target' }}
260
- action={{ label: 'Order card', icon: <Plus size={16} /> }}
261
- actionSecondary={{ 'aria-label': 'Settings', icon: <Settings size={16} /> }}
262
- />
263
- <List>
264
- <CardListItem index={0} />
265
- <CardListItem index={1} />
266
- <CardListItem index={2} />
267
- </List>
268
- </CardContainer>
269
- </div>
270
- </div>
271
- ),
272
- };
273
-
274
- /**
275
- * When the `Header` is 360px wide or narrower, its action corner stays beside a title that fits
276
- * on one line next to it, and moves under a longer title. Above that width, a long title wraps
277
- * beside the actions instead.
278
- */
279
- export const NarrowHeader: Story = {
280
- render: () => (
281
- <div style={{ display: 'flex', flexDirection: 'column', gap: '24px' }}>
282
- {[320, 394, 420].map((width) => (
283
- <div key={width} style={{ display: 'flex', flexDirection: 'column', gap: '16px', width }}>
284
- {['Cards', `A longer title in a card ${width}px wide`].map((title) => (
285
- <CardContainer key={title} spotlight="active">
286
- <Header
287
- as="h3"
288
- title={title}
289
- titleAction={{ href: '#target' }}
290
- action={{ label: 'Order card', icon: <Plus size={16} /> }}
291
- actionSecondary={{ 'aria-label': 'Settings', icon: <Settings size={16} /> }}
292
- />
293
- <Body>Content</Body>
294
- </CardContainer>
295
- ))}
296
- </div>
297
- ))}
298
- </div>
299
- ),
300
- };
301
-
302
- /**
303
- * The `Header` is a wrapping flex row, so in RTL the action cluster should move to the left and
304
- * the title's trailing chevron should point left. The `actionSecondary` slot must stay on the
305
- * inline-start side of `action` in both directions.
306
- *
307
- * Every card is rendered wide (480px, actions beside the title) and narrow (320px). At 320px the
308
- * short titles keep their actions beside them, and the long title's actions stack under it,
309
- * aligned to the inline end. The long title wraps, so its chevron should follow the last word on
310
- * the inline-end side in both directions.
311
- */
312
- export const RTLDiff: Story = {
313
- render: () => {
314
- const i18n = useRtlDiffI18n();
315
- const cards = (
316
- <>
317
- <CardContainer>
318
- <Header as="h3" title={i18n.cards} titleAction={{ href: '#target' }} />
319
- <Body>{i18n.content}</Body>
320
- </CardContainer>
321
-
322
- <CardContainer>
323
- <Header
324
- as="h3"
325
- title={i18n.cards}
326
- action={{ label: i18n.orderCard, icon: <Plus size={16} /> }}
327
- actionSecondary={{ 'aria-label': i18n.settings, icon: <Settings size={16} /> }}
328
- />
329
- <Body>{i18n.content}</Body>
330
- </CardContainer>
331
-
332
- <CardContainer spotlight="active">
333
- <Header
334
- as="h3"
335
- title={i18n.longTitle}
336
- titleAction={{ href: '#target' }}
337
- action={{ label: i18n.orderCard, icon: <Plus size={16} /> }}
338
- actionSecondary={{ 'aria-label': i18n.settings, icon: <Settings size={16} /> }}
339
- />
340
- <Body>{i18n.content}</Body>
341
- </CardContainer>
342
-
343
- <CardContainer spotlight="inactive">
344
- <Header as="h3" title={i18n.cards} />
345
- <Body>{i18n.content}</Body>
346
- </CardContainer>
347
- </>
348
- );
349
-
350
- return (
351
- <div style={{ display: 'flex', flexDirection: 'column', gap: '40px' }}>
352
- {[480, 320].map((width) => (
353
- <div key={width} style={{ display: 'flex', flexDirection: 'column', gap: '24px', width }}>
354
- {cards}
355
- </div>
356
- ))}
357
- </div>
358
- );
359
- },
360
- ...withRTLDiff({
361
- i18n: {
362
- cards: { en: 'Cards', ar: 'البطاقات' },
363
- content: {
364
- en: 'Your virtual card is ready to use.',
365
- ar: 'بطاقتك الافتراضية جاهزة للاستخدام.',
366
- },
367
- orderCard: { en: 'Order card', ar: 'اطلب بطاقة' },
368
- settings: { en: 'Card settings', ar: 'إعدادات البطاقة' },
369
- longTitle: {
370
- en: 'Cards, accounts and everything else you hold with us',
371
- ar: 'البطاقات والحسابات وكل ما تحتفظ به لدينا',
372
- },
373
- },
374
- }),
375
- };