uikit-react-public 0.11.24 → 0.17.4

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 (301) hide show
  1. package/README.md +4 -2
  2. package/dist/components/Accordion/Accordion.Heading.d.ts +4 -4
  3. package/dist/components/Accordion/Accordion.Panel.d.ts +2 -2
  4. package/dist/components/Accordion/Accordion.d.ts +1 -1
  5. package/dist/components/Accordion/Accordion.stories.d.ts +57 -0
  6. package/dist/components/Accordion/index.d.ts +2 -0
  7. package/dist/components/Avatar/Avatar.stories.d.ts +107 -1
  8. package/dist/components/Badge/Badge.d.ts +6 -0
  9. package/dist/components/Badge/Badge.stories.d.ts +15 -0
  10. package/dist/components/Badge/index.d.ts +2 -0
  11. package/dist/components/Button/Button.d.ts +3 -1
  12. package/dist/components/Calendar/index.d.ts +1 -1
  13. package/dist/components/CookieNotice/CookieNotice.d.ts +16 -0
  14. package/dist/components/CookieNotice/index.d.ts +2 -0
  15. package/dist/components/Datepicker/Datepicker.d.ts +1 -1
  16. package/dist/components/Datepicker/Datepicker.stories.d.ts +4 -3
  17. package/dist/components/Datepicker/Datepicker.types.d.ts +4 -5
  18. package/dist/components/Datepicker/subcomponents/CustomDatepicker.d.ts +4 -1
  19. package/dist/components/Datepicker/subcomponents/DatepickerInput.d.ts +15 -2
  20. package/dist/components/Datepicker/subcomponents/Panel.d.ts +1 -1
  21. package/dist/components/Datepicker/subcomponents/VisibleField.d.ts +6 -1
  22. package/dist/components/Datepicker/subcomponents/index.d.ts +0 -1
  23. package/dist/components/Datepicker/utils/index.d.ts +0 -1
  24. package/dist/components/Dialog/BaseDialog.d.ts +8 -2
  25. package/dist/components/Dialog/Dialog.d.ts +2 -0
  26. package/dist/components/FileInput/FileInput.d.ts +8 -0
  27. package/dist/components/FileInput/FileInput.stories.d.ts +16 -0
  28. package/dist/components/FileInput/index.d.ts +2 -0
  29. package/dist/components/Header/Header.d.ts +7 -1
  30. package/dist/components/Header/Header.stories.d.ts +40 -0
  31. package/dist/components/Heading/Heading.d.ts +1 -1
  32. package/dist/components/Link/BaseLink.d.ts +10 -0
  33. package/dist/components/Link/Link.d.ts +5 -10
  34. package/dist/components/Link/Link.stories.d.ts +1 -1
  35. package/dist/components/Link/index.d.ts +1 -1
  36. package/dist/components/Main/Main.d.ts +21 -0
  37. package/dist/components/Main/Main.stories.d.ts +15 -0
  38. package/dist/components/Main/__tests__/Main.test.d.ts +1 -0
  39. package/dist/components/Main/index.d.ts +2 -0
  40. package/dist/components/Menu/MenuContent.d.ts +1 -1
  41. package/dist/components/Menu/MenuItem.d.ts +2 -0
  42. package/dist/components/Menu/MenuSection.d.ts +1 -1
  43. package/dist/components/NativeDatepicker/NativeDatepicker.d.ts +3 -0
  44. package/dist/components/NativeDatepicker/NativeDatepicker.stories.d.ts +36 -0
  45. package/dist/components/NativeDatepicker/NativeDatepicker.types.d.ts +10 -0
  46. package/dist/components/NativeDatepicker/index.d.ts +2 -0
  47. package/dist/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.d.ts +1 -1
  48. package/dist/components/NativeDatepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.d.ts +1 -0
  49. package/dist/components/NativeDatepicker/utils/index.d.ts +1 -0
  50. package/dist/components/Search/Search.d.ts +16 -0
  51. package/dist/components/Search/Search.stories.d.ts +34 -0
  52. package/dist/components/Search/__tests__/Search.test.d.ts +1 -0
  53. package/dist/components/Search/index.d.ts +2 -0
  54. package/dist/components/Select/Select.d.ts +1 -1
  55. package/dist/components/Select/Select.stories.d.ts +157 -9
  56. package/dist/components/Select/Select.types.d.ts +66 -32
  57. package/dist/components/Select/subcomponents/CustomOption.d.ts +1 -1
  58. package/dist/components/Select/subcomponents/CustomSelect.d.ts +3 -3
  59. package/dist/components/Select/subcomponents/FilterInput.d.ts +14 -0
  60. package/dist/components/Select/subcomponents/NativeSelect.d.ts +5 -1
  61. package/dist/components/Select/subcomponents/Panel.d.ts +1 -1
  62. package/dist/components/Select/subcomponents/VisibleField.d.ts +6 -4
  63. package/dist/components/Select/subcomponents/index.d.ts +1 -0
  64. package/dist/components/StandaloneLink/StandaloneLink.d.ts +12 -0
  65. package/dist/components/StandaloneLink/StandaloneLink.stories.d.ts +13 -0
  66. package/dist/components/StandaloneLink/__tests__/StandaloneLink.test.d.ts +1 -0
  67. package/dist/components/StandaloneLink/index.d.ts +2 -0
  68. package/dist/components/Table/Table.d.ts +10 -8
  69. package/dist/components/Table/Table.stories.d.ts +21 -0
  70. package/dist/components/Table/Table.types.d.ts +11 -0
  71. package/dist/components/Table/__tests__/Table.test.d.ts +1 -0
  72. package/dist/components/Table/index.d.ts +2 -1
  73. package/dist/components/Table/subcomponents/Body.d.ts +4 -0
  74. package/dist/components/Table/subcomponents/Cell/Cell.d.ts +12 -0
  75. package/dist/components/Table/subcomponents/Cell/Cell.stories.d.ts +313 -0
  76. package/dist/components/Table/subcomponents/Cell/CellContent.d.ts +10 -0
  77. package/dist/components/Table/subcomponents/Cell/__tests__/Cell.test.d.ts +1 -0
  78. package/dist/components/Table/subcomponents/Head.d.ts +4 -0
  79. package/dist/components/Table/subcomponents/HeadCell/HeadCell.d.ts +13 -0
  80. package/dist/components/Table/subcomponents/HeadCell/HeadCell.stories.d.ts +312 -0
  81. package/dist/components/Table/subcomponents/HeadCell/HeadCellContent.d.ts +10 -0
  82. package/dist/components/Table/subcomponents/HeadCell/__tests__/HeadCell.test.d.ts +1 -0
  83. package/dist/components/Table/subcomponents/Row.d.ts +5 -0
  84. package/dist/components/Table/subcomponents/SortIcon.d.ts +7 -0
  85. package/dist/components/Table/subcomponents/index.d.ts +10 -0
  86. package/dist/components/Tabs/Tab.d.ts +1 -1
  87. package/dist/components/Tabs/TabContext.d.ts +1 -0
  88. package/dist/components/Tabs/Tabs.d.ts +3 -1
  89. package/dist/components/Tabs/Tabs.stories.d.ts +3 -0
  90. package/dist/components/Timepicker/Timepicker.d.ts +10 -0
  91. package/dist/components/Timepicker/Timepicker.stories.d.ts +7 -0
  92. package/dist/components/Timepicker/__tests__/Timepicker.test.d.ts +1 -0
  93. package/dist/components/Timepicker/index.d.ts +2 -0
  94. package/dist/components/Timepicker/utils/convertDateToTimeString.d.ts +2 -0
  95. package/dist/components/Timepicker/utils/convertDateToTimeString.test.d.ts +1 -0
  96. package/dist/components/Timepicker/utils/index.d.ts +1 -0
  97. package/dist/components/WeekPicker/WeekPicker.d.ts +3 -0
  98. package/dist/components/WeekPicker/WeekPicker.stories.d.ts +41 -0
  99. package/dist/components/WeekPicker/WeekPicker.types.d.ts +16 -0
  100. package/dist/components/WeekPicker/index.d.ts +2 -0
  101. package/dist/components/WeekPicker/subcomponents/CustomDatepicker.d.ts +17 -0
  102. package/dist/components/WeekPicker/subcomponents/DatepickerInput.d.ts +13 -0
  103. package/dist/components/WeekPicker/subcomponents/VisibleField.d.ts +15 -0
  104. package/dist/components/WeekPicker/subcomponents/index.d.ts +3 -0
  105. package/dist/components/index.d.ts +19 -0
  106. package/dist/hooks/index.d.ts +2 -0
  107. package/dist/hooks/useFocusTrap.d.ts +10 -0
  108. package/dist/index.d.ts +2 -0
  109. package/dist/index.js +6460 -4607
  110. package/dist/theme/defaultTheme.d.ts +7 -0
  111. package/dist/theme/useTheme.d.ts +14 -0
  112. package/dist/utils/__tests__/announce.test.d.ts +1 -0
  113. package/dist/utils/__tests__/capitalise.test.d.ts +1 -0
  114. package/dist/utils/announce.d.ts +6 -0
  115. package/dist/utils/capitalise.d.ts +2 -0
  116. package/dist/utils/index.d.ts +1 -0
  117. package/lib/components/Accordion/Accordion.Heading.tsx +27 -8
  118. package/lib/components/Accordion/Accordion.Panel.tsx +11 -3
  119. package/lib/components/Accordion/Accordion.stories.tsx +139 -0
  120. package/lib/components/Accordion/Accordion.tsx +10 -8
  121. package/lib/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap +7 -7
  122. package/lib/components/Accordion/index.ts +2 -0
  123. package/lib/components/Alert/Alert.stories.tsx +1 -1
  124. package/lib/components/Alert/Alert.tsx +7 -1
  125. package/lib/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap +4 -0
  126. package/lib/components/Avatar/Avatar.mdx +117 -0
  127. package/lib/components/Avatar/Avatar.stories.tsx +110 -2
  128. package/lib/components/Badge/Badge.stories.tsx +19 -0
  129. package/lib/components/Badge/Badge.tsx +48 -0
  130. package/lib/components/Badge/index.ts +2 -0
  131. package/lib/components/Blanket/Blanket.stories.tsx +1 -1
  132. package/lib/components/Breadcrumbs/__tests__/__snapshots__/Breadcrumbs.test.tsx.snap +4 -4
  133. package/lib/components/Button/Button.stories.tsx +1 -1
  134. package/lib/components/Button/Button.tsx +6 -2
  135. package/lib/components/Calendar/Calendar.stories.tsx +12 -32
  136. package/lib/components/Calendar/__tests__/Calendar.test.tsx +23 -15
  137. package/lib/components/Calendar/index.ts +1 -5
  138. package/lib/components/Calendar/subcomponents/AcademicWeeks.tsx +2 -1
  139. package/lib/components/Calendar/subcomponents/ColumnHeading.tsx +5 -1
  140. package/lib/components/Calendar/subcomponents/EventDot.tsx +2 -1
  141. package/lib/components/Calendar/subcomponents/Grid.tsx +0 -1
  142. package/lib/components/Calendar/subcomponents/index.ts +1 -1
  143. package/lib/components/Calendar/utils/getDatesForCalendarGrid/getDatesForCalendarGrid.ts +43 -11
  144. package/lib/components/Calendar/utils/normaliseMonth/normaliseMonth.test.ts +5 -5
  145. package/lib/components/CookieNotice/CookieNotice.tsx +114 -0
  146. package/lib/components/CookieNotice/index.ts +2 -0
  147. package/lib/components/Datepicker/Datepicker.lld.md +108 -0
  148. package/lib/components/Datepicker/Datepicker.stories.tsx +44 -5
  149. package/lib/components/Datepicker/Datepicker.tsx +14 -36
  150. package/lib/components/Datepicker/Datepicker.types.ts +5 -14
  151. package/lib/components/Datepicker/__tests__/Datepicker.test.tsx +150 -8
  152. package/lib/components/Datepicker/__tests__/__snapshots__/Datepicker.test.tsx.snap +10 -4
  153. package/lib/components/Datepicker/subcomponents/CustomDatepicker.tsx +39 -5
  154. package/lib/components/Datepicker/subcomponents/DatepickerInput.tsx +30 -17
  155. package/lib/components/Datepicker/subcomponents/Panel.tsx +6 -2
  156. package/lib/components/Datepicker/subcomponents/VisibleField.tsx +40 -3
  157. package/lib/components/Datepicker/subcomponents/index.ts +0 -1
  158. package/lib/components/Datepicker/utils/index.ts +0 -1
  159. package/lib/components/Dialog/BaseDialog.tsx +55 -4
  160. package/lib/components/Dialog/Dialog.tsx +8 -1
  161. package/lib/components/Dialog/DialogBody.tsx +5 -1
  162. package/lib/components/Dialog/DialogHeader.tsx +2 -1
  163. package/lib/components/Divider/Divider.stories.tsx +1 -1
  164. package/lib/components/Field/ErrorText.tsx +1 -0
  165. package/lib/components/Field/Field.stories.tsx +1 -1
  166. package/lib/components/Field/__tests__/Field.test.tsx +161 -148
  167. package/lib/components/FileInput/FileInput.stories.tsx +70 -0
  168. package/lib/components/FileInput/FileInput.tsx +68 -0
  169. package/lib/components/FileInput/__tests__/FileInput.test.tsx +99 -0
  170. package/lib/components/FileInput/__tests__/__snapshots__/FileInput.test.tsx.snap +91 -0
  171. package/lib/components/FileInput/index.ts +2 -0
  172. package/lib/components/Footer/Footer.stories.tsx +1 -1
  173. package/lib/components/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +28 -28
  174. package/lib/components/Header/Header.mdx +52 -0
  175. package/lib/components/Header/Header.stories.tsx +98 -0
  176. package/lib/components/Header/Header.tsx +65 -3
  177. package/lib/components/Header/__tests__/Header.test.tsx +17 -1
  178. package/lib/components/Header/__tests__/__snapshots__/Header.test.tsx.snap +4 -4
  179. package/lib/components/Heading/Documentation.mdx +1 -1
  180. package/lib/components/Heading/Heading.stories.tsx +1 -1
  181. package/lib/components/Heading/Heading.tsx +1 -1
  182. package/lib/components/Heading/__tests__/Heading.test.tsx +7 -19
  183. package/lib/components/Heading/__tests__/__snapshots__/Heading.test.tsx.snap +7 -7
  184. package/lib/components/Icon/Icon.stories.tsx +1 -1
  185. package/lib/components/IconButton/IconButton.stories.tsx +1 -1
  186. package/lib/components/Input/Input.stories.tsx +1 -1
  187. package/lib/components/Label/Label.stories.tsx +1 -1
  188. package/lib/components/Label/Label.tsx +0 -2
  189. package/lib/components/Label/__tests__/__snapshots__/Label.test.tsx.snap +7 -7
  190. package/lib/components/Link/BaseLink.tsx +84 -0
  191. package/lib/components/Link/Link.tsx +72 -32
  192. package/lib/components/Link/__tests__/__snapshots__/link.test.tsx.snap +3 -3
  193. package/lib/components/Link/__tests__/link.test.tsx +6 -13
  194. package/lib/components/Link/index.ts +1 -1
  195. package/lib/components/Main/Main.stories.tsx +36 -0
  196. package/lib/components/Main/Main.tsx +46 -0
  197. package/lib/components/Main/__tests__/Main.test.tsx +80 -0
  198. package/lib/components/Main/__tests__/__snapshots__/Main.test.tsx.snap +33 -0
  199. package/lib/components/Main/index.ts +2 -0
  200. package/lib/components/Menu/Menu.context.tsx +3 -1
  201. package/lib/components/Menu/Menu.tsx +2 -2
  202. package/lib/components/Menu/MenuContent.tsx +5 -5
  203. package/lib/components/Menu/MenuItem.tsx +20 -3
  204. package/lib/components/Menu/MenuSection.tsx +4 -3
  205. package/lib/components/NativeDatepicker/NativeDatepicker.stories.tsx +100 -0
  206. package/lib/components/{Datepicker/subcomponents → NativeDatepicker}/NativeDatepicker.tsx +14 -15
  207. package/lib/components/NativeDatepicker/NativeDatepicker.types.ts +19 -0
  208. package/lib/components/NativeDatepicker/index.ts +2 -0
  209. package/lib/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.ts +1 -1
  210. package/lib/components/NativeDatepicker/utils/index.ts +1 -0
  211. package/lib/components/Pagination/PaginationControls.tsx +56 -15
  212. package/lib/components/Pagination/PaginationInfo.tsx +5 -1
  213. package/lib/components/Paragraph/Paragraph.stories.tsx +1 -1
  214. package/lib/components/Search/Search.stories.tsx +41 -0
  215. package/lib/components/Search/Search.tsx +170 -0
  216. package/lib/components/Search/__tests__/Search.test.tsx +112 -0
  217. package/lib/components/Search/__tests__/__snapshots__/Search.test.tsx.snap +179 -0
  218. package/lib/components/Search/index.ts +2 -0
  219. package/lib/components/Select/Select.mdx +169 -0
  220. package/lib/components/Select/Select.stories.tsx +198 -77
  221. package/lib/components/Select/Select.tsx +37 -13
  222. package/lib/components/Select/Select.types.ts +77 -54
  223. package/lib/components/Select/__tests__/Select.test.tsx +448 -7
  224. package/lib/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +3 -3
  225. package/lib/components/Select/subcomponents/CustomOption.tsx +24 -10
  226. package/lib/components/Select/subcomponents/CustomSelect.tsx +333 -52
  227. package/lib/components/Select/subcomponents/FilterInput.tsx +80 -0
  228. package/lib/components/Select/subcomponents/NativeSelect.tsx +13 -1
  229. package/lib/components/Select/subcomponents/Panel.tsx +4 -5
  230. package/lib/components/Select/subcomponents/VisibleField.tsx +36 -24
  231. package/lib/components/Select/subcomponents/index.tsx +1 -0
  232. package/lib/components/Snackbar/Snackbar.stories.tsx +1 -1
  233. package/lib/components/Spinner/Spinner.stories.tsx +1 -1
  234. package/lib/components/StandaloneLink/StandaloneLink.stories.tsx +32 -0
  235. package/lib/components/StandaloneLink/StandaloneLink.tsx +183 -0
  236. package/lib/components/StandaloneLink/__tests__/StandaloneLink.test.tsx +57 -0
  237. package/lib/components/StandaloneLink/__tests__/__snapshots__/StandaloneLink.test.tsx.snap +19 -0
  238. package/lib/components/StandaloneLink/index.ts +2 -0
  239. package/lib/components/Table/Table.stories.tsx +337 -0
  240. package/lib/components/Table/Table.tsx +42 -67
  241. package/lib/components/Table/Table.types.ts +14 -0
  242. package/lib/components/Table/__tests__/Table.test.tsx +121 -0
  243. package/lib/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +210 -0
  244. package/lib/components/Table/index.ts +8 -1
  245. package/lib/components/Table/subcomponents/Body.tsx +18 -0
  246. package/lib/components/Table/subcomponents/Cell/Cell.stories.tsx +151 -0
  247. package/lib/components/Table/subcomponents/Cell/Cell.tsx +72 -0
  248. package/lib/components/Table/subcomponents/Cell/CellContent.tsx +91 -0
  249. package/lib/components/Table/subcomponents/Cell/__tests__/Cell.test.tsx +115 -0
  250. package/lib/components/Table/subcomponents/Cell/__tests__/__snapshots__/Cell.test.tsx.snap +107 -0
  251. package/lib/components/Table/subcomponents/Head.tsx +34 -0
  252. package/lib/components/Table/subcomponents/HeadCell/HeadCell.stories.tsx +85 -0
  253. package/lib/components/Table/subcomponents/HeadCell/HeadCell.tsx +99 -0
  254. package/lib/components/Table/subcomponents/HeadCell/HeadCellContent.tsx +61 -0
  255. package/lib/components/Table/subcomponents/HeadCell/__tests__/HeadCell.test.tsx +137 -0
  256. package/lib/components/Table/subcomponents/HeadCell/__tests__/__snapshots__/HeadCell.test.tsx.snap +110 -0
  257. package/lib/components/Table/subcomponents/Row.tsx +49 -0
  258. package/lib/components/Table/subcomponents/SortIcon.tsx +63 -0
  259. package/lib/components/Table/subcomponents/index.ts +14 -0
  260. package/lib/components/Tabs/Tab.tsx +3 -3
  261. package/lib/components/Tabs/TabContext.tsx +1 -0
  262. package/lib/components/Tabs/Tabs.stories.tsx +9 -3
  263. package/lib/components/Tabs/Tabs.tsx +10 -32
  264. package/lib/components/Tabs/__tests__/Tabs.test.tsx +10 -4
  265. package/lib/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +32 -32
  266. package/lib/components/Textarea/Textarea.stories.tsx +1 -1
  267. package/lib/components/Timepicker/Timepicker.stories.tsx +43 -0
  268. package/lib/components/Timepicker/Timepicker.tsx +100 -0
  269. package/lib/components/Timepicker/__tests__/Timepicker.test.tsx +55 -0
  270. package/lib/components/Timepicker/__tests__/__snapshots__/Timepicker.test.tsx.snap +19 -0
  271. package/lib/components/Timepicker/index.tsx +2 -0
  272. package/lib/components/Timepicker/utils/convertDateToTimeString.test.ts +54 -0
  273. package/lib/components/Timepicker/utils/convertDateToTimeString.ts +10 -0
  274. package/lib/components/Timepicker/utils/index.ts +1 -0
  275. package/lib/components/Toggle/Toggle.stories.tsx +1 -1
  276. package/lib/components/Tooltip/Tooltip.stories.tsx +1 -1
  277. package/lib/components/WeekPicker/WeekPicker.stories.tsx +147 -0
  278. package/lib/components/WeekPicker/WeekPicker.tsx +26 -0
  279. package/lib/components/WeekPicker/WeekPicker.types.ts +21 -0
  280. package/lib/components/WeekPicker/index.ts +2 -0
  281. package/lib/components/WeekPicker/subcomponents/CustomDatepicker.tsx +298 -0
  282. package/lib/components/WeekPicker/subcomponents/DatepickerInput.tsx +111 -0
  283. package/lib/components/WeekPicker/subcomponents/VisibleField.tsx +126 -0
  284. package/lib/components/WeekPicker/subcomponents/index.ts +3 -0
  285. package/lib/components/common/Common.mdx +1 -1
  286. package/lib/components/index.ts +28 -2
  287. package/lib/hooks/index.ts +2 -0
  288. package/lib/hooks/useFocusTrap.ts +159 -0
  289. package/lib/index.ts +2 -0
  290. package/lib/theme/defaultTheme.ts +7 -0
  291. package/lib/utils/__tests__/announce.test.ts +121 -0
  292. package/lib/utils/__tests__/capitalise.test.ts +40 -0
  293. package/lib/utils/announce.ts +134 -0
  294. package/lib/utils/capitalise.ts +4 -0
  295. package/lib/utils/index.ts +1 -0
  296. package/package.json +3 -6
  297. package/dist/components/Datepicker/subcomponents/NativeDatepicker.d.ts +0 -6
  298. package/lib/components/Accordion/Accordion.stories.tsx.NOT_READY +0 -93
  299. package/lib/components/Field/__tests__/__snapshots__/Field.test.tsx.snap +0 -300
  300. /package/dist/components/{Datepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.d.ts → FileInput/__tests__/FileInput.test.d.ts} +0 -0
  301. /package/lib/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.test.ts +0 -0
