@transferwise/components 46.103.1 → 46.105.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 (250) hide show
  1. package/build/header/Header.js +60 -43
  2. package/build/header/Header.js.map +1 -1
  3. package/build/header/Header.mjs +57 -43
  4. package/build/header/Header.mjs.map +1 -1
  5. package/build/i18n/cs.json +2 -0
  6. package/build/i18n/cs.json.js +2 -0
  7. package/build/i18n/cs.json.js.map +1 -1
  8. package/build/i18n/cs.json.mjs +2 -0
  9. package/build/i18n/cs.json.mjs.map +1 -1
  10. package/build/i18n/es.json +2 -0
  11. package/build/i18n/es.json.js +2 -0
  12. package/build/i18n/es.json.js.map +1 -1
  13. package/build/i18n/es.json.mjs +2 -0
  14. package/build/i18n/es.json.mjs.map +1 -1
  15. package/build/i18n/th.json +2 -0
  16. package/build/i18n/th.json.js +2 -0
  17. package/build/i18n/th.json.js.map +1 -1
  18. package/build/i18n/th.json.mjs +2 -0
  19. package/build/i18n/th.json.mjs.map +1 -1
  20. package/build/index.js +3 -1
  21. package/build/index.js.map +1 -1
  22. package/build/index.mjs +2 -1
  23. package/build/index.mjs.map +1 -1
  24. package/build/inputs/SelectInput.js +1 -1
  25. package/build/inputs/SelectInput.js.map +1 -1
  26. package/build/inputs/SelectInput.mjs +1 -1
  27. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +56 -0
  28. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -0
  29. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +54 -0
  30. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -0
  31. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +23 -0
  32. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -0
  33. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +21 -0
  34. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -0
  35. package/build/listItem/AvatarView/ListItemAvatarView.js +23 -0
  36. package/build/listItem/AvatarView/ListItemAvatarView.js.map +1 -0
  37. package/build/listItem/AvatarView/ListItemAvatarView.mjs +21 -0
  38. package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +1 -0
  39. package/build/listItem/Button/ListItemButton.js +43 -0
  40. package/build/listItem/Button/ListItemButton.js.map +1 -0
  41. package/build/listItem/Button/ListItemButton.mjs +41 -0
  42. package/build/listItem/Button/ListItemButton.mjs.map +1 -0
  43. package/build/listItem/Checkbox/ListItemCheckbox.js +30 -0
  44. package/build/listItem/Checkbox/ListItemCheckbox.js.map +1 -0
  45. package/build/listItem/Checkbox/ListItemCheckbox.mjs +28 -0
  46. package/build/listItem/Checkbox/ListItemCheckbox.mjs.map +1 -0
  47. package/build/listItem/IconButton/ListItemIconButton.js +56 -0
  48. package/build/listItem/IconButton/ListItemIconButton.js.map +1 -0
  49. package/build/listItem/IconButton/ListItemIconButton.mjs +54 -0
  50. package/build/listItem/IconButton/ListItemIconButton.mjs.map +1 -0
  51. package/build/listItem/Image/ListItemImage.js +31 -0
  52. package/build/listItem/Image/ListItemImage.js.map +1 -0
  53. package/build/listItem/Image/ListItemImage.mjs +29 -0
  54. package/build/listItem/Image/ListItemImage.mjs.map +1 -0
  55. package/build/listItem/ListItem.js +311 -0
  56. package/build/listItem/ListItem.js.map +1 -0
  57. package/build/listItem/ListItem.mjs +306 -0
  58. package/build/listItem/ListItem.mjs.map +1 -0
  59. package/build/listItem/ListItemContext.js +8 -0
  60. package/build/listItem/ListItemContext.js.map +1 -0
  61. package/build/listItem/ListItemContext.mjs +6 -0
  62. package/build/listItem/ListItemContext.mjs.map +1 -0
  63. package/build/listItem/Navigation/ListItemNavigation.js +44 -0
  64. package/build/listItem/Navigation/ListItemNavigation.js.map +1 -0
  65. package/build/listItem/Navigation/ListItemNavigation.mjs +42 -0
  66. package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -0
  67. package/build/listItem/Prompt/ListItemPrompt.js +59 -0
  68. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -0
  69. package/build/listItem/Prompt/ListItemPrompt.mjs +54 -0
  70. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -0
  71. package/build/listItem/Radio/ListItemRadio.js +30 -0
  72. package/build/listItem/Radio/ListItemRadio.js.map +1 -0
  73. package/build/listItem/Radio/ListItemRadio.mjs +28 -0
  74. package/build/listItem/Radio/ListItemRadio.mjs.map +1 -0
  75. package/build/listItem/Switch/ListItemSwitch.js +30 -0
  76. package/build/listItem/Switch/ListItemSwitch.js.map +1 -0
  77. package/build/listItem/Switch/ListItemSwitch.mjs +28 -0
  78. package/build/listItem/Switch/ListItemSwitch.mjs.map +1 -0
  79. package/build/listItem/useListItemControl.js +22 -0
  80. package/build/listItem/useListItemControl.js.map +1 -0
  81. package/build/listItem/useListItemControl.mjs +20 -0
  82. package/build/listItem/useListItemControl.mjs.map +1 -0
  83. package/build/listItem/useListItemMedia.js +21 -0
  84. package/build/listItem/useListItemMedia.js.map +1 -0
  85. package/build/listItem/useListItemMedia.mjs +19 -0
  86. package/build/listItem/useListItemMedia.mjs.map +1 -0
  87. package/build/main.css +794 -14
  88. package/build/styles/header/Header.css +21 -14
  89. package/build/styles/listItem/ListItem.css +773 -0
  90. package/build/styles/listItem/ListItem.grid.css +370 -0
  91. package/build/styles/listItem/Prompt/ListItemPrompt.css +157 -0
  92. package/build/styles/main.css +794 -14
  93. package/build/title/Title.js +10 -4
  94. package/build/title/Title.js.map +1 -1
  95. package/build/title/Title.mjs +6 -4
  96. package/build/title/Title.mjs.map +1 -1
  97. package/build/types/header/Header.d.ts +27 -11
  98. package/build/types/header/Header.d.ts.map +1 -1
  99. package/build/types/header/index.d.ts +1 -0
  100. package/build/types/header/index.d.ts.map +1 -1
  101. package/build/types/index.d.ts +3 -0
  102. package/build/types/index.d.ts.map +1 -1
  103. package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts +15 -0
  104. package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts.map +1 -0
  105. package/build/types/listItem/AdditionalInfo/index.d.ts +3 -0
  106. package/build/types/listItem/AdditionalInfo/index.d.ts.map +1 -0
  107. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts +18 -0
  108. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +1 -0
  109. package/build/types/listItem/AvatarLayout/index.d.ts +3 -0
  110. package/build/types/listItem/AvatarLayout/index.d.ts.map +1 -0
  111. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts +16 -0
  112. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +1 -0
  113. package/build/types/listItem/AvatarView/index.d.ts +3 -0
  114. package/build/types/listItem/AvatarView/index.d.ts.map +1 -0
  115. package/build/types/listItem/Button/ListItemButton.d.ts +20 -0
  116. package/build/types/listItem/Button/ListItemButton.d.ts.map +1 -0
  117. package/build/types/listItem/Button/index.d.ts +3 -0
  118. package/build/types/listItem/Button/index.d.ts.map +1 -0
  119. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts +14 -0
  120. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts.map +1 -0
  121. package/build/types/listItem/Checkbox/index.d.ts +3 -0
  122. package/build/types/listItem/Checkbox/index.d.ts.map +1 -0
  123. package/build/types/listItem/IconButton/ListItemIconButton.d.ts +18 -0
  124. package/build/types/listItem/IconButton/ListItemIconButton.d.ts.map +1 -0
  125. package/build/types/listItem/IconButton/index.d.ts +3 -0
  126. package/build/types/listItem/IconButton/index.d.ts.map +1 -0
  127. package/build/types/listItem/Image/ListItemImage.d.ts +25 -0
  128. package/build/types/listItem/Image/ListItemImage.d.ts.map +1 -0
  129. package/build/types/listItem/Image/index.d.ts +3 -0
  130. package/build/types/listItem/Image/index.d.ts.map +1 -0
  131. package/build/types/listItem/ListItem.d.ts +111 -0
  132. package/build/types/listItem/ListItem.d.ts.map +1 -0
  133. package/build/types/listItem/ListItemContext.d.ts +21 -0
  134. package/build/types/listItem/ListItemContext.d.ts.map +1 -0
  135. package/build/types/listItem/Navigation/ListItemNavigation.d.ts +15 -0
  136. package/build/types/listItem/Navigation/ListItemNavigation.d.ts.map +1 -0
  137. package/build/types/listItem/Navigation/index.d.ts +3 -0
  138. package/build/types/listItem/Navigation/index.d.ts.map +1 -0
  139. package/build/types/listItem/Prompt/ListItemPrompt.d.ts +16 -0
  140. package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +1 -0
  141. package/build/types/listItem/Prompt/index.d.ts +3 -0
  142. package/build/types/listItem/Prompt/index.d.ts.map +1 -0
  143. package/build/types/listItem/Radio/ListItemRadio.d.ts +14 -0
  144. package/build/types/listItem/Radio/ListItemRadio.d.ts.map +1 -0
  145. package/build/types/listItem/Radio/index.d.ts +3 -0
  146. package/build/types/listItem/Radio/index.d.ts.map +1 -0
  147. package/build/types/listItem/Switch/ListItemSwitch.d.ts +14 -0
  148. package/build/types/listItem/Switch/ListItemSwitch.d.ts.map +1 -0
  149. package/build/types/listItem/Switch/index.d.ts +3 -0
  150. package/build/types/listItem/Switch/index.d.ts.map +1 -0
  151. package/build/types/listItem/_stories/helpers.d.ts +27 -0
  152. package/build/types/listItem/_stories/helpers.d.ts.map +1 -0
  153. package/build/types/listItem/_stories/subcomponents.d.ts +18 -0
  154. package/build/types/listItem/_stories/subcomponents.d.ts.map +1 -0
  155. package/build/types/listItem/index.d.ts +14 -0
  156. package/build/types/listItem/index.d.ts.map +1 -0
  157. package/build/types/listItem/test-utils.d.ts +7 -0
  158. package/build/types/listItem/test-utils.d.ts.map +1 -0
  159. package/build/types/listItem/useListItemControl.d.ts +5 -0
  160. package/build/types/listItem/useListItemControl.d.ts.map +1 -0
  161. package/build/types/listItem/useListItemMedia.d.ts +6 -0
  162. package/build/types/listItem/useListItemMedia.d.ts.map +1 -0
  163. package/build/types/title/Title.d.ts +4 -5
  164. package/build/types/title/Title.d.ts.map +1 -1
  165. package/package.json +3 -3
  166. package/src/button/Button.spec.tsx +25 -1
  167. package/src/button/Button.story.tsx +1 -0
  168. package/src/header/Header.accessibility.docs.mdx +85 -0
  169. package/src/header/Header.css +21 -14
  170. package/src/header/Header.less +17 -10
  171. package/src/header/Header.spec.tsx +68 -50
  172. package/src/header/Header.story.tsx +190 -36
  173. package/src/header/Header.tsx +96 -65
  174. package/src/header/index.ts +1 -0
  175. package/src/i18n/cs.json +2 -0
  176. package/src/i18n/es.json +2 -0
  177. package/src/i18n/th.json +2 -0
  178. package/src/iconButton/iconButton.spec.tsx +31 -0
  179. package/src/index.ts +16 -0
  180. package/src/legacylistItem/LegacyListItem.story.tsx +1 -1
  181. package/src/legacylistItem/LegacyListItem.tests.story.tsx +2 -1
  182. package/src/list/List.story.tsx +13 -3
  183. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.spec.tsx +56 -0
  184. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +198 -0
  185. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.tsx +36 -0
  186. package/src/listItem/AdditionalInfo/index.ts +2 -0
  187. package/src/listItem/AvatarLayout/ListItemAvatarLayout.spec.tsx +59 -0
  188. package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +124 -0
  189. package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +27 -0
  190. package/src/listItem/AvatarLayout/index.ts +2 -0
  191. package/src/listItem/AvatarView/ListItemAvatarView.spec.tsx +75 -0
  192. package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +339 -0
  193. package/src/listItem/AvatarView/ListItemAvatarView.tsx +27 -0
  194. package/src/listItem/AvatarView/index.ts +2 -0
  195. package/src/listItem/Button/ListItemButton.spec.tsx +90 -0
  196. package/src/listItem/Button/ListItemButton.story.tsx +473 -0
  197. package/src/listItem/Button/ListItemButton.tsx +56 -0
  198. package/src/listItem/Button/index.ts +2 -0
  199. package/src/listItem/Checkbox/ListItemCheckbox.spec.tsx +82 -0
  200. package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +128 -0
  201. package/src/listItem/Checkbox/ListItemCheckbox.tsx +33 -0
  202. package/src/listItem/Checkbox/index.ts +2 -0
  203. package/src/listItem/IconButton/ListItemIconButton.spec.tsx +131 -0
  204. package/src/listItem/IconButton/ListItemIconButton.story.tsx +284 -0
  205. package/src/listItem/IconButton/ListItemIconButton.tsx +73 -0
  206. package/src/listItem/IconButton/index.ts +2 -0
  207. package/src/listItem/Image/ListItemImage.spec.tsx +30 -0
  208. package/src/listItem/Image/ListItemImage.story.tsx +80 -0
  209. package/src/listItem/Image/ListItemImage.tsx +46 -0
  210. package/src/listItem/Image/index.ts +2 -0
  211. package/src/listItem/ListItem.css +773 -0
  212. package/src/listItem/ListItem.grid.css +370 -0
  213. package/src/listItem/ListItem.grid.less +622 -0
  214. package/src/listItem/ListItem.less +291 -0
  215. package/src/listItem/ListItem.spec.tsx +1511 -0
  216. package/src/listItem/ListItem.tsx +440 -0
  217. package/src/listItem/ListItemContext.tsx +26 -0
  218. package/src/listItem/Navigation/ListItemNavigation.spec.tsx +67 -0
  219. package/src/listItem/Navigation/ListItemNavigation.story.tsx +114 -0
  220. package/src/listItem/Navigation/ListItemNavigation.tsx +39 -0
  221. package/src/listItem/Navigation/index.ts +2 -0
  222. package/src/listItem/Prompt/ListItemPrompt.css +157 -0
  223. package/src/listItem/Prompt/ListItemPrompt.less +134 -0
  224. package/src/listItem/Prompt/ListItemPrompt.spec.tsx +36 -0
  225. package/src/listItem/Prompt/ListItemPrompt.story.tsx +204 -0
  226. package/src/listItem/Prompt/ListItemPrompt.tsx +32 -0
  227. package/src/listItem/Prompt/index.ts +2 -0
  228. package/src/listItem/Radio/ListItemRadio.spec.tsx +66 -0
  229. package/src/listItem/Radio/ListItemRadio.story.tsx +111 -0
  230. package/src/listItem/Radio/ListItemRadio.tsx +33 -0
  231. package/src/listItem/Radio/index.ts +2 -0
  232. package/src/listItem/Switch/ListItemSwitch.spec.tsx +47 -0
  233. package/src/listItem/Switch/ListItemSwitch.story.tsx +79 -0
  234. package/src/listItem/Switch/ListItemSwitch.tsx +33 -0
  235. package/src/listItem/Switch/index.ts +2 -0
  236. package/src/listItem/_stories/ListItem.focus.test.story.tsx +265 -0
  237. package/src/listItem/_stories/ListItem.layout.test.story.tsx +374 -0
  238. package/src/listItem/_stories/ListItem.scenarios.story.tsx +228 -0
  239. package/src/listItem/_stories/ListItem.story.tsx +774 -0
  240. package/src/listItem/_stories/ListItem.variants.test.story.tsx +274 -0
  241. package/src/listItem/_stories/helpers.tsx +53 -0
  242. package/src/listItem/_stories/subcomponents.tsx +141 -0
  243. package/src/listItem/index.ts +14 -0
  244. package/src/listItem/test-utils.tsx +33 -0
  245. package/src/listItem/useListItemControl.tsx +18 -0
  246. package/src/listItem/useListItemMedia.tsx +16 -0
  247. package/src/main.css +794 -14
  248. package/src/main.less +1 -0
  249. package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +15 -4
  250. package/src/title/Title.tsx +25 -12
