@transferwise/components 46.131.1 → 46.132.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 (72) hide show
  1. package/build/common/liveRegion/LiveRegion.js +46 -7
  2. package/build/common/liveRegion/LiveRegion.js.map +1 -1
  3. package/build/common/liveRegion/LiveRegion.mjs +46 -7
  4. package/build/common/liveRegion/LiveRegion.mjs.map +1 -1
  5. package/build/flowNavigation/FlowNavigation.js +1 -0
  6. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  7. package/build/flowNavigation/FlowNavigation.mjs +1 -0
  8. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  9. package/build/main.css +52 -1
  10. package/build/overlayHeader/OverlayHeader.js +1 -0
  11. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  12. package/build/overlayHeader/OverlayHeader.mjs +1 -0
  13. package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
  14. package/build/prompt/InfoPrompt/InfoPrompt.js +2 -0
  15. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  16. package/build/prompt/InfoPrompt/InfoPrompt.mjs +2 -0
  17. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  18. package/build/styles/common/liveRegion/LiveRegion.css +3 -0
  19. package/build/styles/css/neptune.css +48 -1
  20. package/build/styles/main.css +52 -1
  21. package/build/styles/styles/less/neptune.css +48 -1
  22. package/build/types/common/liveRegion/LiveRegion.d.ts +5 -2
  23. package/build/types/common/liveRegion/LiveRegion.d.ts.map +1 -1
  24. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
  25. package/package.json +2 -2
  26. package/src/alert/Alert.story.tsx +0 -6
  27. package/src/button/_stories/Button.story.tsx +0 -5
  28. package/src/checkboxButton/CheckboxButton.story.tsx +0 -1
  29. package/src/circularButton/CircularButton.story.tsx +0 -1
  30. package/src/common/liveRegion/LiveRegion.css +3 -0
  31. package/src/common/liveRegion/LiveRegion.less +3 -0
  32. package/src/common/liveRegion/LiveRegion.test.tsx +69 -2
  33. package/src/common/liveRegion/LiveRegion.tsx +77 -8
  34. package/src/dateLookup/DateLookup.test.story.tsx +0 -7
  35. package/src/dateLookup/DateLookup.test.tsx +22 -0
  36. package/src/display/Display.story.tsx +15 -1
  37. package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +0 -1
  38. package/src/header/Header.story.tsx +0 -5
  39. package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +0 -1
  40. package/src/inputs/SelectInput/_stories/SelectInput.docs.mdx +62 -0
  41. package/src/inputs/SelectInput/_stories/SelectInput.story.tsx +796 -220
  42. package/src/inputs/SelectInput/_stories/SelectInput.test.story.tsx +433 -4
  43. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +0 -5
  44. package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +0 -5
  45. package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +0 -5
  46. package/src/listItem/Button/ListItemButton.story.tsx +0 -5
  47. package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +0 -5
  48. package/src/listItem/IconButton/ListItemIconButton.story.tsx +0 -5
  49. package/src/listItem/Image/ListItemImage.story.tsx +0 -5
  50. package/src/listItem/Navigation/ListItemNavigation.story.tsx +0 -5
  51. package/src/listItem/Prompt/ListItemPrompt.story.tsx +1 -5
  52. package/src/listItem/Radio/ListItemRadio.story.tsx +0 -5
  53. package/src/listItem/Switch/ListItemSwitch.story.tsx +0 -5
  54. package/src/listItem/_stories/ListItem.disabled.story.tsx +0 -1
  55. package/src/listItem/_stories/ListItem.scenarios.story.tsx +0 -1
  56. package/src/listItem/_stories/ListItem.story.tsx +0 -5
  57. package/src/main.css +52 -1
  58. package/src/main.less +1 -0
  59. package/src/modal/Modal.story.tsx +0 -1
  60. package/src/popover/Popover.story.tsx +0 -1
  61. package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +0 -5
  62. package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +0 -5
  63. package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +142 -5
  64. package/src/prompt/InfoPrompt/InfoPrompt.test.tsx +11 -6
  65. package/src/prompt/InfoPrompt/InfoPrompt.tsx +2 -1
  66. package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +0 -5
  67. package/src/provider/theme/ThemeProvider.story.tsx +8 -0
  68. package/src/sentimentSurface/SentimentSurface.story.tsx +0 -5
  69. package/src/sticky/Sticky.story.tsx +0 -1
  70. package/src/styles/less/core/_typography.less +15 -2
  71. package/src/styles/less/neptune.css +48 -1
  72. package/src/tokens/tokens.story.tsx +1 -1
@@ -4,6 +4,60 @@ import { Meta } from '@storybook/addon-docs/blocks';
4
4
 
5
5
  # Accessibility
6
6
 
7
+ ## Keyboard navigation
8
+
9
+ The component uses [Headless UI Listbox](https://headlessui.com/react/listbox) under the hood, which provides full keyboard support out of the box.
10
+
11
+ <table>
12
+ <thead>
13
+ <tr>
14
+ <th>Key</th>
15
+ <th>Action</th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <tr>
20
+ <td>
21
+ <code>Tab</code> / click
22
+ </td>
23
+ <td>Focus the trigger button</td>
24
+ </tr>
25
+ <tr>
26
+ <td>
27
+ <code>Enter</code> / <code>Space</code>
28
+ </td>
29
+ <td>Open the listbox</td>
30
+ </tr>
31
+ <tr>
32
+ <td>
33
+ <code>↑</code> / <code>↓</code>
34
+ </td>
35
+ <td>Navigate options</td>
36
+ </tr>
37
+ <tr>
38
+ <td>
39
+ <code>Enter</code>
40
+ </td>
41
+ <td>Select the focused option</td>
42
+ </tr>
43
+ <tr>
44
+ <td>
45
+ <code>Escape</code> / <code>Tab</code>
46
+ </td>
47
+ <td>Close without selecting</td>
48
+ </tr>
49
+ <tr>
50
+ <td>
51
+ Typing (when <code>filterable</code>)
52
+ </td>
53
+ <td>
54
+ Narrows the list in the search input; <code>↑</code> / <code>↓</code> still navigate the
55
+ filtered results
56
+ </td>
57
+ </tr>
58
+ </tbody>
59
+ </table>
60
+
7
61
  ## Labelling
8
62
 
9
63
  In order for the `<SelectInput />` to be considered accessible, it must be provided with a matching label, preferably via the <a href="/?path=/docs/field--docs">Field</a> component.
@@ -18,3 +72,11 @@ Additionally, the `listbox` container that holds all the options is also expecte
18
72
  3. Correctly paired input `<label />` text, ideally via the `Field` component.
19
73
 
20
74
  > Using option group heading is possible but complicated as we can have multiple groups, and those are not necessarily rendered consistently if search or virtualisation are enabled.
75
+
76
+ ## Custom triggers
77
+
78
+ When using `renderTrigger`, the interactive element **must** be `SelectInputTriggerButton`. A plain `<button>` will not receive the ARIA attributes (`aria-expanded`, `aria-haspopup`, `aria-controls`) that the component manages, breaking screen reader announcements for the listbox state.
79
+
80
+ ## Multiple selection
81
+
82
+ With `multiple`, selected items show a visible checkmark in the list. The trigger content is **consumer-controlled** via the `withinTrigger` boolean passed to `renderValue` — consumers are responsible for communicating the current selection accessibly inside the trigger (e.g. `"USD, EUR"` or `"3 currencies selected"`).