@transferwise/components 46.37.0 → 46.38.0

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 (300) hide show
  1. package/README.md +1 -1
  2. package/build/index.js +159 -317
  3. package/build/index.js.map +1 -1
  4. package/build/index.mjs +154 -311
  5. package/build/index.mjs.map +1 -1
  6. package/build/main.css +127 -108
  7. package/build/styles/main.css +127 -108
  8. package/build/styles/uploadInput/UploadInput.css +25 -27
  9. package/build/styles/uploadInput/uploadButton/UploadButton.css +24 -38
  10. package/build/styles/uploadInput/uploadItem/UploadItem.css +81 -46
  11. package/build/types/actionButton/ActionButton.d.ts +2 -2
  12. package/build/types/actionButton/ActionButton.d.ts.map +1 -1
  13. package/build/types/actionOption/ActionOption.d.ts +0 -1
  14. package/build/types/actionOption/ActionOption.d.ts.map +1 -1
  15. package/build/types/alert/Alert.d.ts +0 -1
  16. package/build/types/alert/Alert.d.ts.map +1 -1
  17. package/build/types/alert/inlineMarkdown/InlineMarkdown.d.ts +4 -11
  18. package/build/types/alert/inlineMarkdown/InlineMarkdown.d.ts.map +1 -1
  19. package/build/types/alert/inlineMarkdown/index.d.ts +2 -1
  20. package/build/types/alert/inlineMarkdown/index.d.ts.map +1 -1
  21. package/build/types/avatar/Avatar.d.ts +0 -1
  22. package/build/types/avatar/Avatar.d.ts.map +1 -1
  23. package/build/types/avatar/colors/colors.d.ts.map +1 -1
  24. package/build/types/avatarWrapper/AvatarWrapper.d.ts +0 -1
  25. package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
  26. package/build/types/body/Body.d.ts +2 -2
  27. package/build/types/body/Body.d.ts.map +1 -1
  28. package/build/types/button/Button.d.ts +0 -1
  29. package/build/types/button/Button.d.ts.map +1 -1
  30. package/build/types/button/Button.messages.d.ts +3 -3
  31. package/build/types/button/classMap.d.ts +6 -6
  32. package/build/types/card/Card.d.ts +16 -20
  33. package/build/types/card/Card.d.ts.map +1 -1
  34. package/build/types/card/index.d.ts +2 -1
  35. package/build/types/card/index.d.ts.map +1 -1
  36. package/build/types/checkbox/Checkbox.d.ts +15 -20
  37. package/build/types/checkbox/Checkbox.d.ts.map +1 -1
  38. package/build/types/checkbox/index.d.ts +2 -2
  39. package/build/types/checkbox/index.d.ts.map +1 -1
  40. package/build/types/checkboxOption/CheckboxOption.d.ts +2 -3
  41. package/build/types/checkboxOption/CheckboxOption.d.ts.map +1 -1
  42. package/build/types/chevron/Chevron.d.ts +0 -1
  43. package/build/types/chevron/Chevron.d.ts.map +1 -1
  44. package/build/types/chips/Chip.d.ts +0 -1
  45. package/build/types/chips/Chip.d.ts.map +1 -1
  46. package/build/types/chips/Chips.d.ts +0 -1
  47. package/build/types/chips/Chips.d.ts.map +1 -1
  48. package/build/types/circularButton/CircularButton.d.ts +0 -1
  49. package/build/types/circularButton/CircularButton.d.ts.map +1 -1
  50. package/build/types/common/RadioButton/RadioButton.d.ts +0 -1
  51. package/build/types/common/RadioButton/RadioButton.d.ts.map +1 -1
  52. package/build/types/common/action/Action.d.ts +0 -1
  53. package/build/types/common/action/Action.d.ts.map +1 -1
  54. package/build/types/common/closeButton/CloseButton.d.ts +4 -5
  55. package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
  56. package/build/types/common/commonProps.d.ts +0 -1
  57. package/build/types/common/commonProps.d.ts.map +1 -1
  58. package/build/types/common/dateUtils/getMonthNames/getMonthNames.d.ts +1 -1
  59. package/build/types/common/dateUtils/getMonthNames/getMonthNames.d.ts.map +1 -1
  60. package/build/types/common/focusBoundary/FocusBoundary.d.ts +0 -1
  61. package/build/types/common/focusBoundary/FocusBoundary.d.ts.map +1 -1
  62. package/build/types/common/hooks/useDirection/useDirection.d.ts.map +1 -1
  63. package/build/types/common/hooks/useResizeObserver.d.ts +0 -1
  64. package/build/types/common/hooks/useResizeObserver.d.ts.map +1 -1
  65. package/build/types/common/panel/Panel.d.ts +8 -8
  66. package/build/types/common/panel/Panel.d.ts.map +1 -1
  67. package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts +0 -1
  68. package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts.map +1 -1
  69. package/build/types/common/responsivePanel/ResponsivePanel.d.ts +8 -9
  70. package/build/types/common/responsivePanel/ResponsivePanel.d.ts.map +1 -1
  71. package/build/types/criticalBanner/CriticalCommsBanner.d.ts +0 -1
  72. package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
  73. package/build/types/dateInput/DateInput.d.ts +0 -1
  74. package/build/types/dateInput/DateInput.d.ts.map +1 -1
  75. package/build/types/dateLookup/DateLookup.d.ts +1 -1
  76. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  77. package/build/types/dateLookup/dateHeader/DateHeader.d.ts +0 -1
  78. package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +1 -1
  79. package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts +0 -1
  80. package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts.map +1 -1
  81. package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts +0 -1
  82. package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts.map +1 -1
  83. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts +0 -1
  84. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts.map +1 -1
  85. package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts +0 -1
  86. package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts.map +1 -1
  87. package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts +0 -1
  88. package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -1
  89. package/build/types/dateLookup/tableLink/TableLink.d.ts +0 -1
  90. package/build/types/dateLookup/tableLink/TableLink.d.ts.map +1 -1
  91. package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts +0 -1
  92. package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts.map +1 -1
  93. package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts +0 -1
  94. package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts.map +1 -1
  95. package/build/types/decision/Decision.d.ts +1 -2
  96. package/build/types/decision/Decision.d.ts.map +1 -1
  97. package/build/types/definitionList/DefinitionList.d.ts +19 -24
  98. package/build/types/definitionList/DefinitionList.d.ts.map +1 -1
  99. package/build/types/definitionList/index.d.ts +2 -1
  100. package/build/types/definitionList/index.d.ts.map +1 -1
  101. package/build/types/dimmer/Dimmer.d.ts.map +1 -1
  102. package/build/types/drawer/Drawer.d.ts +18 -36
  103. package/build/types/drawer/Drawer.d.ts.map +1 -1
  104. package/build/types/drawer/index.d.ts +2 -1
  105. package/build/types/drawer/index.d.ts.map +1 -1
  106. package/build/types/dropFade/DropFade.d.ts.map +1 -1
  107. package/build/types/emphasis/Emphasis.d.ts +0 -1
  108. package/build/types/emphasis/Emphasis.d.ts.map +1 -1
  109. package/build/types/field/Field.d.ts +0 -1
  110. package/build/types/field/Field.d.ts.map +1 -1
  111. package/build/types/flowNavigation/FlowNavigation.d.ts +0 -1
  112. package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
  113. package/build/types/flowNavigation/backButton/BackButton.d.ts +3 -3
  114. package/build/types/flowNavigation/backButton/index.d.ts +1 -1
  115. package/build/types/flowNavigation/backButton/index.d.ts.map +1 -1
  116. package/build/types/header/Header.d.ts +0 -1
  117. package/build/types/header/Header.d.ts.map +1 -1
  118. package/build/types/image/Image.d.ts +0 -1
  119. package/build/types/image/Image.d.ts.map +1 -1
  120. package/build/types/index.d.ts +4 -0
  121. package/build/types/index.d.ts.map +1 -1
  122. package/build/types/info/Info.d.ts +0 -1
  123. package/build/types/info/Info.d.ts.map +1 -1
  124. package/build/types/inputWithDisplayFormat/InputWithDisplayFormat.d.ts +0 -1
  125. package/build/types/inputWithDisplayFormat/InputWithDisplayFormat.d.ts.map +1 -1
  126. package/build/types/inputs/Input.d.ts +0 -1
  127. package/build/types/inputs/Input.d.ts.map +1 -1
  128. package/build/types/inputs/InputGroup.d.ts +0 -1
  129. package/build/types/inputs/InputGroup.d.ts.map +1 -1
  130. package/build/types/inputs/SearchInput.d.ts +0 -1
  131. package/build/types/inputs/SearchInput.d.ts.map +1 -1
  132. package/build/types/inputs/SelectInput.d.ts +0 -1
  133. package/build/types/inputs/SelectInput.d.ts.map +1 -1
  134. package/build/types/inputs/TextArea.d.ts +0 -1
  135. package/build/types/inputs/TextArea.d.ts.map +1 -1
  136. package/build/types/inputs/_BottomSheet.d.ts +0 -1
  137. package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
  138. package/build/types/inputs/_ButtonInput.d.ts +0 -1
  139. package/build/types/inputs/_ButtonInput.d.ts.map +1 -1
  140. package/build/types/inputs/_Popover.d.ts +0 -1
  141. package/build/types/inputs/_Popover.d.ts.map +1 -1
  142. package/build/types/inputs/contexts.d.ts +0 -1
  143. package/build/types/inputs/contexts.d.ts.map +1 -1
  144. package/build/types/label/Label.d.ts +0 -1
  145. package/build/types/label/Label.d.ts.map +1 -1
  146. package/build/types/loader/Loader.d.ts +0 -1
  147. package/build/types/loader/Loader.d.ts.map +1 -1
  148. package/build/types/logo/Logo.d.ts +15 -23
  149. package/build/types/logo/Logo.d.ts.map +1 -1
  150. package/build/types/logo/index.d.ts +1 -2
  151. package/build/types/logo/index.d.ts.map +1 -1
  152. package/build/types/markdown/Markdown.d.ts +0 -1
  153. package/build/types/markdown/Markdown.d.ts.map +1 -1
  154. package/build/types/money/Money.d.ts +0 -1
  155. package/build/types/money/Money.d.ts.map +1 -1
  156. package/build/types/moneyInput/MoneyInput.d.ts +0 -1
  157. package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
  158. package/build/types/navigationOption/NavigationOption.d.ts +0 -1
  159. package/build/types/navigationOption/NavigationOption.d.ts.map +1 -1
  160. package/build/types/phoneNumberInput/PhoneNumberInput.d.ts +0 -1
  161. package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
  162. package/build/types/popover/Popover.d.ts +0 -1
  163. package/build/types/popover/Popover.d.ts.map +1 -1
  164. package/build/types/progress/Progress.d.ts +0 -1
  165. package/build/types/progress/Progress.d.ts.map +1 -1
  166. package/build/types/progressBar/ProgressBar.d.ts +0 -1
  167. package/build/types/progressBar/ProgressBar.d.ts.map +1 -1
  168. package/build/types/provider/Provider.d.ts +0 -1
  169. package/build/types/provider/Provider.d.ts.map +1 -1
  170. package/build/types/radio/Radio.d.ts +0 -1
  171. package/build/types/radio/Radio.d.ts.map +1 -1
  172. package/build/types/radioGroup/RadioGroup.d.ts +0 -1
  173. package/build/types/radioGroup/RadioGroup.d.ts.map +1 -1
  174. package/build/types/radioOption/RadioOption.d.ts +0 -1
  175. package/build/types/radioOption/RadioOption.d.ts.map +1 -1
  176. package/build/types/segmentedControl/SegmentedControl.d.ts +0 -1
  177. package/build/types/segmentedControl/SegmentedControl.d.ts.map +1 -1
  178. package/build/types/select/index.d.ts +1 -1
  179. package/build/types/select/index.d.ts.map +1 -1
  180. package/build/types/select/option/index.d.ts +1 -1
  181. package/build/types/select/option/index.d.ts.map +1 -1
  182. package/build/types/select/searchBox/SearchBox.d.ts +3 -3
  183. package/build/types/select/searchBox/SearchBox.d.ts.map +1 -1
  184. package/build/types/slidingPanel/SlidingPanel.d.ts +1 -1
  185. package/build/types/slidingPanel/SlidingPanel.d.ts.map +1 -1
  186. package/build/types/snackbar/Snackbar.d.ts +2 -1
  187. package/build/types/snackbar/Snackbar.d.ts.map +1 -1
  188. package/build/types/snackbar/SnackbarContext.d.ts +0 -1
  189. package/build/types/snackbar/SnackbarContext.d.ts.map +1 -1
  190. package/build/types/snackbar/SnackbarProvider.d.ts +0 -1
  191. package/build/types/snackbar/SnackbarProvider.d.ts.map +1 -1
  192. package/build/types/statusIcon/StatusIcon.d.ts +0 -1
  193. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  194. package/build/types/sticky/Sticky.d.ts +32 -4
  195. package/build/types/sticky/Sticky.d.ts.map +1 -1
  196. package/build/types/switchOption/SwitchOption.d.ts +0 -1
  197. package/build/types/switchOption/SwitchOption.d.ts.map +1 -1
  198. package/build/types/tabs/TabList.d.ts +1 -1
  199. package/build/types/tabs/TabPanel.d.ts +4 -4
  200. package/build/types/tabs/Tabs.d.ts.map +1 -1
  201. package/build/types/test-utils/story-config.d.ts +8 -0
  202. package/build/types/test-utils/story-config.d.ts.map +1 -1
  203. package/build/types/textareaWithDisplayFormat/TextareaWithDisplayFormat.d.ts +0 -1
  204. package/build/types/textareaWithDisplayFormat/TextareaWithDisplayFormat.d.ts.map +1 -1
  205. package/build/types/tile/Tile.d.ts +16 -37
  206. package/build/types/tile/Tile.d.ts.map +1 -1
  207. package/build/types/tile/index.d.ts +1 -1
  208. package/build/types/tile/index.d.ts.map +1 -1
  209. package/build/types/typeahead/Typeahead.d.ts.map +1 -1
  210. package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts +0 -1
  211. package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts.map +1 -1
  212. package/build/types/typeahead/util/highlight.d.ts +0 -1
  213. package/build/types/typeahead/util/highlight.d.ts.map +1 -1
  214. package/build/types/upload/Upload.d.ts.map +1 -1
  215. package/build/types/upload/Upload.messages.d.ts +20 -20
  216. package/build/types/upload/steps/completeStep/completeStep.d.ts +10 -10
  217. package/build/types/upload/steps/mediaUploadStep/mediaUploadStep.d.ts +8 -8
  218. package/build/types/upload/steps/processingStep/processingStep.d.ts +8 -8
  219. package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts +9 -9
  220. package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts.map +1 -1
  221. package/build/types/uploadInput/UploadInput.d.ts +0 -1
  222. package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
  223. package/build/types/uploadInput/types.d.ts +9 -1
  224. package/build/types/uploadInput/types.d.ts.map +1 -1
  225. package/build/types/uploadInput/uploadButton/UploadButton.d.ts +1 -6
  226. package/build/types/uploadInput/uploadButton/UploadButton.d.ts.map +1 -1
  227. package/build/types/uploadInput/uploadItem/UploadItem.d.ts +0 -1
  228. package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
  229. package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
  230. package/build/types/withNextPortal/withNextPortal.d.ts +0 -1
  231. package/build/types/withNextPortal/withNextPortal.d.ts.map +1 -1
  232. package/package.json +1 -2
  233. package/src/alert/inlineMarkdown/InlineMarkdown.tsx +13 -0
  234. package/src/alert/inlineMarkdown/index.ts +2 -0
  235. package/src/card/{Card.story.js → Card.story.tsx} +6 -15
  236. package/src/card/{Card.js → Card.tsx} +23 -34
  237. package/src/card/index.ts +2 -0
  238. package/src/checkbox/{Checkbox.spec.js → Checkbox.spec.tsx} +5 -5
  239. package/src/checkbox/{Checkbox.js → Checkbox.tsx} +19 -41
  240. package/src/checkbox/index.ts +2 -0
  241. package/src/decision/Decision.tsx +1 -1
  242. package/src/definitionList/{DefinitionList.story.js → DefinitionList.story.tsx} +22 -2
  243. package/src/definitionList/DefinitionList.tsx +95 -0
  244. package/src/definitionList/index.ts +2 -0
  245. package/src/drawer/{Drawer.rtl.spec.js → Drawer.rtl.spec.tsx} +4 -2
  246. package/src/drawer/{Drawer.story.js → Drawer.story.tsx} +20 -28
  247. package/src/drawer/{Drawer.js → Drawer.tsx} +26 -31
  248. package/src/drawer/index.ts +2 -0
  249. package/src/index.ts +4 -0
  250. package/src/logo/Logo.story.tsx +3 -6
  251. package/src/logo/{Logo.js → Logo.tsx} +25 -35
  252. package/src/logo/index.ts +1 -0
  253. package/src/main.css +127 -108
  254. package/src/section/Section.story.tsx +0 -2
  255. package/src/slidingPanel/SlidingPanel.spec.js +2 -1
  256. package/src/slidingPanel/SlidingPanel.tsx +3 -0
  257. package/src/snackbar/Snackbar.story.tsx +20 -100
  258. package/src/snackbar/Snackbar.tests.story.tsx +281 -0
  259. package/src/snackbar/Snackbar.tsx +8 -12
  260. package/src/sticky/Sticky.spec.tsx +71 -0
  261. package/src/sticky/Sticky.story.tsx +72 -15
  262. package/src/sticky/Sticky.tsx +49 -5
  263. package/src/test-utils/Parameters.d.ts +8 -0
  264. package/src/test-utils/story-config.ts +5 -0
  265. package/src/tile/{Tile.spec.js → Tile.spec.tsx} +1 -1
  266. package/src/tile/{Tile.js → Tile.tsx} +24 -35
  267. package/src/uploadInput/UploadInput.css +25 -27
  268. package/src/uploadInput/UploadInput.less +24 -23
  269. package/src/uploadInput/UploadInput.story.tsx +60 -10
  270. package/src/uploadInput/UploadInput.tsx +1 -4
  271. package/src/uploadInput/types.ts +11 -1
  272. package/src/uploadInput/uploadButton/UploadButton.css +24 -38
  273. package/src/uploadInput/uploadButton/UploadButton.less +27 -40
  274. package/src/uploadInput/uploadButton/UploadButton.spec.tsx +0 -1
  275. package/src/uploadInput/uploadButton/UploadButton.tsx +12 -37
  276. package/src/uploadInput/uploadItem/UploadItem.css +81 -46
  277. package/src/uploadInput/uploadItem/UploadItem.less +75 -40
  278. package/src/uploadInput/uploadItem/UploadItem.tsx +30 -25
  279. package/src/uploadInput/uploadItem/UploadItemBody.tsx +1 -1
  280. package/build/types/logo/logoTypes.d.ts +0 -6
  281. package/build/types/logo/logoTypes.d.ts.map +0 -1
  282. package/src/alert/inlineMarkdown/InlineMarkdown.js +0 -21
  283. package/src/alert/inlineMarkdown/index.js +0 -1
  284. package/src/card/index.js +0 -1
  285. package/src/checkbox/index.js +0 -3
  286. package/src/definitionList/DefinitionList.js +0 -100
  287. package/src/definitionList/index.js +0 -1
  288. package/src/drawer/index.js +0 -1
  289. package/src/logo/index.js +0 -2
  290. package/src/logo/logoTypes.ts +0 -6
  291. package/src/snackbar/Snackbar.spec.js +0 -112
  292. package/src/sticky/Sticky.spec.js +0 -34
  293. /package/src/card/{Card.spec.js → Card.spec.tsx} +0 -0
  294. /package/src/checkbox/__snapshots__/{Checkbox.spec.js.snap → Checkbox.spec.tsx.snap} +0 -0
  295. /package/src/drawer/__snapshots__/{Drawer.rtl.spec.js.snap → Drawer.rtl.spec.tsx.snap} +0 -0
  296. /package/src/logo/{Logo.spec.js → Logo.spec.tsx} +0 -0
  297. /package/src/logo/__snapshots__/{Logo.spec.js.snap → Logo.spec.tsx.snap} +0 -0
  298. /package/src/tile/{Tile.story.js → Tile.story.tsx} +0 -0
  299. /package/src/tile/__snapshots__/{Tile.spec.js.snap → Tile.spec.tsx.snap} +0 -0
  300. /package/src/tile/{index.js → index.ts} +0 -0