@@ -0,0 +1,111 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ListItemIconButtonProps } from './IconButton';
3
+ import { type ListItemCheckboxProps } from './Checkbox';
4
+ import { type ListItemNavigationProps } from './Navigation';
5
+ import { type ListItemButtonProps } from './Button';
6
+ import { type ListItemRadioProps } from './Radio';
7
+ import { type ListItemSwitchProps } from './Switch';
8
+ export type ListItemTypes = 'non-interactive' | 'navigation' | 'radio' | 'checkbox' | 'switch' | 'button' | 'icon-button';
9
+ export type ListItemControlProps = ListItemNavigationProps | ListItemCheckboxProps | ListItemButtonProps | ListItemIconButtonProps | ListItemRadioProps | ListItemSwitchProps;
10
+ export type ListItemProps = {
11
+ as?: 'li' | 'div';
12
+ /**
13
+ * Swaps vertical hierarchy of title and subtitle and their corresponding right values.
14
+ */
15
+ inverted?: boolean;
16
+ disabled?: boolean;
17
+ /**
18
+ * Highlights the list item as an action to be taken or already taken. <br />
19
+ */
20
+ spotlight?: 'active' | 'inactive';
21
+ title: ReactNode;
22
+ subtitle?: ReactNode;
23
+ /**
24
+ * Requires `<ListItem.AdditionalInfo />` component as a sole child. <br />
25
+ * Can be only rendered if `subtitle` is also provided.
26
+ */
27
+ additionalInfo?: ReactNode;
28
+ valueTitle?: ReactNode;
29
+ valueSubtitle?: ReactNode;
30
+ /**
31
+ * Requires one of the following as a sole child: <br />
32
+ * `<ListItem.AvatarView />`,
33
+ * `<ListItem.AvatarLayout />` or
34
+ * `<ListItem.Image />`
35
+ */
36
+ media?: ReactNode;
37
+ /**
38
+ * Requires one of the following as a sole child: <br/>
39
+ * `<ListItem.Button />`, <br/>
40
+ * `<ListItem.Checkbox />`, <br/>
41
+ * `<ListItem.IconButton />`, <br/>
42
+ * `<ListItem.Navigation />`, <br/>
43
+ * `<ListItem.Radio />`, or
44
+ * `<ListItem.Switch />`
45
+ */
46
+ control?: ReactNode;
47
+ /**
48
+ * Requires `<ListItem.Prompt />` component as a sole child.
49
+ */
50
+ prompt?: ReactNode;
51
+ className?: string;
52
+ /**
53
+ * A number between `0–100` which resolves to a `fr` value of a `grid-template-columns` declaration. E.g. `valueColumnWidth={25}` will result in a `75fr 25fr`. <br />
54
+ * Controls the width ratio of left side content (title and subtitle) to the right side content.
55
+ */
56
+ valueColumnWidth?: number;
57
+ id?: string;
58
+ };
59
+ /**
60
+ * @see [Design documentation](https://wise.design/components/list-item)
61
+ * @see [Storybook documentation](https://storybook.wise.design/?path=/docs/content-listitem--docs)
62
+ */
63
+ export declare const ListItem: {
64
+ ({ as: ListItemElement, title, subtitle, additionalInfo, prompt, inverted, media, spotlight, valueTitle, valueSubtitle, control, disabled, className, valueColumnWidth, id, }: ListItemProps): import("react").JSX.Element;
65
+ Image: {
66
+ ({ alt, size, className, ...props }: import("./Image").ListItemImageProps): import("react").JSX.Element;
67
+ displayName: string;
68
+ };
69
+ AvatarView: {
70
+ ({ className, size, ...props }: import("./AvatarView").ListItemAvatarViewProps): import("react").JSX.Element;
71
+ displayName: string;
72
+ };
73
+ AvatarLayout: {
74
+ ({ className, size, ...props }: import("./AvatarLayout").ListItemAvatarLayoutProps): import("react").JSX.Element;
75
+ displayName: string;
76
+ };
77
+ AdditionalInfo: {
78
+ ({ children, action }: import("./AdditionalInfo").ListItemAdditionalInfoProps): import("react").JSX.Element;
79
+ displayName: string;
80
+ };
81
+ Checkbox: {
82
+ (props: ListItemCheckboxProps): import("react").JSX.Element;
83
+ displayName: string;
84
+ };
85
+ Radio: {
86
+ (props: ListItemRadioProps): import("react").JSX.Element;
87
+ displayName: string;
88
+ };
89
+ IconButton: {
90
+ ({ priority, "aria-label": ariaLabel, ...props }: ListItemIconButtonProps): import("react").JSX.Element;
91
+ displayName: string;
92
+ };
93
+ Navigation: {
94
+ ({ href, ...props }: ListItemNavigationProps): import("react").JSX.Element;
95
+ displayName: string;
96
+ };
97
+ Button: {
98
+ ({ priority, partiallyInteractive, ...props }: ListItemButtonProps): import("react").JSX.Element;
99
+ displayName: string;
100
+ };
101
+ Switch: {
102
+ (props: ListItemSwitchProps): import("react").JSX.Element;
103
+ displayName: string;
104
+ };
105
+ Prompt: {
106
+ ({ sentiment, children }: import("./Prompt").ListItemPromptProps): import("react").JSX.Element;
107
+ displayName: string;
108
+ };
109
+ };
110
+ export default ListItem;
111
+ //# sourceMappingURL=ListItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAc,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAY,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAc,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAU,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAS,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAU,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAY5D,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,YAAY,GACZ,OAAO,GACP,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,aAAa,CAAC;AAElB,MAAM,MAAM,oBAAoB,GAC5B,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,kBAAkB,GAClB,mBAAmB,CAAC;AAExB,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAClC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;mLAgBlB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkOf,CAAC;AAiGF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { ListItemTypes, ListItemControlProps, ListItemProps } from './ListItem';
2
+ export type ListItemMediaSize = 32 | 40 | 48 | 56 | 72;
3
+ export type ListItemContextData = {
4
+ setControlType: (type: ListItemTypes) => void;
5
+ setControlProps: (props: ListItemControlProps) => void;
6
+ setMediaSize: (size: ListItemMediaSize | undefined) => void;
7
+ ids: {
8
+ title: string;
9
+ subtitle?: string;
10
+ valueTitle?: string;
11
+ valueSubtitle?: string;
12
+ additionalInfo?: string;
13
+ control: string;
14
+ prompt?: string;
15
+ };
16
+ props: Pick<ListItemProps, 'disabled' | 'inverted'>;
17
+ mediaSize?: ListItemMediaSize;
18
+ describedByIds: string;
19
+ };
20
+ export declare const ListItemContext: import("react").Context<ListItemContextData>;
21
+ //# sourceMappingURL=ListItemContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemContext.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,GAAG,EAAE;QACH,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;IACpD,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,eAAe,8CAE3B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ButtonProps } from '../../button/Button.types';
2
+ export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;
3
+ /**
4
+ * This component allows for rendering a control functionally synonymous with HTML `anchor` or a
5
+ * `button`, giving users a rich way to choose between options and navigate to another screen or
6
+ * step in a flow. It offers only a subset of features of the HTML element in line with the
7
+ * ListItem's constraints.<br />
8
+ * <br />
9
+ * Please refer to the [Design documentation](https://wise.design/components/list-item---navigation) for details.
10
+ */
11
+ export declare const Navigation: {
12
+ ({ href, ...props }: ListItemNavigationProps): import("react").JSX.Element;
13
+ displayName: string;
14
+ };
15
+ //# sourceMappingURL=ListItemNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemNavigation.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Navigation/ListItemNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAM7D,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAEvF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;yBAA2C,uBAAuB;;CAmBxF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { ListItemNavigationProps } from './ListItemNavigation';
2
+ export { Navigation } from './ListItemNavigation';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Navigation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Sentiment } from '../../common';
2
+ export type ListItemPromptProps = {
3
+ sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;
4
+ children: React.ReactNode;
5
+ };
6
+ /**
7
+ * This component allows for rendering an Inline Prompt. <br />In the future it will be a thin wrapper around a standalone component.<br />
8
+ *
9
+ * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.
10
+ */
11
+ export declare const Prompt: {
12
+ ({ sentiment, children }: ListItemPromptProps): import("react").JSX.Element;
13
+ displayName: string;
14
+ };
15
+ export default Prompt;
16
+ //# sourceMappingURL=ListItemPrompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemPrompt.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Prompt/ListItemPrompt.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;IACjG,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,MAAM;8BAAiD,mBAAmB;;CAWtF,CAAC;AAGF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { ListItemPromptProps } from './ListItemPrompt';
2
+ export { Prompt } from './ListItemPrompt';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Prompt/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type RadioButtonProps } from '../../common/RadioButton/RadioButton';
2
+ export type ListItemRadioProps = Omit<RadioButtonProps, 'disabled' | 'readOnly' | 'className' | 'id'>;
3
+ /**
4
+ * This component allows for rendering a Button control. It's a thin wrapper around the
5
+ * [Button component](https://storybook.wise.design/?path=/docs/content-button--docs), but offers only
6
+ * a subset of its features in line with the ListItem's constraints. <br />
7
+ * <br />
8
+ * Please refer to the [Design documentation](https://wise.design/components/list-item---button) for details.
9
+ */
10
+ export declare const Radio: {
11
+ (props: ListItemRadioProps): import("react").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ //# sourceMappingURL=ListItemRadio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemRadio.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Radio/ListItemRadio.tsx"],"names":[],"mappings":"AACA,OAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAI1F,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,gBAAgB,EAChB,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,CAC7C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK;YAAoB,kBAAkB;;CAavD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { ListItemRadioProps } from './ListItemRadio';
2
+ export { Radio } from './ListItemRadio';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Radio/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type SwitchProps } from '../../switch';
2
+ export type ListItemSwitchProps = Omit<SwitchProps, 'disabled' | 'id' | 'aria-labelledby' | 'aria-label'>;
3
+ /**
4
+ * This component allows for rendering a switch control within a fully interactive ListItem. <br />It's a thin wrapper around the
5
+ * [CheckboxButton component](https://storybook.wise.design/?path=/docs/actions-switch--docs),
6
+ * but offers only a subset of its features in line with the ListItem's constraints. <br />
7
+ *
8
+ * Please refer to the [Design documentation](https://wise.design/components/list-item---switch) for details.
9
+ */
10
+ export declare const Switch: {
11
+ (props: ListItemSwitchProps): import("react").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ //# sourceMappingURL=ListItemSwitch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemSwitch.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Switch/ListItemSwitch.tsx"],"names":[],"mappings":"AACA,OAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAI5D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,WAAW,EACX,UAAU,GAAG,IAAI,GAAG,iBAAiB,GAAG,YAAY,CACrD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;YAAoB,mBAAmB;;CAazD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { ListItemSwitchProps } from './ListItemSwitch';
2
+ export { Switch } from './ListItemSwitch';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Switch/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { StoryObj, type Decorator } from '@storybook/react-webpack5';
2
+ import type { ListItemProps } from '../ListItem';
3
+ type Story = StoryObj<ListItemProps>;
4
+ /**
5
+ * Recent storybook versions render the full source including all story parameters which
6
+ * creates noise, this simple workaround only shows the render function.
7
+ * This is a workaround for the issue.
8
+ * @see https://github.com/storybookjs/storybook/issues/22281
9
+ */
10
+ export declare const storySourceWithoutNoise: (config: Story) => Story;
11
+ /**
12
+ * In order to make preview controls work correctly, we have to refresh the render
13
+ * by swapping the `key`. This is a workaround for the Storybook's limitation.
14
+ */
15
+ export declare const withoutKey: Decorator;
16
+ /**
17
+ * Not all stories need access to all controls as it causes unnecessary UI noise.
18
+ */
19
+ export declare const disableControls: (hiddenByDefault?: string[]) => (hiddenForStory?: string[]) => {
20
+ [k: string]: {
21
+ table: {
22
+ disable: boolean;
23
+ };
24
+ };
25
+ };
26
+ export {};
27
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/listItem/_stories/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,KAAK,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,KAAK,KAAG,KAuBvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,SAExB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GACzB,kBAAiB,MAAM,EAAO,MAC9B,iBAAgB,MAAM,EAAO;;;;;;CAG7B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ export type SB_ListItem_ControlType = 'non-interactive' | 'button' | 'buttonAsLink' | 'partialButton' | 'partialButtonAsLink' | 'iconButton' | 'iconButtonAsLink' | 'iconButtonWithLabel' | 'iconButtonAsLinkWithLabel' | 'partialIconButton' | 'partialIconButtonAsLink' | 'partialIconButtonWithLabel' | 'partialIconButtonAsLinkWithLabel' | 'navigation' | 'navigationAsButton' | 'checkbox' | 'radio' | 'switch';
3
+ export declare const SB_LIST_ITEM_CONTROLS: Record<SB_ListItem_ControlType, ReactNode>;
4
+ export declare const SB_LIST_ITEM_ADDITIONAL_INFO: {
5
+ readonly interactive: import("react").JSX.Element;
6
+ readonly nonInteractive: import("react").JSX.Element;
7
+ };
8
+ export declare const SB_LIST_ITEM_PROMPTS: {
9
+ readonly interactive: import("react").JSX.Element;
10
+ readonly nonInteractive: import("react").JSX.Element;
11
+ };
12
+ export declare const SB_LIST_ITEM_MEDIA: {
13
+ readonly image: import("react").JSX.Element;
14
+ readonly avatarSingle: import("react").JSX.Element;
15
+ readonly avatarDouble: import("react").JSX.Element;
16
+ readonly avatarDiagonal: import("react").JSX.Element;
17
+ };
18
+ //# sourceMappingURL=subcomponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subcomponents.d.ts","sourceRoot":"","sources":["../../../../src/listItem/_stories/subcomponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOlC,MAAM,MAAM,uBAAuB,GAC/B,iBAAiB,GACjB,QAAQ,GACR,cAAc,GACd,eAAe,GACf,qBAAqB,GACrB,YAAY,GACZ,kBAAkB,GAClB,qBAAqB,GACrB,2BAA2B,GAC3B,mBAAmB,GACnB,yBAAyB,GACzB,4BAA4B,GAC5B,kCAAkC,GAClC,YAAY,GACZ,oBAAoB,GACpB,UAAU,GACV,OAAO,GACP,QAAQ,CAAC;AAEb,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,EAAE,SAAS,CA2DnE,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;CAe/B,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;CAavB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;CAoBrB,CAAC"}
@@ -0,0 +1,14 @@
1
+ export type { ListItemProps } from './ListItem';
2
+ export type { ListItemAdditionalInfoProps } from './AdditionalInfo';
3
+ export type { ListItemAvatarLayoutProps } from './AvatarLayout';
4
+ export type { ListItemAvatarViewProps } from './AvatarView';
5
+ export type { ListItemButtonProps } from './Button';
6
+ export type { ListItemCheckboxProps } from './Checkbox';
7
+ export type { ListItemIconButtonProps } from './IconButton';
8
+ export type { ListItemImageProps } from './Image';
9
+ export type { ListItemNavigationProps } from './Navigation';
10
+ export type { ListItemPromptProps } from './Prompt';
11
+ export type { ListItemRadioProps } from './Radio';
12
+ export type { ListItemSwitchProps } from './Switch';
13
+ export { default } from './ListItem';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/listItem/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AACpE,YAAY,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type RenderResult } from '../test-utils';
2
+ export declare const mockSetControlType: jest.Mock<any, any, any>;
3
+ export declare const mockSetControlProps: jest.Mock<any, any, any>;
4
+ export declare const mockSetMediaSize: jest.Mock<any, any, any>;
5
+ export declare const renderWithListItemContext: (ui: React.ReactNode) => RenderResult;
6
+ export declare const clearListItemMocks: () => void;
7
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/listItem/test-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAG1D,eAAO,MAAM,kBAAkB,0BAAY,CAAC;AAC5C,eAAO,MAAM,mBAAmB,0BAAY,CAAC;AAC7C,eAAO,MAAM,gBAAgB,0BAAY,CAAC;AAE1C,eAAO,MAAM,yBAAyB,GAAI,IAAI,KAAK,CAAC,SAAS,KAAG,YAqB/D,CAAC;AAEF,eAAO,MAAM,kBAAkB,YAE9B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ListItemTypes, ListItemControlProps } from './ListItem';
2
+ export declare function useListItemControl(controlType: ListItemTypes, controlProps: ListItemControlProps): {
3
+ baseItemProps: Pick<import("./ListItem").ListItemProps, "disabled" | "inverted">;
4
+ };
5
+ //# sourceMappingURL=useListItemControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useListItemControl.d.ts","sourceRoot":"","sources":["../../../src/listItem/useListItemControl.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,oBAAoB;;EAahG"}
@@ -0,0 +1,6 @@
1
+ import { type ListItemMediaSize } from './ListItemContext';
2
+ export declare function useListItemMedia(size?: ListItemMediaSize): {
3
+ mediaSize: ListItemMediaSize | undefined;
4
+ setMediaSize: (size: ListItemMediaSize | undefined) => void;
5
+ };
6
+ //# sourceMappingURL=useListItemMedia.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useListItemMedia.d.ts","sourceRoot":"","sources":["../../../src/listItem/useListItemMedia.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,iBAAiB;;;EAQxD"}
@@ -1,15 +1,14 @@
1
- import { LabelHTMLAttributes, LiHTMLAttributes } from 'react';
1
+ import React from 'react';
2
2
  import { TitleTypes, Heading } from '../common';