@@ -0,0 +1,91 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`Input > snapshot: no props 1`] = `
4
+ <div
5
+ class="ucl-uikit-fileinput css-r56yy"
6
+ >
7
+ <label
8
+ class="css-1lc9iag"
9
+ for="file-input-1"
10
+ >
11
+ <svg
12
+ class="ucl-uikit-icon css-148hpxb"
13
+ data-testid="ucl-uikit-icon"
14
+ fill="none"
15
+ height="24"
16
+ stroke="currentColor"
17
+ stroke-linecap="round"
18
+ stroke-linejoin="round"
19
+ stroke-width="2"
20
+ viewBox="0 0 24 24"
21
+ width="24"
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ >
24
+ <path
25
+ d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
26
+ />
27
+ <polyline
28
+ points="17 8 12 3 7 8"
29
+ />
30
+ <line
31
+ x1="12"
32
+ x2="12"
33
+ y1="3"
34
+ y2="15"
35
+ />
36
+ </svg>
37
+ Upload File
38
+ </label>
39
+ <input
40
+ class="css-1w0w0g6"
41
+ data-testid="ucl-uikit-fileinput"
42
+ id="file-input-1"
43
+ type="file"
44
+ />
45
+ </div>
46
+ `;
47
+
48
+ exports[`Input > snapshot: value prop 1`] = `
49
+ <div
50
+ class="ucl-uikit-fileinput css-r56yy"
51
+ >
52
+ <label
53
+ class="css-1lc9iag"
54
+ for="file-input-1"
55
+ >
56
+ <svg
57
+ class="ucl-uikit-icon css-148hpxb"
58
+ data-testid="ucl-uikit-icon"
59
+ fill="none"
60
+ height="24"
61
+ stroke="currentColor"
62
+ stroke-linecap="round"
63
+ stroke-linejoin="round"
64
+ stroke-width="2"
65
+ viewBox="0 0 24 24"
66
+ width="24"
67
+ xmlns="http://www.w3.org/2000/svg"
68
+ >
69
+ <path
70
+ d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
71
+ />
72
+ <polyline
73
+ points="17 8 12 3 7 8"
74
+ />
75
+ <line
76
+ x1="12"
77
+ x2="12"
78
+ y1="3"
79
+ y2="15"
80
+ />
81
+ </svg>
82
+ Upload File/Image
83
+ </label>
84
+ <input
85
+ class="css-1w0w0g6"
86
+ data-testid="test123"
87
+ id="file-input-1"
88
+ type="file"
89
+ />
90
+ </div>
91
+ `;
@@ -0,0 +1,2 @@
1
+ export { default } from './FileInput';
2
+ export type { FileInputProps } from './FileInput';
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react';
3
3
  import Footer from './Footer';