@@ -1,5 +1,4 @@
1
1
  import classNames from 'classnames';
2
- import PropTypes from 'prop-types';
3
2
  import { useId } from 'react';
4
3
 
5
4
  import { Position, Typography } from '../common';
@@ -10,7 +9,31 @@ import SlidingPanel from '../slidingPanel';
10
9
  import Title from '../title';
11
10
  import { logActionRequiredIf } from '../utilities';
12
11
 
13
- const Drawer = ({ children, className, footerContent, headerTitle, onClose, open, position }) => {
12
+ export interface DrawerProps {
13
+ /** The content to appear in the drawer body. */
14
+ children?: React.ReactNode;
15
+ className?: string;
16
+ /** The content to appear in the drawer footer. */
17
+ footerContent?: React.ReactNode;
18
+ /** The content to appear in the drawer header. */
19
+ headerTitle?: React.ReactNode;
20
+ /** The status of Drawer either open or not. */
21
+ open?: boolean;
22
+ /** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */
23
+ position?: `${Position.LEFT | Position.RIGHT | Position.BOTTOM}`;
24
+ /** The action to perform on close click. */
25
+ onClose?: (event: KeyboardEvent | React.MouseEvent) => void;
26
+ }
27
+
28
+ export default function Drawer({
29
+ children,
30
+ className,
31
+ footerContent,
32
+ headerTitle,
33
+ onClose,
34
+ open = false,
35
+ position = 'right',
36
+ }: DrawerProps) {
14
37
  logActionRequiredIf(
15
38
  'Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.',
16
39
  !onClose,
@@ -46,32 +69,4 @@ const Drawer = ({ children, className, footerContent, headerTitle, onClose, open
46
69
  </SlidingPanel>
47
70
  </Dimmer>
48
71
  );
49
- };
50
-
51
- Drawer.propTypes = {
52
- /** The content to appear in the drawer body. */
53
- children: PropTypes.node,
54
- className: PropTypes.string,
55
- /** The content to appear in the drawer footer. */
56
- footerContent: PropTypes.node,
57
- /** The content to appear in the drawer header. */
58
- headerTitle: PropTypes.node,
59
- /** The status of Drawer either open or not. */
60
- open: PropTypes.bool,
61
- /** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */
62
- position: PropTypes.oneOf(['left', 'right', 'bottom']),
63
- /** The action to perform on close click. */
64
- onClose: PropTypes.func,
65
- };
66
-
67
- Drawer.defaultProps = {
68
- children: null,
69
- className: undefined,
70
- footerContent: null,
71
- headerTitle: null,
72
- onClose: null,
73
- open: false,
74
- position: Position.RIGHT,
75
- };
76
-
77
- export default Drawer;
72
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from './Drawer';
2
+ export type { DrawerProps } from './Drawer';
package/src/index.ts CHANGED
@@ -6,7 +6,9 @@ export type { ActionOptionProps } from './actionOption';
6
6
  export type { AlertAction, AlertProps, AlertType } from './alert';
7
7
  export type { AvatarProps } from './avatar';
8
8
  export type { BadgeProps } from './badge';
9
+ export type { CardProps } from './card';
9
10
  export type { CarouselProps } from './carousel';
11
+ export type { CheckboxProps } from './checkbox';
10
12
  export type { CircularButtonProps } from './circularButton';
11
13
  export type {
12
14
  BodyTypes,
@@ -20,7 +22,9 @@ export type { BottomSheetProps } from './common/bottomSheet';
20
22
  export type { DateInputProps } from './dateInput';
21
23
  export type { DateLookupProps } from './dateLookup';
22
24
  export type { DecisionProps } from './decision/Decision';
25
+ export type { DefinitionListProps } from './definitionList';
23
26
  export type { DimmerProps } from './dimmer';
27
+ export type { DrawerProps } from './drawer';
24
28
  export type { EmphasisProps } from './emphasis';
25
29
  export type { FieldProps } from './field/Field';
26
30
  export type { InfoProps } from './info';
@@ -1,14 +1,11 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
 
3
- import Logo, { LogoType } from '.';
3
+ import Logo from '.';
4
4
 
5
5
  export default {
6
6
  component: Logo,
7
7
  title: 'Content/Logo',
8
- render: (args) => {
9
- const type = args.type as LogoType;
10
- const inverse = args.inverse as boolean;
11
-
8
+ render: ({ inverse, type }) => {
12
9
  return (
13
10
  <div className={`${inverse ? 'bg--dark' : ''} p-a-3`}>
14
11
  <Logo type={type} inverse={inverse} />
@@ -22,7 +19,7 @@ type Story = StoryObj<typeof Logo>;
22
19
 
23
20
  export const Basic: Story = {
24
21
  args: {
25
- type: LogoType.WISE,
22
+ type: 'WISE',
26
23
  inverse: false,
27
24
  },
28
25
  };
@@ -1,7 +1,5 @@
1
1
  import classNames from 'classnames';
2
- import PropTypes from 'prop-types';
3
2
 
4
- import { LogoType } from './logoTypes';
5
3
  import { ReactComponent as LogoFlagInverse } from './svg/flag-inverse.svg';
6
4
  import { ReactComponent as LogoFlagPlatformInverse } from './svg/flag-platform-white.svg';
7
5
  import { ReactComponent as LogoFlagPlatform } from './svg/flag-platform.svg';
@@ -24,44 +22,36 @@ const svgPaths = {
24
22
  WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse,
25
23
  };
26
24
 
27
- const Logo = ({ className, inverse, type }) => {
25
+ export enum LogoType {
26
+ WISE = 'WISE',
27
+ WISE_BUSINESS = 'WISE_BUSINESS',
28
+ WISE_PLATFORM = 'WISE_PLATFORM',
29
+ }
30
+
31
+ export interface LogoProps {
32
+ /** Extra classes applied to Logo */
33
+ className?: string;
34
+ /** If true, will use dark colours for dark on light theme */
35
+ inverse?: boolean;
36
+ /** What type of logo to display */
37
+ type?: `${LogoType}`;
38
+ }
39
+
40
+ const labelByType = {
41
+ WISE: 'Wise',
42
+ WISE_BUSINESS: 'Wise Business',
43
+ WISE_PLATFORM: 'Wise Platform',
44
+ } satisfies Record<`${LogoType}`, string>;
45
+
46
+ export default function Logo({ className, inverse, type = 'WISE' }: LogoProps) {
28
47
  const LogoSm =
29
- svgPaths[
30
- `WISE_FLAG${type === LogoType.WISE_PLATFORM ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`
31
- ];
48
+ svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];
32
49
  const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];
33
50
 
34
51
  return (
35
- <span
36
- aria-label={
37
- type === LogoType.WISE
38
- ? 'Wise'
39
- : 'Wise Business' | (type === LogoType.WISE_PLATFORM)
40
- ? 'Wise Platform'
41
- : 'Wise Business'
42
- }
43
- role="img"
44
- className={classNames(className, 'np-logo')}
45
- >
52
+ <span aria-label={labelByType[type]} role="img" className={classNames(className, 'np-logo')}>
46
53
  <LogoSm className="np-logo-svg np-logo-svg--size-sm" />
47
54
  <LogoMd className="np-logo-svg np-logo-svg--size-md" />
48
55
  </span>
49
56
  );
50
- };
51
-
52
- Logo.propTypes = {
53
- /** Extra classes applied to Logo */
54
- className: PropTypes.string,
55
- /** If true, will use dark colours for dark on light theme */
56
- inverse: PropTypes.bool,
57
- /** What type of logo to display */
58
- type: PropTypes.oneOf(['WISE', 'WISE_BUSINESS', 'WISE_PLATFORM']),
59
- };
60
-
61
- Logo.defaultProps = {
62
- className: undefined,
63
- inverse: false,
64
- type: LogoType.WISE,
65
- };
66
-
67
- export default Logo;
57
+ }
@@ -0,0 +1 @@
1
+ export { default, LogoType } from './Logo';
package/src/main.css CHANGED
@@ -5390,98 +5390,78 @@ html:not([dir="rtl"]) .np-navigation-option {
5390
5390
  .tw-droppable-sm {
5391
5391
  min-height: 245px;
5392
5392
  }
5393
- .np-upload-button {
5394
- width: 100%;
5395
- border: 0 !important;
5396
- padding: 12px 16px;
5397
- padding: var(--size-12) var(--size-16);
5398
- }
5399
- .np-upload-button.np-upload-accent {
5400
- color: #00a2dd;
5401
- color: var(--color-interactive-accent);
5402
- }
5403
- label.np-upload-button:not(.disabled):hover,
5404
- label.np-upload-button:not(.disabled):focus-visible,
5405
- label.np-upload-button:not(.disabled):active {
5406
- background-color: rgba(134,167,189,0.10196);
5407
- background-color: var(--color-background-neutral);
5408
- }
5409
- .np-theme-personal label.np-upload-button:not(.disabled):hover,
5410
- .np-theme-personal label.np-upload-button:not(.disabled):focus-visible,
5411
- .np-theme-personal label.np-upload-button:not(.disabled):active {
5412
- background-color: var(--color-background-screen-hover);
5413
- }
5414
- .np-theme-personal .disabled label.np-upload-button:not(.disabled):hover,
5415
- .np-theme-personal .disabled label.np-upload-button:not(.disabled):focus-visible,
5416
- .np-theme-personal .disabled label.np-upload-button:not(.disabled):active {
5417
- background-color: transparent;
5418
- }
5419
- .np-upload-button .np-upload-icon {
5420
- display: flex;
5421
- align-items: center;
5422
- }
5423
- .np-upload-button-container.droppable {
5424
- border: 0;
5393
+ .np-upload-button-container {
5394
+ border-style: solid;
5425
5395
  }
5426
5396
  .np-upload-button-container .droppable-card-content {
5427
5397
  display: flex;
5428
5398
  }
5429
- .np-theme-personal .np-upload-button-container .droppable-card-content {
5430
- border-radius: calc(10px - 1px);
5431
- border-radius: calc(var(--radius-small) - 1px);
5399
+ .np-upload-button-container.droppable-dropping {
5400
+ border-color: #c9cbce !important;
5401
+ border-color: var(--color-interactive-secondary) !important;
5432
5402
  }
5433
5403
  .np-upload-button-container input[type="file"] {
5434
5404
  opacity: 0;
5435
5405
  z-index: -1;
5436
5406
  position: absolute;
5437
5407
  }
5438
- .np-upload-button-container input[type="file"]:focus-visible + label {
5439
- background-color: rgba(134,167,189,0.10196);
5440
- background-color: var(--color-background-neutral);
5408
+ .np-upload-button-container .np-upload-button {
5409
+ border: none;
5441
5410
  }
5442
- .np-upload-input {
5443
- border: 1px solid #c9cbce;
5444
- border: 1px solid var(--color-interactive-secondary);
5445
- border-radius: 10px;
5446
- border-radius: var(--radius-small);
5411
+ .np-upload-button {
5412
+ width: 100%;
5413
+ padding: 16px;
5414
+ padding: var(--padding-small);
5415
+ border-radius: 0;
5447
5416
  }
5448
- .np-upload-input:has(:focus-visible) {
5449
- outline: var(--ring-outline-color) solid var(--ring-outline-width);
5450
- outline-offset: var(--ring-outline-offset);
5417
+ label.np-upload-button:not(.disabled):hover,
5418
+ label.np-upload-button:not(.disabled):active {
5419
+ background-color: var(--color-background-screen-hover);
5420
+ }
5421
+ .disabled label.np-upload-button:not(.disabled):hover,
5422
+ .disabled label.np-upload-button:not(.disabled):active {
5423
+ background-color: transparent;
5424
+ }
5425
+ .np-upload-button .media {
5426
+ align-items: flex-start;
5451
5427
  }
5452
5428
  .np-upload-input.form-control {
5453
5429
  height: auto;
5454
5430
  padding: 0;
5455
5431
  padding: initial;
5456
5432
  }
5457
- .np-theme-personal .np-upload-input {
5458
- border-radius: 10px;
5459
- border-radius: var(--radius-small);
5433
+ .np-upload-input > div:first-child,
5434
+ .np-upload-input > div:first-child .np-upload-item--single-file,
5435
+ .np-upload-input > div:first-child .np-upload-item--link {
5436
+ border-top-left-radius: 10px;
5437
+ border-top-left-radius: var(--radius-small);
5438
+ border-top-right-radius: 10px;
5439
+ border-top-right-radius: var(--radius-small);
5440
+ }
5441
+ .np-upload-input > div:last-child {
5442
+ border-bottom-left-radius: 10px;
5443
+ border-bottom-left-radius: var(--radius-small);
5444
+ border-bottom-right-radius: 10px;
5445
+ border-bottom-right-radius: var(--radius-small);
5460
5446
  }
5461
5447
  .np-theme-personal .np-upload-input.disabled .btn {
5462
5448
  cursor: inherit;
5463
5449
  }
5464
- .np-theme-personal .np-upload-input .np-upload-button {
5465
- border-radius: calc(10px - 1px);
5466
- border-radius: calc(var(--radius-small) - 1px);
5467
- padding: 16px;
5468
- padding: var(--padding-small);
5469
- }
5470
- .np-theme-personal .np-upload-input .np-upload-input--square-top {
5471
- border-top-right-radius: 0px;
5472
- border-top-left-radius: 0px;
5473
- }
5474
- .np-theme-personal .np-upload-input .np-upload-item__remove-button {
5475
- border-radius: 0;
5476
- border-radius: initial;
5477
- }
5478
5450
  .np-theme-personal .np-upload-input .np-upload-icon {
5479
5451
  color: var(--color-interactive-primary);
5480
5452
  }
5481
5453
  .np-theme-personal .np-upload-input .media-body {
5454
+ padding-right: 32px;
5455
+ padding-right: var(--size-32);
5482
5456
  color: var(--color-content-link);
5483
5457
  white-space: break-spaces;
5484
5458
  }
5459
+ @media (max-width: 320px) {
5460
+ .np-theme-personal .np-upload-input .media-body {
5461
+ padding-right: 64px;
5462
+ padding-right: var(--size-64);
5463
+ }
5464
+ }
5485
5465
  .np-theme-personal .np-upload-input .media-body .np-text-body-large-bold {
5486
5466
  -webkit-text-decoration: underline;
5487
5467
  text-decoration: underline;
@@ -5496,6 +5476,10 @@ label.np-upload-button:not(.disabled):active {
5496
5476
  .np-theme-personal .np-upload-input .media-body .text-negative {
5497
5477
  color: var(--color-sentiment-negative) !important;
5498
5478
  }
5479
+ .np-theme-personal .np-upload-input-errors {
5480
+ padding-left: 0;
5481
+ list-style-position: inside;
5482
+ }
5499
5483
  .np-theme-personal .np-upload-input .status-circle {
5500
5484
  width: 24px;
5501
5485
  width: var(--size-x-small);
@@ -5510,79 +5494,114 @@ label.np-upload-button:not(.disabled):active {
5510
5494
  height: var(--size-large);
5511
5495
  }
5512
5496
  }
5513
- .np-upload-item:not(:last-child)::after {
5497
+ .np-upload-item {
5498
+ border: 1px solid #c9cbce;
5499
+ border: 1px solid var(--color-interactive-secondary);
5500
+ }
5501
+ .np-upload-item:first-child ~ div:before {
5514
5502
  display: block;
5515
5503
  position: relative;
5516
- border-bottom: 1px solid rgba(0,0,0,0.10196);
5517
- border-bottom: 1px solid var(--color-border-neutral);
5504
+ height: 1px;
5505
+ background-color: rgba(0,0,0,0.10196);
5506
+ background-color: var(--color-border-neutral);
5518
5507
  content: " ";
5519
5508
  margin: 0 16px;
5520
5509
  margin: 0 var(--size-16);
5521
5510
  }
5522
- .np-theme-personal .np-upload-item:first-child a:hover,
5523
- .np-theme-personal .np-upload-item:first-child a:focus-visible,
5524
- .np-theme-personal .np-upload-item:first-child a:active {
5525
- border-top-left-radius: calc(10px - 1px);
5526
- border-top-left-radius: calc(var(--radius-small) - 1px);
5511
+ .np-upload-item:first-child ~ div {
5512
+ border-top: 0;
5513
+ }
5514
+ .np-upload-item:not(:last-child) {
5515
+ border-bottom: 0;
5516
+ }
5517
+ .np-upload-item.np-upload-item__link:hover:before,
5518
+ .np-upload-button-container:hover:before {
5519
+ margin: 0 !important;
5520
+ }
5521
+ .np-upload-item.np-upload-item__link:hover + div:before,
5522
+ .np-upload-button-container:hover + div:before {
5523
+ margin: 0 !important;
5524
+ }
5525
+ .np-upload-button-container:has(:focus-visible) {
5526
+ outline: var(--ring-outline-color) solid var(--ring-outline-width);
5527
+ outline-offset: var(--ring-outline-offset);
5528
+ border-color: transparent;
5529
+ outline-offset: -3px;
5527
5530
  }
5528
- .np-theme-personal .np-upload-item:first-child a:hover ~ .np-upload-item__remove-button,
5529
- .np-theme-personal .np-upload-item:first-child a:focus-visible ~ .np-upload-item__remove-button,
5530
- .np-theme-personal .np-upload-item:first-child a:active ~ .np-upload-item__remove-button {
5531
- border-top-right-radius: calc(10px - 1px);
5532
- border-top-right-radius: calc(var(--radius-small) - 1px);
5531
+ .np-upload-item--single-file:focus-visible,
5532
+ .np-upload-item--link:focus-visible,
5533
+ .np-upload-button-container:has(:focus-visible) {
5534
+ outline-width: 3px;
5533
5535
  }
5534
5536
  .np-upload-item__link a {
5535
5537
  flex: 1;
5536
5538
  -webkit-text-decoration: none;
5537
5539
  text-decoration: none;
5538
- outline: none;
5539
- border-top-right-radius: 0;
5540
- border-bottom-right-radius: 0;
5541
- }
5542
- .np-theme-personal .np-upload-item__link a {
5543
- border-radius: 0;
5544
- border-radius: initial;
5540
+ border-radius: inherit;
5545
5541
  }
5546
- .np-upload-item__link a.np-upload-item--single-file {
5547
- border-bottom-left-radius: calc(10px - 1px);
5548
- border-bottom-left-radius: calc(var(--radius-small) - 1px);
5542
+ .np-upload-item__link a:focus-visible {
5543
+ outline-offset: -2px;
5549
5544
  }
5550
5545
  .np-upload-item__link a:hover,
5551
- .np-upload-item__link a:focus-visible,
5552
5546
  .np-upload-item__link a:active {
5553
5547
  -webkit-text-decoration: none;
5554
5548
  text-decoration: none;
5555
5549
  background-color: rgba(134,167,189,0.10196);
5556
5550
  background-color: var(--color-background-neutral);
5557
5551
  }
5558
- .np-upload-item__link a:hover ~ .np-upload-item__remove-button,
5559
- .np-upload-item__link a:focus-visible ~ .np-upload-item__remove-button,
5560
- .np-upload-item__link a:active ~ .np-upload-item__remove-button {
5561
- background-color: rgba(134,167,189,0.10196);
5562
- background-color: var(--color-background-neutral);
5563
- }
5564
- .np-upload-item__link .np-upload-item__remove-button.np-upload-item--single-file {
5565
- border-bottom-right-radius: calc(10px - 1px);
5566
- border-bottom-right-radius: calc(var(--radius-small) - 1px);
5567
- }
5568
5552
  .np-upload-item__body {
5569
5553
  display: flex;
5570
5554
  align-items: center;
5571
5555
  justify-content: space-between;
5556
+ position: relative;
5557
+ border-radius: inherit;
5572
5558
  }
5573
5559
  .np-upload-item__remove-button {
5574
- flex-shrink: 0;
5575
- align-self: stretch;
5576
- padding: 12px 16px;
5577
- padding: var(--size-12) var(--size-16);
5578
- color: #c9cbce;
5579
- color: var(--color-interactive-secondary);
5580
- background: transparent;
5560
+ display: flex;
5561
+ align-items: center;
5562
+ justify-content: center;
5563
+ align-self: flex-start;
5564
+ position: absolute;
5565
+ height: 24px;
5566
+ height: var(--size-24);
5567
+ min-height: 0;
5568
+ width: 24px;
5569
+ width: var(--size-24);
5570
+ padding: 0;
5571
+ border-radius: 50% !important;
5572
+ outline-offset: 0 !important;
5573
+ background-color: rgba(134,167,189,0.10196);
5574
+ background-color: var(--color-background-neutral);
5575
+ color: var(--color-interactive-primary);
5576
+ right: 16px;
5577
+ right: var(--size-16);
5578
+ top: 16px;
5579
+ top: var(--size-16);
5580
+ transition: color, background-color 0.15s ease-in-out;
5581
+ }
5582
+ @media (max-width: 320px) {
5583
+ .np-upload-item__remove-button {
5584
+ top: 16px;
5585
+ top: var(--size-16);
5586
+ right: 16px;
5587
+ right: var(--size-16);
5588
+ height: 48px;
5589
+ height: var(--size-48);
5590
+ width: 48px;
5591
+ width: var(--size-48);
5592
+ }
5593
+ }
5594
+ .np-upload-item__remove-button:hover {
5595
+ background-color: var(--color-sentiment-negative);
5596
+ color: var(--color-contrast-overlay) !important;
5581
5597
  }
5582
- .np-upload-item__remove-button:hover,
5583
- .np-upload-item__remove-button:focus {
5584
- color: #d03238 !important;
5585
- color: var(--color-interactive-negative-hover) !important;
5598
+ .np-upload-item__remove-button:before {
5599
+ display: block;
5600
+ width: 44px;
5601
+ height: 44px;
5602
+ content: '';
5603
+ border-radius: 50%;
5604
+ position: absolute;
5586
5605
  }
5587
5606
  .np-progress {
5588
5607
  border-radius: 10px;
@@ -83,7 +83,6 @@ export const WithCards = () => {
83
83
  return (
84
84
  <Section>
85
85
  <Header title="Section with cards" />
86
- {/* @ts-expect-error TODO: remove once Card is migrated to TypeScript */}
87
86
  <Card
88
87
  title="What's in the box?!"
89
88
  details="Click me to reveal."
@@ -93,7 +92,6 @@ export const WithCards = () => {
93
92
  >
94
93
  <div>Hello there!</div>
95
94
  </Card>
96
- {/* @ts-expect-error TODO: remove once Card is migrated to TypeScript */}
97
95
  <Card
98
96
  title="What's in the box?!"
99
97
  details="Click me to reveal."
@@ -11,6 +11,7 @@ describe('SlidingPanel', () => {
11
11
  className: undefined,
12
12
  slidingPanelPositionFixed: false,
13
13
  showSlidingPanelBorder: false,
14
+ testId: undefined,
14
15
  };
15
16
 
16
17
  it('renders with right props', () => {
@@ -24,7 +25,7 @@ describe('SlidingPanel', () => {
24
25
 
25
26
  expect(cssTransition()).toHaveLength(1);
26
27
 
27
- expect(cssTransition().props()).toStrictEqual({
28
+ expect(cssTransition().props()).toEqual({
28
29
  className: 'sliding-panel sliding-panel--open-left',
29
30
  children: null,
30
31
  });
@@ -12,6 +12,7 @@ export interface SlidingPanelProps
12
12
  open: boolean;
13
13
  showSlidingPanelBorder?: boolean;
14
14
  slidingPanelPositionFixed?: boolean;
15
+ testId?: string;
15
16
  }
16
17
 
17
18
  const SlidingPanel = forwardRef(
@@ -23,6 +24,7 @@ const SlidingPanel = forwardRef(
23
24
  slidingPanelPositionFixed,
24
25
  className,
25
26
  children,
27
+ testId,
26
28
  ...rest
27
29
  }: Omit<SlidingPanelProps, 'ref'>,
28
30
  reference: React.ForwardedRef<HTMLDivElement | null>,
@@ -44,6 +46,7 @@ const SlidingPanel = forwardRef(
44
46
  >
45
47
  <div
46
48
  ref={localReference}
49
+ data-testid={testId}
47
50
  className={classNames(
48
51
  'sliding-panel',
49
52
  `sliding-panel--open-${position}`,