3
- type Props = LabelHTMLAttributes<HTMLHeadingElement | HTMLSpanElement | HTMLLabelElement> & LiHTMLAttributes<HTMLLIElement> & {
3
+ declare const Title: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLSpanElement | HTMLHeadingElement | HTMLLabelElement> & React.LiHTMLAttributes<HTMLLIElement> & {
4
4
  /**
5
5
  * Default value will based one `type` prop
6
6
  */
7
- as?: 'span' | 'label' | 'li' | 'legend' | 'header' | Heading;
7
+ as?: "span" | "label" | "li" | "legend" | "header" | Heading;
8
8
  /**
9
9
  * Default value: {@link DEFAULT_TYPE}
10
10
  */
11
11
  type?: TitleTypes;
12
- };
13
- declare function Title({ as, type, className, ...props }: Props): import("react").JSX.Element;
12
+ } & React.RefAttributes<HTMLSpanElement | HTMLHeadingElement | HTMLLabelElement>>;
14
13
  export default Title;
15
14
  //# sourceMappingURL=Title.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Title.d.ts","sourceRoot":"","sources":["../../../src/title/Title.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAa,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAc,OAAO,EAAE,MAAM,WAAW,CAAC;AAY5D,KAAK,KAAK,GAAG,mBAAmB,CAAC,kBAAkB,GAAG,eAAe,GAAG,gBAAgB,CAAC,GACvF,gBAAgB,CAAC,aAAa,CAAC,GAAG;IAChC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC7D;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEJ,iBAAS,KAAK,CAAC,EAAE,EAAE,EAAE,IAAmB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,+BAUrE;AAED,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Title.d.ts","sourceRoot":"","sources":["../../../src/title/Title.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,UAAU,EAAc,OAAO,EAAE,MAAM,WAAW,CAAC;AAwB5D,QAAA,MAAM,KAAK;IAVP;;OAEG;SACE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO;IAC5D;;OAEG;WACI,UAAU;iFA0BpB,CAAC;AAEF,eAAe,KAAK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "46.103.1",