4
4
 
5
5
  const meta = {
6
- title: 'Components/Ready to use/Footer',
6
+ title: 'Components/Footer',
7
7
  component: Footer,
8
8
  parameters: {
9
9
  layout: 'fullscreen',
@@ -34,7 +34,7 @@ exports[`Footer > snapshot: footer links provided 1`] = `
34
34
  >
35
35
  <a
36
36
  aria-label="Facebook"
37
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
37
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
38
38
  data-testid="ucl-uikit-footer__social-link"
39
39
  href="https://www.facebook.com/uclofficial/"
40
40
  target="_blank"
@@ -60,7 +60,7 @@ exports[`Footer > snapshot: footer links provided 1`] = `
60
60
  </a>
61
61
  <a
62
62
  aria-label="Flickr"
63
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
63
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
64
64
  data-testid="ucl-uikit-footer__social-link"
65
65
  href="https://www.flickr.com/groups/ucl/"
66
66
  target="_blank"
@@ -89,7 +89,7 @@ exports[`Footer > snapshot: footer links provided 1`] = `
89
89
  </a>
90
90
  <a
91
91
  aria-label="TikTok"
92
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
92
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
93
93
  data-testid="ucl-uikit-footer__social-link"
94
94
  href="https://www.tiktok.com/@uclofficial"
95
95
  target="_blank"
@@ -115,7 +115,7 @@ exports[`Footer > snapshot: footer links provided 1`] = `
115
115
  </a>
116
116
  <a
117
117
  aria-label="YouTube"
118
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
118
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
119
119
  data-testid="ucl-uikit-footer__social-link"
120
120
  href="https://www.youtube.com/ucltv"
121
121
  target="_blank"
@@ -141,7 +141,7 @@ exports[`Footer > snapshot: footer links provided 1`] = `
141
141
  </a>
142
142
  <a
143
143
  aria-label="SoundCloud"
144
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
144
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
145
145
  data-testid="ucl-uikit-footer__social-link"
146
146
  href="https://soundcloud.com/uclsound"
147
147
  target="_blank"
@@ -169,7 +169,7 @@ exports[`Footer > snapshot: footer links provided 1`] = `
169
169
  </a>
170
170
  <a
171
171
  aria-label="X social media platform"
172
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
172
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
173
173
  data-testid="ucl-uikit-footer__social-link"
174
174
  href="https://x.com/ucl"
175
175
  target="_blank"
@@ -195,7 +195,7 @@ exports[`Footer > snapshot: footer links provided 1`] = `
195
195
  </a>
196
196
  <a
197
197
  aria-label="Instagram"
198
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
198
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
199
199
  data-testid="ucl-uikit-footer__social-link"
200
200
  href="https://www.instagram.com/ucl/"
201
201
  target="_blank"
@@ -247,7 +247,7 @@ exports[`Footer > snapshot: footer links provided 1`] = `
247
247
  class="css-bq4k8p"
248
248
  >
249
249
  ©
250
- 2025
250
+ 2026
251
251
  UCL
252
252
  </span>
253
253
  </div>
@@ -316,14 +316,14 @@ exports[`Footer > snapshot: nav links 1`] = `
316
316
  Category 1
317
317
  </h3>
318
318
  <a
319
- class="ucl-link ucl-uikit-footer__nav-link css-kdejd1"
319
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__nav-link css-1v2y7lc"
320
320
  data-testid="ucl-uikit-footer__nav-link"
321
321
  href="#"
322
322
  >
323
323
  Item 1
324
324
  </a>
325
325
  <a
326
- class="ucl-link ucl-uikit-footer__nav-link css-kdejd1"
326
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__nav-link css-1v2y7lc"
327
327
  data-testid="ucl-uikit-footer__nav-link"
328
328
  href="#"
329
329
  >
@@ -340,14 +340,14 @@ exports[`Footer > snapshot: nav links 1`] = `
340
340
  Category 2
341
341
  </h3>
342
342
  <a
343
- class="ucl-link ucl-uikit-footer__nav-link css-kdejd1"
343
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__nav-link css-1v2y7lc"
344
344
  data-testid="ucl-uikit-footer__nav-link"
345
345
  href="#"
346
346
  >
347
347
  Item 1
348
348
  </a>
349
349
  <a
350
- class="ucl-link ucl-uikit-footer__nav-link css-kdejd1"
350
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__nav-link css-1v2y7lc"
351
351
  data-testid="ucl-uikit-footer__nav-link"
352
352
  href="#"
353
353
  >
@@ -378,7 +378,7 @@ exports[`Footer > snapshot: nav links 1`] = `
378
378
  >
379
379
  <a
380
380
  aria-label="Facebook"
381
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
381
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
382
382
  data-testid="ucl-uikit-footer__social-link"
383
383
  href="https://www.facebook.com/uclofficial/"
384
384
  target="_blank"
@@ -404,7 +404,7 @@ exports[`Footer > snapshot: nav links 1`] = `
404
404
  </a>
405
405
  <a
406
406
  aria-label="Flickr"
407
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
407
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
408
408
  data-testid="ucl-uikit-footer__social-link"
409
409
  href="https://www.flickr.com/groups/ucl/"
410
410
  target="_blank"
@@ -433,7 +433,7 @@ exports[`Footer > snapshot: nav links 1`] = `
433
433
  </a>
434
434
  <a
435
435
  aria-label="TikTok"
436
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
436
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
437
437
  data-testid="ucl-uikit-footer__social-link"
438
438
  href="https://www.tiktok.com/@uclofficial"
439
439
  target="_blank"
@@ -459,7 +459,7 @@ exports[`Footer > snapshot: nav links 1`] = `
459
459
  </a>
460
460
  <a
461
461
  aria-label="YouTube"
462
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
462
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
463
463
  data-testid="ucl-uikit-footer__social-link"
464
464
  href="https://www.youtube.com/ucltv"
465
465
  target="_blank"
@@ -485,7 +485,7 @@ exports[`Footer > snapshot: nav links 1`] = `
485
485
  </a>
486
486
  <a
487
487
  aria-label="SoundCloud"
488
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
488
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
489
489
  data-testid="ucl-uikit-footer__social-link"
490
490
  href="https://soundcloud.com/uclsound"
491
491
  target="_blank"
@@ -513,7 +513,7 @@ exports[`Footer > snapshot: nav links 1`] = `
513
513
  </a>
514
514
  <a
515
515
  aria-label="X social media platform"
516
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
516
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
517
517
  data-testid="ucl-uikit-footer__social-link"
518
518
  href="https://x.com/ucl"
519
519
  target="_blank"
@@ -539,7 +539,7 @@ exports[`Footer > snapshot: nav links 1`] = `
539
539
  </a>
540
540
  <a
541
541
  aria-label="Instagram"
542
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
542
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
543
543
  data-testid="ucl-uikit-footer__social-link"
544
544
  href="https://www.instagram.com/ucl/"
545
545
  target="_blank"
@@ -591,7 +591,7 @@ exports[`Footer > snapshot: nav links 1`] = `
591
591
  class="css-bq4k8p"
592
592
  >
593
593
  ©
594
- 2025
594
+ 2026
595
595
  UCL
596
596
  </span>
597
597
  </div>
@@ -673,7 +673,7 @@ exports[`Footer > snapshot: no nav links 1`] = `
673
673
  >
674
674
  <a
675
675
  aria-label="Facebook"
676
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
676
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
677
677
  data-testid="ucl-uikit-footer__social-link"
678
678
  href="https://www.facebook.com/uclofficial/"
679
679
  target="_blank"
@@ -699,7 +699,7 @@ exports[`Footer > snapshot: no nav links 1`] = `
699
699
  </a>
700
700
  <a
701
701
  aria-label="Flickr"
702
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
702
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
703
703
  data-testid="ucl-uikit-footer__social-link"
704
704
  href="https://www.flickr.com/groups/ucl/"
705
705
  target="_blank"
@@ -728,7 +728,7 @@ exports[`Footer > snapshot: no nav links 1`] = `
728
728
  </a>
729
729
  <a
730
730
  aria-label="TikTok"
731
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
731
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
732
732
  data-testid="ucl-uikit-footer__social-link"
733
733
  href="https://www.tiktok.com/@uclofficial"
734
734
  target="_blank"
@@ -754,7 +754,7 @@ exports[`Footer > snapshot: no nav links 1`] = `
754
754
  </a>
755
755
  <a
756
756
  aria-label="YouTube"
757
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
757
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
758
758
  data-testid="ucl-uikit-footer__social-link"
759
759
  href="https://www.youtube.com/ucltv"
760
760
  target="_blank"
@@ -780,7 +780,7 @@ exports[`Footer > snapshot: no nav links 1`] = `
780
780
  </a>
781
781
  <a
782
782
  aria-label="SoundCloud"
783
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
783
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
784
784
  data-testid="ucl-uikit-footer__social-link"
785
785
  href="https://soundcloud.com/uclsound"
786
786
  target="_blank"
@@ -808,7 +808,7 @@ exports[`Footer > snapshot: no nav links 1`] = `
808
808
  </a>
809
809
  <a
810
810
  aria-label="X social media platform"
811
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
811
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
812
812
  data-testid="ucl-uikit-footer__social-link"
813
813
  href="https://x.com/ucl"
814
814
  target="_blank"
@@ -834,7 +834,7 @@ exports[`Footer > snapshot: no nav links 1`] = `
834
834
  </a>
835
835
  <a
836
836
  aria-label="Instagram"
837
- class="ucl-link ucl-uikit-footer__social-link css-1bd4uza"
837
+ class="ucl-uikit-base-link ucl-uikit-link ucl-uikit-footer__social-link css-1neoh67"
838
838
  data-testid="ucl-uikit-footer__social-link"
839
839
  href="https://www.instagram.com/ucl/"
840
840
  target="_blank"
@@ -886,7 +886,7 @@ exports[`Footer > snapshot: no nav links 1`] = `
886
886
  class="css-bq4k8p"
887
887
  >
888
888
  ©
889
- 2025
889
+ 2026
890
890
  UCL
891
891
  </span>
892
892
  </div>
@@ -0,0 +1,52 @@
1
+ import * as HeaderStories from "./Header.stories";
2
+ import { Meta, Title, Subtitle, Canvas, Controls } from "@storybook/blocks";
3
+
4
+ export const usage = {
5
+ default: `<Header title='App Name' />`,
6
+ homeLink: `<Header title='App Name' homeLinkHref='/' homeLinkAriaLabel='Go to home' />`,
7
+ menu: `<Header title='App Name' homeLinkHref='/'>
8
+ <Header.Menu>
9
+ <Menu title='App Name'>
10
+ <Menu.Section>
11
+ <Menu.Item icon={<Icon.Home size={20} />}>Home Page</Menu.Item>
12
+ <Menu.Item icon={<Icon.Tool size={20} />}>Tools</Menu.Item>
13
+ </Menu.Section>
14
+ </Menu>
15
+ </Header.Menu>
16
+ </Header>`,
17
+ };
18
+
19
+ <Meta of={HeaderStories} />
20
+ <Title />
21
+ <Subtitle>A simple header with optional menu and home link support.</Subtitle>
22
+
23
+ Use `<Header>` to display the UCL logo and app title at the top of a page. Pass
24
+ `homeLinkHref` to make the logo/title clickable, and wrap a menu in `<Header.Menu>`
25
+ to add a menu button on the right.
26
+
27
+ <Canvas source={{ code: usage.default }} />
28
+
29
+ ## Home link
30
+
31
+ Add `homeLinkHref` (and optionally `homeLinkAriaLabel`) to make the logo/title act as a home link.
32
+ For client routing, pass your router link through `homeLinkProps` (e.g. `homeLinkProps={{ component: RouterLink }}`, with `import { Link as RouterLink } from 'react-router-dom'` or `'wouter'`).
33
+
34
+ <Canvas of={HeaderStories.WithHomeLink} source={{ code: usage.homeLink }} />
35
+
36
+ ## Menu
37
+
38
+ Wrap a `Menu` inside `Header.Menu` to show a menu button on the right.
39
+
40
+ <Canvas of={HeaderStories.WithMenu} source={{ code: usage.menu }} />
41
+
42
+ ## Fixed header
43
+
44
+ Use `fixed` to pin the header to the top of the viewport.
45
+
46
+ <Canvas of={HeaderStories.Fixed} />
47
+
48
+ ## Props
49
+ Full props specification for `<Header>` is below.
50
+ <Canvas source={{ code: usage.default }} />
51
+ You can use the controls below to manipulate the `<Header>` component above.
52
+ <Controls />
@@ -0,0 +1,98 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import Header from './Header';
3
+ import Menu from '../Menu';
4
+ import Icon from '../Icon';
5
+
6
+ const storyWrapperStyle: React.CSSProperties = { minHeight: 400 };
7
+
8
+ const meta = {
9
+ title: 'Components/Header',
10
+ component: Header,
11
+ parameters: {
12
+ layout: 'fullscreen',
13
+ },
14
+ argTypes: {
15
+ title: { control: 'text' },
16
+ fixed: { control: 'boolean' },
17
+ homeLinkHref: { control: 'text' },
18
+ homeLinkAriaLabel: { control: 'text' },
19
+ className: { control: 'text' },
20
+ children: { control: false },
21
+ },
22
+ args: {
23
+ title: 'App Name',
24
+ },
25
+ tags: ['autodocs'],
26
+ } satisfies Meta<typeof Header>;
27
+
28
+ export default meta;
29
+ type Story = StoryObj<typeof meta>;
30
+
31
+ export const Default: Story = {
32
+ render: (args) => (
33
+ <div style={{ overflow: 'hidden' }}>
34
+ <Header {...args} />
35
+ </div>
36
+ ),
37
+ };
38
+
39
+ export const Fixed: Story = {
40
+ render: (args) => (
41
+ <div
42
+ style={{
43
+ height: '240px',
44
+ overflowY: 'auto',
45
+ position: 'relative',
46
+ }}
47
+ >
48
+ <Header
49
+ {...args}
50
+ fixed
51
+ title='App Name'
52
+ />
53
+ <div
54
+ style={{
55
+ paddingTop: '88px', // keep content below the fixed header
56
+ height: '600px',
57
+ margin: '0 16px',
58
+ }}
59
+ >
60
+ Scroll inside this panel; the header should stay fixed to the top of the
61
+ viewport.
62
+ </div>
63
+ </div>
64
+ ),
65
+ };
66
+
67
+ export const WithHomeLink: Story = {
68
+ name: 'With home link',
69
+ render: (args) => (
70
+ <div style={{ overflow: 'hidden' }}>
71
+ <Header {...args} />
72
+ </div>
73
+ ),
74
+ args: {
75
+ homeLinkHref: '/',
76
+ homeLinkAriaLabel: 'Go to home',
77
+ },
78
+ };
79
+
80
+ export const WithMenu: Story = {
81
+ render: (args) => (
82
+ <div style={storyWrapperStyle}>
83
+ <Header {...args}>
84
+ <Header.Menu>
85
+ <Menu title='App Name'>
86
+ <Menu.Section>
87
+ <Menu.Item icon={<Icon.Home size={20} />}>Home Page</Menu.Item>
88
+ <Menu.Item icon={<Icon.Tool size={20} />}>Tools</Menu.Item>
89
+ </Menu.Section>
90
+ <Menu.Section>
91
+ <Menu.Item icon={<Icon.Settings size={20} />}>Settings</Menu.Item>
92
+ </Menu.Section>
93
+ </Menu>
94
+ </Header.Menu>
95
+ </Header>
96
+ </div>
97
+ ),
98
+ };
@@ -3,6 +3,7 @@ import { css, cx } from '@emotion/css';
3
3
  import { useTheme } from '../..';
4
4
  import UclLogo from '../UclLogo/UclLogo';
5
5
  import HeaderMenu from './HeaderMenu';
6
+ import Link from '../Link';
6
7
 
7
8
  export const NAME = 'ucl-uikit-header';
8
9
  export const HEADER_DESKTOP_HEIGHT_PX = 72;
@@ -12,12 +13,24 @@ export const DEFAULT_Z_INDEX = 3;
12
13
  export interface HeaderProps extends HTMLAttributes<HTMLElement> {
13
14
  title?: string;
14
15
  fixed?: boolean;
16
+ titleAs?: React.ElementType<React.HTMLAttributes<HTMLElement>>;
17
+ titleClassName?: string;
18
+ titleProps?: Record<string, unknown>;
19
+ homeLinkHref?: string;
20
+ homeLinkProps?: Record<string, unknown>;
21
+ homeLinkAriaLabel?: string;
15
22
  testId?: string;
16
23
  }
17
24
 
18
25
  const Header = ({
19
26
  title,
20
27
  fixed = false,
28
+ titleAs = 'div',
29
+ titleClassName,
30
+ titleProps,
31
+ homeLinkHref,
32
+ homeLinkProps,
33
+ homeLinkAriaLabel = 'Go to homepage',
21
34
  testId = NAME,
22
35
  className,
23
36
  children,
@@ -68,7 +81,7 @@ const Header = ({
68
81
  }
69
82
  `;
70
83
 
71
- const titleStyle = css`
84
+ const titleBaseStyle = css`
72
85
  display: none;
73
86
  margin: 0;
74
87
  font-size: ${theme.font.size.f18};
@@ -80,14 +93,63 @@ const Header = ({
80
93
  }
81
94
  `;
82
95
 
96
+ const linkStyle = css`
97
+ color: inherit;
98
+ text-decoration: none;
99
+ display: inline-flex;
100
+ align-items: center;
101
+ gap: 8px;
102
+ &:visited {
103
+ color: inherit;
104
+ }
105
+ &:hover {
106
+ color: inherit;
107
+ }
108
+ &:active {
109
+ color: inherit;
110
+ }
111
+ &:focus-visible {
112
+ outline: none;
113
+ box-shadow: ${theme.boxShadow.focus};
114
+ }
115
+ `;
116
+
117
+ const titleStyle = cx(titleBaseStyle, titleClassName);
118
+
119
+ const TitleComponent = titleAs;
120
+
121
+ const headerContent = (
122
+ <>
123
+ <UclLogo className={uclLogoStyle} />
124
+ {title && (
125
+ <TitleComponent
126
+ className={titleStyle}
127
+ {...titleProps}
128
+ >
129
+ {title}
130
+ </TitleComponent>
131
+ )}
132
+ </>
133
+ );
134
+
83
135
  return (
84
136
  <header
85
137
  className={style}
86
138
  data-testid={testId}
87
139
  {...props}
88
140
  >
89
- <UclLogo className={uclLogoStyle} />
90
- {title && <h1 className={titleStyle}>{title}</h1>}
141
+ {homeLinkHref ? (
142
+ <Link
143
+ href={homeLinkHref}
144
+ aria-label={homeLinkAriaLabel}
145
+ className={linkStyle}
146
+ {...homeLinkProps}
147
+ >
148
+ {headerContent}
149
+ </Link>
150
+ ) : (
151
+ headerContent
152
+ )}
91
153
 
92
154
  {children}
93
155
  </header>
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, test } from 'vitest';
2
- import { render } from '@testing-library/react';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import Header from '../Header';
4
4
  import { ThemeContextProvider } from '../../../theme/useTheme';
5
5
 
@@ -23,4 +23,20 @@ describe('Header', () => {
23
23
  );
24
24
  expect(renderResult.container.firstChild).toMatchSnapshot();
25
25
  });
26
+
27
+ test('wraps logo/title in a home link when homeLinkHref is provided', () => {
28
+ render(
29
+ <ThemeContextProvider>
30
+ <Header
31
+ title='LIDS'
32
+ homeLinkHref='/'
33
+ homeLinkAriaLabel='Go home'
34
+ />
35
+ </ThemeContextProvider>
36
+ );
37
+
38
+ const link = screen.getByLabelText('Go home');
39
+ expect(link).toBeInTheDocument();
40
+ expect(link.getAttribute('href')).toBe('/');
41
+ });
26
42
  });