3
+ "version": "46.105.0",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -85,8 +85,8 @@
85
85
  "storybook-addon-test-codegen": "^2.0.1",
86
86
  "@transferwise/less-config": "3.1.2",
87
87
  "@transferwise/neptune-css": "14.24.5",
88
- "@wise/wds-configs": "0.0.0",
89
- "@wise/components-theming": "1.6.4"
88
+ "@wise/components-theming": "1.6.4",
89
+ "@wise/wds-configs": "0.0.0"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@transferwise/icons": "^3.22.3",
@@ -1,5 +1,5 @@
1
1
  import { Freeze } from '@transferwise/icons';
2
- import { mockMatchMedia, render, screen } from '../test-utils';
2
+ import { mockMatchMedia, render, screen, userEvent } from '../test-utils';
3
3
  import Button, { ButtonProps } from './Button.resolver';
4
4
  import { CommonProps } from './Button.types';
5
5
 
@@ -377,4 +377,28 @@ describe('Button', () => {
377
377
  });
378
378
  });
379
379
  });
380
+
381
+ describe('onClick', () => {
382
+ it('should call the handler when rendered as HTML button', async () => {
383
+ const onClick = jest.fn();
384
+ render(
385
+ <Button v2 onClick={onClick}>
386
+ Button
387
+ </Button>,
388
+ );
389
+ await userEvent.click(screen.getByRole('button'));
390
+ expect(onClick).toHaveBeenCalledTimes(1);
391
+ });
392
+
393
+ it('should call the handler when rendered as HTML anchor', async () => {
394
+ const onClick = jest.fn();
395
+ render(
396
+ <Button v2 href="https://wise.com" onClick={onClick}>
397
+ Anchor
398
+ </Button>,
399
+ );
400
+ await userEvent.click(screen.getByRole('link'));
401
+ expect(onClick).toHaveBeenCalledTimes(1);
402
+ });
403
+ });
380
404
  });
@@ -152,6 +152,7 @@ const getPropsForPreview = (args: PreviewStoryArgs) => {
152
152
  const meta: Meta<typeof Button> = {
153
153
  component: Button,
154
154
  title: 'Actions/Button',
155
+ tags: ['new'],
155
156
  argTypes: {
156
157
  v2: {
157
158
  table: {
@@ -0,0 +1,85 @@
1
+ import { Meta, Canvas, Source } from '@storybook/addon-docs/blocks';
2
+ import { NavigationOption } from '..';
3
+ import { Bulb } from '@transferwise/icons';
4
+ import * as stories from './Header.story';
5
+
6
+ <Meta title="Typography/Header/Accessibility" />
7
+
8
+ # Accessibility
9
+
10
+ Given the `Header` is a key component for structuring content and conveying hierarchy, ensuring its accessibility is crucial for an inclusive experience.
11
+
12
+ <NavigationOption
13
+ media={<Bulb size={24} />}
14
+ title="Design guidance"
15
+ content="Before you start, familiarise yourself with the dedicated accessibility documentation."
16
+ href="https://wise.design/components/section-header#accessibility"
17
+ />
18
+
19
+ <br />
20
+ <br />
21
+
22
+ ## Semantic headings
23
+
24
+ The `Header` component should always use semantic HTML heading tags (`<h1>` to `<h6>`) to convey the document structure. Avoid using non-semantic tags unless absolutely necessary.
25
+
26
+ <Source dark code={`
27
+ // ✅ semantic heading
28
+ <Header as="h1">Main heading</Header>
29
+
30
+ // ⚠️ use with care
31
+
32
+ <Header as="div">Non-semantic heading</Header>
33
+ `}/>
34
+
35
+ **Additional resources:**
36
+
37
+ 1. [Deque: Headings must follow a logical order](https://dequeuniversity.com/rules/axe/4.2/heading-order)
38
+ 2. [MDN: Using headings](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements)
39
+
40
+ <br />
41
+
42
+ ## ARIA roles
43
+
44
+ If the `Header` is used in a non-semantic context, ensure it is accessible by applying appropriate ARIA roles, such as `role="heading"`, and providing a `aria-level` attribute to indicate its level in the hierarchy.
45
+
46
+ <Source
47
+ dark
48
+ code={`
49
+ // ⚠️ use with care
50
+ <Header as="div" role="heading" aria-level="1">
51
+ Main heading
52
+ </Header>
53
+ `}
54
+ />
55
+
56
+ <br />
57
+
58
+ ## Accessibility with actions
59
+
60
+ When using the `Header` with actions (e.g., buttons or links), ensure the actions are accessible by providing clear labels and ARIA attributes.
61
+
62
+ <Source
63
+ dark
64
+ code={`
65
+ // ✅ accessible action
66
+ <Header
67
+ as="h2"
68
+ action={{
69
+ 'aria-label': 'Edit section',
70
+ text: 'Edit',
71
+ onClick: () => alert('Edit clicked'),
72
+ }}
73
+ >
74
+ Section heading
75
+ </Header>
76
+ `}
77
+ />
78
+
79
+ <br />
80
+
81
+ ## Visual hierarchy
82
+
83
+ Ensure the `Header` visually aligns with its semantic level. For example, an `<h1>` should be the largest and most prominent, while an `<h6>` should be the smallest.
84
+
85
+ <Canvas of={stories.Playground} />
@@ -1,26 +1,33 @@
1
1
  .np-header {
2
- display: flex;
3
- justify-content: space-between;
4
- align-items: flex-end;
2
+ display: grid;
3
+ grid-template-columns: 1fr auto;
4
+ grid-column-gap: 24px;
5
+ grid-column-gap: var(--size-24);
6
+ -moz-column-gap: 24px;
7
+ column-gap: 24px;
8
+ -moz-column-gap: var(--size-24);
9
+ column-gap: var(--size-24);
10
+ align-items: center;
11
+ margin-bottom: 8px;
12
+ margin-bottom: var(--size-8);
5
13
  max-width: 100%;
6
14
  padding: 8px 0;
7
15
  padding: var(--size-8) 0;
16
+ width: 100%;
17
+ }
18
+ .np-header--group {
19
+ align-items: flex-end;
8
20
  border-bottom: 1px solid rgba(0,0,0,0.10196);
9
21
  border-bottom: 1px solid var(--color-border-neutral);
10
- margin-bottom: 8px;
11
- margin-bottom: var(--size-8);
12
- -moz-column-gap: 24px;
13
- column-gap: 24px;
14
- -moz-column-gap: var(--size-24);
15
- column-gap: var(--size-24);
16
22
  }
17
23
  .np-header__title {
18
24
  color: #5d7079;
19
25
  color: var(--color-content-secondary);
26
+ margin: 0;
20
27
  }
21
- .np-header__button {
22
- margin-inline: calc(16px * -1);
23
- margin-inline: calc(var(--size-16) * -1);
24
- margin-bottom: calc(4px * -1);
25
- margin-bottom: calc(var(--size-4) * -1);
28
+ .np-header__action {
29
+ margin: 0;
30
+ height: 20px;
31
+ display: flex;
32
+ align-items: center;
26
33
  }
@@ -1,20 +1,27 @@
1
1
  .np-header {
2
- display: flex;
3
- justify-content: space-between;
4
- align-items: flex-end;
2
+ display: grid;
3
+ grid-template-columns: 1fr auto;
4
+ column-gap: var(--size-24);
5
+ align-items: center;
6
+ margin-bottom: var(--size-8);
5
7
  max-width: 100%;
6
8
  padding: var(--size-8) 0;
7
- border-bottom: 1px solid var(--color-border-neutral);
8
- margin-bottom: var(--size-8);
9
+ width: 100%;
10
+
11
+ &--group {
12
+ align-items: flex-end;
13
+ border-bottom: 1px solid var(--color-border-neutral);
14
+ }
9
15
 
10
16
  &__title {
11
17
  color: var(--color-content-secondary);
18
+ margin: 0;
12
19
  }
13
20
 
14
- column-gap: var(--size-24);
15
-
16
- &__button {
17
- margin-inline: calc(var(--size-16) * -1);
18
- margin-bottom: calc(var(--size-4) * -1);
21
+ &__action {
22
+ margin: 0;
23
+ height: 20px;
24
+ display: flex;
25
+ align-items: center;
19
26
  }
20
27
  }