uikit-react-public 0.17.4 → 0.21.9

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 (282) hide show
  1. package/README.md +2 -4
  2. package/dist/components/Accordion/Accordion.Heading.d.ts +1 -0
  3. package/dist/components/AppHeader/AppHeader.d.ts +1 -1
  4. package/dist/components/AppHeader/AppHeaderBottom.d.ts +1 -1
  5. package/dist/components/AppHeader/AppHeaderNav.d.ts +1 -1
  6. package/dist/components/AppHeader/AppHeaderTop.d.ts +1 -1
  7. package/dist/components/Breadcrumbs/Breadcrumb.d.ts +3 -4
  8. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  9. package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -1
  10. package/dist/components/Button/Button.d.ts +7 -3
  11. package/dist/components/Button/Button.stories.d.ts +17 -7
  12. package/dist/components/Button/style/buttonAccentStyle.d.ts +4 -0
  13. package/dist/components/Button/style/buttonPrimaryDestructiveStyle.d.ts +4 -0
  14. package/dist/components/Button/style/buttonPrimaryStyle.d.ts +4 -0
  15. package/dist/components/Button/style/buttonPrimarySubtleStyle.d.ts +4 -0
  16. package/dist/components/Button/style/buttonPrimaryWarningStyle.d.ts +4 -0
  17. package/dist/components/Button/style/buttonSecondaryDestructiveStyle.d.ts +4 -0
  18. package/dist/components/Button/style/buttonSecondaryStyle.d.ts +4 -0
  19. package/dist/components/Button/style/buttonSecondarySubtleStyle.d.ts +4 -0
  20. package/dist/components/Button/style/buttonTertiaryDestructiveStyle.d.ts +4 -0
  21. package/dist/components/Button/style/buttonTertiaryNoPaddingStyle.d.ts +4 -0
  22. package/dist/components/Button/style/buttonTertiaryStyle.d.ts +4 -0
  23. package/dist/components/Checkbox/Checkbox.d.ts +1 -0
  24. package/dist/components/FooterNew/BackToTop.d.ts +8 -0
  25. package/dist/components/FooterNew/Footer.d.ts +23 -0
  26. package/dist/components/FooterNew/FooterColumn.d.ts +8 -0
  27. package/dist/components/FooterNew/FooterLinks.d.ts +7 -0
  28. package/dist/components/FooterNew/FooterNavLink.d.ts +8 -0
  29. package/dist/components/FooterNew/LegalAndCopyright.d.ts +14 -0
  30. package/dist/components/FooterNew/LogoAddressAndSocial.d.ts +10 -0
  31. package/dist/components/FooterNew/SocialLink.d.ts +8 -0
  32. package/dist/components/FooterNew/__tests__/Footer.test.d.ts +1 -0
  33. package/dist/components/FooterNew/index.d.ts +2 -0
  34. package/dist/components/HeaderNew/Header.d.ts +18 -0
  35. package/dist/components/HeaderNew/HeaderBorder.d.ts +7 -0
  36. package/dist/components/HeaderNew/HeaderLogo.d.ts +9 -0
  37. package/dist/components/HeaderNew/HeaderMenuContainer.d.ts +7 -0
  38. package/dist/components/HeaderNew/HeaderTitle.d.ts +9 -0
  39. package/dist/components/HeaderNew/__tests__/Header.test.d.ts +1 -0
  40. package/dist/components/HeaderNew/constants.d.ts +3 -0
  41. package/dist/components/HeaderNew/index.d.ts +3 -0
  42. package/dist/components/Heading/Heading.d.ts +6 -4
  43. package/dist/components/Heading/Heading.stories.d.ts +8 -6
  44. package/dist/components/Icon/svgImports.d.ts +7 -881
  45. package/dist/components/Link/BaseLink.d.ts +14 -5
  46. package/dist/components/Link/Link.d.ts +8 -3
  47. package/dist/components/Link/Link.stories.d.ts +3 -1
  48. package/dist/components/MenuNew/Menu.context.d.ts +14 -0
  49. package/dist/components/MenuNew/Menu.d.ts +20 -0
  50. package/dist/components/MenuNew/MenuContent.d.ts +9 -0
  51. package/dist/components/MenuNew/MenuItem.d.ts +10 -0
  52. package/dist/components/MenuNew/MenuSection.d.ts +7 -0
  53. package/dist/components/MenuNew/index.d.ts +6 -0
  54. package/dist/components/MenuNew/trigger/ButtonMenuTrigger.d.ts +8 -0
  55. package/dist/components/MenuNew/trigger/IconMenuTrigger.d.ts +8 -0
  56. package/dist/components/Overlay/Overlay.stories.d.ts +12 -12
  57. package/dist/components/Paragraph/Paragraph.d.ts +5 -2
  58. package/dist/components/Paragraph/Paragraph.stories.d.ts +6 -3
  59. package/dist/components/Select/Select.d.ts +2 -1
  60. package/dist/components/Select/Select.stories.d.ts +13 -1
  61. package/dist/components/Select/Select.types.d.ts +40 -13
  62. package/dist/components/Select/subcomponents/CustomSelect.d.ts +3 -3
  63. package/dist/components/Select/subcomponents/FilterInput.d.ts +3 -1
  64. package/dist/components/Select/subcomponents/NativeSelect.d.ts +2 -2
  65. package/dist/components/Select/subcomponents/VisibleField.d.ts +4 -1
  66. package/dist/components/Spinner/Spinner.d.ts +2 -0
  67. package/dist/components/StandaloneLink/StandaloneLink.d.ts +8 -5
  68. package/dist/components/StandaloneLink/StandaloneLink.stories.d.ts +3 -1
  69. package/dist/components/Table/Table.d.ts +3 -3
  70. package/dist/components/Table/Table.stories.d.ts +3 -3
  71. package/dist/components/Table/Table.types.d.ts +1 -0
  72. package/dist/components/Table/subcomponents/Cell/Cell.d.ts +5 -1
  73. package/dist/components/Table/subcomponents/Cell/Cell.stories.d.ts +15 -13
  74. package/dist/components/Table/subcomponents/Cell/CellContent.d.ts +5 -1
  75. package/dist/components/Table/subcomponents/HeadCell/HeadCell.d.ts +2 -1
  76. package/dist/components/Table/subcomponents/HeadCell/HeadCell.stories.d.ts +14 -13
  77. package/dist/components/Table/subcomponents/HeadCell/HeadCellContent.d.ts +2 -1
  78. package/dist/components/Table/subcomponents/__tests__/Row.test.d.ts +1 -0
  79. package/dist/components/UclLogoNew/UclLogo.d.ts +8 -0
  80. package/dist/components/UclLogoNew/index.d.ts +2 -0
  81. package/dist/components/index.d.ts +12 -0
  82. package/dist/index.js +20104 -15317
  83. package/dist/theme/__tests__/fonts.test.d.ts +1 -0
  84. package/dist/theme/common/themeCommon.d.ts +904 -0
  85. package/dist/theme/fonts.d.ts +18 -0
  86. package/dist/theme/index.d.ts +6 -3
  87. package/dist/theme/light/lightColour.d.ts +126 -0
  88. package/dist/theme/light/lightTheme.d.ts +3 -0
  89. package/dist/theme/original/color.d.ts +166 -0
  90. package/dist/theme/original/defaultTheme.d.ts +1340 -0
  91. package/dist/theme/original/originalColourNewStructure.d.ts +126 -0
  92. package/dist/theme/useTheme.d.ts +2174 -0
  93. package/dist/utils/addAlphaToHex.d.ts +5 -0
  94. package/dist/utils/scrollToTop.d.ts +2 -0
  95. package/lib/components/Accordion/Accordion.Heading.tsx +51 -39
  96. package/lib/components/Accordion/Accordion.Panel.tsx +0 -4
  97. package/lib/components/Accordion/Accordion.tsx +34 -28
  98. package/lib/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap +12 -10
  99. package/lib/components/Alert/Alert.tsx +12 -12
  100. package/lib/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap +13 -39
  101. package/lib/components/AppHeader/AppHeader.tsx +6 -11
  102. package/lib/components/AppHeader/AppHeaderBottom.tsx +2 -3
  103. package/lib/components/AppHeader/AppHeaderNav.tsx +2 -3
  104. package/lib/components/AppHeader/AppHeaderTop.tsx +1 -1
  105. package/lib/components/AppHeader/__tests__/__snapshots__/AppHeader.test.tsx.snap +2 -2
  106. package/lib/components/AppMenu/__tests__/__snapshots__/AppMenu.test.tsx.snap +6 -19
  107. package/lib/components/Badge/Badge.stories.tsx +1 -1
  108. package/lib/components/Breadcrumbs/Breadcrumb.tsx +26 -12
  109. package/lib/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  110. package/lib/components/Breadcrumbs/__tests__/Breadcrumbs.test.tsx +9 -27
  111. package/lib/components/Breadcrumbs/__tests__/__snapshots__/Breadcrumbs.test.tsx.snap +24 -20
  112. package/lib/components/Button/Button.mdx +32 -279
  113. package/lib/components/Button/Button.stories.tsx +43 -50
  114. package/lib/components/Button/Button.tsx +165 -25
  115. package/lib/components/Button/__tests__/Button.test.tsx +49 -15
  116. package/lib/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +80 -73
  117. package/lib/components/Button/style/buttonAccentStyle.ts +53 -0
  118. package/lib/components/Button/style/buttonPrimaryDestructiveStyle.ts +55 -0
  119. package/lib/components/Button/style/buttonPrimaryStyle.ts +53 -0
  120. package/lib/components/Button/style/buttonPrimarySubtleStyle.ts +64 -0
  121. package/lib/components/Button/style/buttonPrimaryWarningStyle.ts +56 -0
  122. package/lib/components/Button/style/buttonSecondaryDestructiveStyle.ts +63 -0
  123. package/lib/components/Button/style/buttonSecondaryStyle.ts +62 -0
  124. package/lib/components/Button/style/buttonSecondarySubtleStyle.ts +72 -0
  125. package/lib/components/Button/style/buttonTertiaryDestructiveStyle.ts +65 -0
  126. package/lib/components/Button/style/buttonTertiaryNoPaddingStyle.ts +52 -0
  127. package/lib/components/Button/style/buttonTertiaryStyle.ts +62 -0
  128. package/lib/components/Calendar/Calendar.stories.tsx +33 -13
  129. package/lib/components/Calendar/Calendar.tsx +2 -2
  130. package/lib/components/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +99 -95
  131. package/lib/components/Calendar/subcomponents/AcademicWeek.tsx +2 -1
  132. package/lib/components/Calendar/subcomponents/AcademicWeeks.tsx +2 -3
  133. package/lib/components/Calendar/subcomponents/ColumnHeading.tsx +3 -7
  134. package/lib/components/Calendar/subcomponents/Controls.tsx +1 -1
  135. package/lib/components/Calendar/subcomponents/Day.stories.tsx +1 -1
  136. package/lib/components/Calendar/subcomponents/Day.tsx +7 -9
  137. package/lib/components/Calendar/subcomponents/EventDot.tsx +4 -8
  138. package/lib/components/Checkbox/Checkbox.stories.tsx +1 -1
  139. package/lib/components/Checkbox/Checkbox.tsx +12 -10
  140. package/lib/components/Checkbox/__tests__/Checkbox.test.tsx +29 -0
  141. package/lib/components/Checkbox/__tests__/__snapshots__/Checkbox.test.tsx.snap +4 -4
  142. package/lib/components/Datepicker/__tests__/Datepicker.test.tsx +117 -0
  143. package/lib/components/Datepicker/__tests__/__snapshots__/Datepicker.test.tsx.snap +16 -44
  144. package/lib/components/Datepicker/subcomponents/CustomDatepicker.tsx +10 -1
  145. package/lib/components/Datepicker/subcomponents/VisibleField.tsx +24 -23
  146. package/lib/components/Dialog/BaseDialog.tsx +2 -2
  147. package/lib/components/Dialog/Dialog.stories.tsx +1 -1
  148. package/lib/components/Divider/__tests__/__snapshots__/Breadcrumbs.test.tsx.snap +12 -12
  149. package/lib/components/FeedbackDialog/FeedbackDialog.stories.tsx +1 -1
  150. package/lib/components/FeedbackDialog/FeedbackDialog.tsx +4 -6
  151. package/lib/components/Field/CharacterCount.tsx +2 -2
  152. package/lib/components/Field/ErrorText.tsx +1 -1
  153. package/lib/components/Field/Field.tsx +1 -1
  154. package/lib/components/Field/HelperText.tsx +3 -1
  155. package/lib/components/FileInput/FileInput.stories.tsx +1 -1
  156. package/lib/components/FileInput/__tests__/__snapshots__/FileInput.test.tsx.snap +4 -20
  157. package/lib/components/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +70 -79
  158. package/lib/components/FooterNew/BackToTop.tsx +83 -0
  159. package/lib/components/FooterNew/Footer.tsx +110 -0
  160. package/lib/components/FooterNew/FooterColumn.tsx +79 -0
  161. package/lib/components/FooterNew/FooterLinks.tsx +44 -0
  162. package/lib/components/FooterNew/FooterNavLink.tsx +63 -0
  163. package/lib/components/FooterNew/LegalAndCopyright.tsx +150 -0
  164. package/lib/components/FooterNew/LogoAddressAndSocial.tsx +154 -0
  165. package/lib/components/FooterNew/SocialLink.tsx +108 -0
  166. package/lib/components/FooterNew/__tests__/Footer.test.tsx +51 -0
  167. package/lib/components/FooterNew/__tests__/__snapshots__/Footer.test.tsx.snap +1107 -0
  168. package/lib/components/FooterNew/index.ts +2 -0
  169. package/lib/components/HeaderDraft/__tests__/__snapshots__/Header.test.tsx.snap +3 -2
  170. package/lib/components/HeaderNew/Header.tsx +93 -0
  171. package/lib/components/HeaderNew/HeaderBorder.tsx +55 -0
  172. package/lib/components/HeaderNew/HeaderLogo.tsx +70 -0
  173. package/lib/components/HeaderNew/HeaderMenuContainer.tsx +35 -0
  174. package/lib/components/HeaderNew/HeaderTitle.tsx +53 -0
  175. package/lib/components/HeaderNew/__tests__/Header.test.tsx +42 -0
  176. package/lib/components/HeaderNew/__tests__/__snapshots__/Header.test.tsx.snap +79 -0
  177. package/lib/components/HeaderNew/constants.ts +3 -0
  178. package/lib/components/HeaderNew/index.ts +7 -0
  179. package/lib/components/Heading/Heading.stories.tsx +34 -41
  180. package/lib/components/Heading/Heading.tsx +180 -49
  181. package/lib/components/Heading/__tests__/__snapshots__/Heading.test.tsx.snap +4 -4
  182. package/lib/components/Icon/__tests__/__snapshots__/Icon.test.tsx.snap +16 -12
  183. package/lib/components/Icon/svgImports.ts +318 -296
  184. package/lib/components/IconButton/IconButton.tsx +3 -4
  185. package/lib/components/IconButton/__tests__/__snapshots__/IconButton.test.tsx.snap +12 -9
  186. package/lib/components/Link/BaseLink.tsx +114 -71
  187. package/lib/components/Link/Link.stories.tsx +1 -1
  188. package/lib/components/Link/Link.tsx +120 -109
  189. package/lib/components/Link/__tests__/__snapshots__/link.test.tsx.snap +2 -2
  190. package/lib/components/MenuNew/Menu.context.tsx +149 -0
  191. package/lib/components/MenuNew/Menu.tsx +75 -0
  192. package/lib/components/MenuNew/MenuContent.tsx +140 -0
  193. package/lib/components/MenuNew/MenuItem.tsx +101 -0
  194. package/lib/components/MenuNew/MenuSection.tsx +47 -0
  195. package/lib/components/MenuNew/index.ts +8 -0
  196. package/lib/components/MenuNew/trigger/ButtonMenuTrigger.tsx +42 -0
  197. package/lib/components/MenuNew/trigger/IconMenuTrigger.tsx +40 -0
  198. package/lib/components/Pagination/Pagination.stories.tsx +1 -1
  199. package/lib/components/Pagination/PaginationControls.tsx +4 -5
  200. package/lib/components/Pagination/PaginationInfo.tsx +2 -3
  201. package/lib/components/Paragraph/Paragraph.stories.tsx +29 -27
  202. package/lib/components/Paragraph/Paragraph.tsx +212 -81
  203. package/lib/components/Paragraph/__tests__/__snapshots__/Paragraph.test.tsx.snap +5 -5
  204. package/lib/components/Radio/Radio.stories.tsx +1 -1
  205. package/lib/components/Radio/Radio.tsx +8 -8
  206. package/lib/components/Radio/__tests__/__snapshots__/Radio.test.tsx.snap +4 -4
  207. package/lib/components/Search/__tests__/__snapshots__/Search.test.tsx.snap +12 -32
  208. package/lib/components/Select/Select.mdx +23 -0
  209. package/lib/components/Select/Select.stories.tsx +43 -10
  210. package/lib/components/Select/Select.tsx +14 -3
  211. package/lib/components/Select/Select.types.ts +53 -16
  212. package/lib/components/Select/__tests__/Select.test.tsx +250 -1
  213. package/lib/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +5 -4
  214. package/lib/components/Select/subcomponents/CustomOption.tsx +10 -3
  215. package/lib/components/Select/subcomponents/CustomSelect.tsx +110 -10
  216. package/lib/components/Select/subcomponents/FilterInput.tsx +13 -3
  217. package/lib/components/Select/subcomponents/NativeSelect.tsx +10 -18
  218. package/lib/components/Select/subcomponents/Panel.tsx +2 -2
  219. package/lib/components/Select/subcomponents/VisibleField.tsx +48 -3
  220. package/lib/components/Snackbar/__tests__/__snapshots__/Snackbar.test.tsx.snap +9 -15
  221. package/lib/components/Spinner/Spinner.tsx +24 -5
  222. package/lib/components/Spinner/__tests__/Spinner.test.tsx +35 -5
  223. package/lib/components/Spinner/__tests__/__snapshots__/Spinner.test.tsx.snap +40 -16
  224. package/lib/components/StandaloneLink/StandaloneLink.stories.tsx +1 -1
  225. package/lib/components/StandaloneLink/StandaloneLink.tsx +180 -163
  226. package/lib/components/StandaloneLink/__tests__/__snapshots__/StandaloneLink.test.tsx.snap +2 -2
  227. package/lib/components/Table/Table.stories.tsx +1 -1
  228. package/lib/components/Table/Table.tsx +2 -0
  229. package/lib/components/Table/Table.types.ts +1 -0
  230. package/lib/components/Table/__tests__/Table.test.tsx +19 -0
  231. package/lib/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +7 -3
  232. package/lib/components/Table/subcomponents/Cell/Cell.stories.tsx +1 -1
  233. package/lib/components/Table/subcomponents/Cell/Cell.tsx +23 -2
  234. package/lib/components/Table/subcomponents/Cell/CellContent.tsx +12 -1
  235. package/lib/components/Table/subcomponents/Cell/__tests__/Cell.test.tsx +106 -0
  236. package/lib/components/Table/subcomponents/Cell/__tests__/__snapshots__/Cell.test.tsx.snap +4 -3
  237. package/lib/components/Table/subcomponents/HeadCell/HeadCell.stories.tsx +1 -1
  238. package/lib/components/Table/subcomponents/HeadCell/HeadCell.tsx +28 -6
  239. package/lib/components/Table/subcomponents/HeadCell/HeadCellContent.tsx +3 -0
  240. package/lib/components/Table/subcomponents/HeadCell/__tests__/HeadCell.test.tsx +221 -2
  241. package/lib/components/Table/subcomponents/HeadCell/__tests__/__snapshots__/HeadCell.test.tsx.snap +6 -4
  242. package/lib/components/Table/subcomponents/Row.tsx +2 -2
  243. package/lib/components/Table/subcomponents/SortIcon.tsx +1 -0
  244. package/lib/components/Table/subcomponents/__tests__/Row.test.tsx +59 -0
  245. package/lib/components/Tabs/Tab.tsx +3 -3
  246. package/lib/components/Tabs/Tabs.stories.tsx +1 -1
  247. package/lib/components/Tabs/Tabs.tsx +5 -3
  248. package/lib/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +4 -4
  249. package/lib/components/Timepicker/Timepicker.stories.tsx +1 -1
  250. package/lib/components/Toggle/Toggle.tsx +5 -5
  251. package/lib/components/Toggle/ToggleHandle.tsx +2 -3
  252. package/lib/components/Tooltip/Tooltip.tsx +2 -2
  253. package/lib/components/Tooltip/__tests__/__snapshots__/tooltip.test.tsx.snap +2 -2
  254. package/lib/components/UclLogoNew/UclLogo.tsx +42 -0
  255. package/lib/components/UclLogoNew/index.ts +2 -0
  256. package/lib/components/WeekPicker/WeekPicker.stories.tsx +3 -5
  257. package/lib/components/common/Common.mdx +0 -1
  258. package/lib/components/index.ts +19 -1
  259. package/lib/theme/Colours.mdx +1 -1
  260. package/lib/theme/Theme.mdx +1 -1
  261. package/lib/theme/Typography.mdx +1 -1
  262. package/lib/theme/__tests__/fonts.test.ts +37 -0
  263. package/lib/theme/common/themeCommon.ts +515 -0
  264. package/lib/theme/fonts.ts +110 -0
  265. package/lib/theme/index.ts +6 -6
  266. package/lib/theme/light/lightColour.ts +232 -0
  267. package/lib/theme/light/lightTheme.ts +37 -0
  268. package/lib/theme/{defaultTheme.ts → original/color.ts} +17 -199
  269. package/lib/theme/original/defaultTheme.ts +207 -0
  270. package/lib/theme/original/originalColourNewStructure.ts +185 -0
  271. package/lib/theme/useTheme.tsx +72 -15
  272. package/lib/types/assets.d.ts +10 -0
  273. package/lib/utils/addAlphaToHex.ts +29 -0
  274. package/lib/utils/scrollToTop.ts +5 -0
  275. package/package.json +11 -6
  276. package/dist/components/Button/buttonPrimaryStyle.d.ts +0 -4
  277. package/dist/components/Button/buttonSecondaryStyle.d.ts +0 -4
  278. package/dist/components/Button/buttonTertiaryStyle.d.ts +0 -4
  279. package/dist/theme/defaultTheme.d.ts +0 -274
  280. package/lib/components/Button/buttonPrimaryStyle.ts +0 -62
  281. package/lib/components/Button/buttonSecondaryStyle.ts +0 -65
  282. package/lib/components/Button/buttonTertiaryStyle.ts +0 -54
@@ -18,7 +18,8 @@ const AcademicWeek = ({ weekNumber }: AcademicWeekProps) => {
18
18
  height: 40px;
19
19
  font-family: ${theme.font.family.primary};
20
20
  font-size: ${theme.font.size.f14};
21
- color: #6345a5; // TODO: Needs a sensible design token
21
+ /* color: #6345a5; */
22
+ color: ${theme.colour.text.brandPrimary};
22
23
  `;
23
24
 
24
25
  const style = cx(NAME, baseStyle);
@@ -13,7 +13,6 @@ interface AcademicWeeksProps {
13
13
  }
14
14
 
15
15
  const AcademicWeeks = ({ date, weeks }: AcademicWeeksProps) => {
16
-
17
16
  const [theme] = useTheme();
18
17
 
19
18
  const academicWeekNumbers = getAcademicWeekNumbers(weeks, date);
@@ -23,7 +22,7 @@ const AcademicWeeks = ({ date, weeks }: AcademicWeeksProps) => {
23
22
  flex-direction: column;
24
23
  padding-top: 32px;
25
24
  width: 50px;
26
- background-color: ${theme.color.interaction.blue5};
25
+ background-color: ${theme.colour.surface.brand};
27
26
  user-select: none;
28
27
  `;
29
28
 
@@ -42,6 +41,6 @@ const AcademicWeeks = ({ date, weeks }: AcademicWeeksProps) => {
42
41
  ))}
43
42
  </div>
44
43
  );
45
- }
44
+ };
46
45
 
47
46
  export default AcademicWeeks;
@@ -9,11 +9,7 @@ interface ColumnHeadingProps {
9
9
 
10
10
  const NAME = 'ucl-uikit-calendar__column-heading';
11
11
 
12
- const ColumnHeading = ({
13
- index,
14
- day,
15
- isWeekend
16
- }: ColumnHeadingProps) => {
12
+ const ColumnHeading = ({ index, day, isWeekend }: ColumnHeadingProps) => {
17
13
  const [theme] = useTheme();
18
14
 
19
15
  const baseStyle = css`
@@ -23,8 +19,8 @@ const ColumnHeading = ({
23
19
  width: 40px;
24
20
  height: 32px;
25
21
  color: ${isWeekend
26
- ? theme.color.system.orange100
27
- : theme.color.neutral.grey60};
22
+ ? theme.colour.text.warningOnBgFill
23
+ : theme.colour.text.secondary};
28
24
  font-weight: 700;
29
25
  `;
30
26
 
@@ -32,7 +32,7 @@ const Controls = ({ month, changeMonth }: ControlsProps) => {
32
32
  cursor: pointer;
33
33
 
34
34
  &:hover {
35
- color: ${theme.color.neutral.grey60};
35
+ color: ${theme.colour.icon.default};
36
36
  }
37
37
  `;
38
38
 
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import Day from './Day';
3
3
 
4
4
  const meta = {
5
- title: 'Components/Work in progress/Calendar/Day',
5
+ title: 'Components/Calendar/Day',
6
6
  component: Day,
7
7
  argTypes: {
8
8
  events: {
@@ -42,25 +42,24 @@ const Day = ({
42
42
  position: relative;
43
43
  width: 40px;
44
44
  height: 40px;
45
- background-color: ${theme.color.neutral.white};
45
+ background-color: ${theme.colour.fill.inverse};
46
46
  cursor: pointer;
47
47
  outline: none;
48
48
 
49
49
  &:hover {
50
- background-color: ${theme.color.neutral.grey10};
50
+ background-color: ${theme.colour.fill.hover};
51
51
  }
52
52
 
53
53
  ${isSelected &&
54
54
  css`
55
- /* background-color: ${theme.color.interaction.blue70}; */
56
55
  background-color: ${isDisabled
57
- ? theme.color.neutral.grey10
58
- : theme.color.interaction.blue70};
56
+ ? theme.colour.fill.disabled
57
+ : theme.colour.fill.brand};
59
58
 
60
- color: ${theme.color.text.inverted};
59
+ color: ${theme.colour.text.inverse};
61
60
 
62
61
  &:hover {
63
- background-color: ${theme.color.interaction.blue100};
62
+ background-color: ${theme.colour.fill.brandHover};
64
63
  }
65
64
  `}
66
65
  ${isDisabled &&
@@ -68,7 +67,6 @@ const Day = ({
68
67
  cursor: not-allowed;
69
68
 
70
69
  &:hover {
71
- /* background-color: ${theme.color.neutral.white}; */
72
70
  background-color: ${isSelected
73
71
  ? theme.color.neutral.grey10
74
72
  : theme.color.neutral.white};
@@ -91,7 +89,7 @@ const Day = ({
91
89
  `}
92
90
  ${isDisabled &&
93
91
  css`
94
- color: ${theme.color.neutral.grey20};
92
+ color: ${theme.colour.text.disabled};
95
93
  `}
96
94
  `;
97
95
 
@@ -9,17 +9,13 @@ interface EventDotProps {
9
9
  }
10
10
 
11
11
  const EventDot = ({ inverted, inCurrentMonth }: EventDotProps) => {
12
-
13
12
  const [theme] = useTheme();
14
13
 
15
- const invertedColour = theme.color.neutral.white;
16
- const outOfCurrentMonthColour = '#8C8C8C'; // TODO: Needs adding to `defaultTheme.ts`, as a design token
17
-
18
14
  const backgroundColour = inCurrentMonth
19
15
  ? inverted
20
- ? invertedColour
21
- : theme.color.interaction.blue70
22
- : outOfCurrentMonthColour;
16
+ ? theme.colour.icon.inverse
17
+ : theme.colour.icon.brand
18
+ : theme.colour.icon.tertiary;
23
19
 
24
20
  const baseStyle = css`
25
21
  width: 6px;
@@ -34,7 +30,7 @@ const EventDot = ({ inverted, inCurrentMonth }: EventDotProps) => {
34
30
  <div
35
31
  data-testid={NAME}
36
32
  className={style}
37
- />
33
+ />
38
34
  );
39
35
  };
40
36
 
@@ -4,7 +4,7 @@ import { useArgs } from '@storybook/preview-api';
4
4
  import Checkbox from './Checkbox';
5
5
 
6
6
  const meta = {
7
- title: 'Components/Work in progress/Checkbox',
7
+ title: 'Components/Checkbox',
8
8
  component: Checkbox,
9
9
  argTypes: {
10
10
  checked: { control: { type: 'boolean' } },
@@ -12,10 +12,10 @@ import marginsStyle, { MarginProps } from '../common/marginsStyle';
12
12
 
13
13
  export const NAME = 'ucl-uikit-checkbox';
14
14
 
15
- export interface CheckboxBaseProps
16
- extends InputHTMLAttributes<HTMLInputElement> {
15
+ export interface CheckboxBaseProps extends InputHTMLAttributes<HTMLInputElement> {
17
16
  indeterminate?: boolean;
18
17
  testId?: string;
18
+ ariaLabel?: string;
19
19
  }
20
20
 
21
21
  export type CheckboxProps = CheckboxBaseProps & MarginProps;
@@ -30,6 +30,7 @@ const Checkbox = forwardRef<Ref, CheckboxProps>(
30
30
  defaultChecked,
31
31
  disabled,
32
32
  testId = NAME,
33
+ ariaLabel,
33
34
  className,
34
35
  ...props
35
36
  },
@@ -61,7 +62,7 @@ const Checkbox = forwardRef<Ref, CheckboxProps>(
61
62
  border-radius: ${theme.radius.r2};
62
63
  outline: none;
63
64
  box-sizing: border-box;
64
- color: ${theme.color.neutral.white};
65
+ color: ${theme.colour.icon.inverse};
65
66
  transition:
66
67
  background-color 0.15s ease-out,
67
68
  border-color 0.15s ease-out;
@@ -75,19 +76,19 @@ const Checkbox = forwardRef<Ref, CheckboxProps>(
75
76
  `;
76
77
 
77
78
  const checkedStyle = css`
78
- background-color: ${theme.color.interaction.blue70};
79
- border-color: ${theme.color.interaction.blue70};
80
- color: ${theme.color.neutral.white};
79
+ background-color: ${theme.colour.icon.brand};
80
+ border-color: ${theme.colour.icon.brand};
81
+ color: ${theme.colour.icon.inverse};
81
82
  `;
82
83
 
83
84
  const uncheckedStyle = css`
84
- background-color: ${theme.color.neutral.white};
85
- border-color: ${theme.color.neutral.grey60};
85
+ background-color: ${theme.colour.icon.inverse};
86
+ border-color: ${theme.colour.speciality.inputDefault};
86
87
  `;
87
88
 
88
89
  const disabledStyle = css`
89
- background-color: ${theme.color.neutral.grey20};
90
- border-color: ${theme.color.neutral.grey20};
90
+ background-color: ${theme.colour.icon.disabled};
91
+ border-color: ${theme.colour.icon.disabled};
91
92
  cursor: not-allowed;
92
93
  `;
93
94
 
@@ -140,6 +141,7 @@ const Checkbox = forwardRef<Ref, CheckboxProps>(
140
141
  ref={ref}
141
142
  className={hiddenInputStyle}
142
143
  data-testid={testId}
144
+ aria-label={ariaLabel}
143
145
  {...(isControlled ? { checked } : { defaultChecked })}
144
146
  disabled={disabled}
145
147
  onChange={handleChange}
@@ -96,4 +96,33 @@ describe('Checkbox', () => {
96
96
  await user.click(checkbox);
97
97
  expect(checkbox.checked).toBe(false);
98
98
  });
99
+
100
+ // Accessibility tests
101
+
102
+ test('ariaLabel prop is applied to the input as aria-label', () => {
103
+ render(
104
+ <ThemeContextProvider>
105
+ <Checkbox ariaLabel='Select John Smith' />
106
+ </ThemeContextProvider>
107
+ );
108
+ expect(screen.getByRole('checkbox')).toHaveAttribute(
109
+ 'aria-label',
110
+ 'Select John Smith'
111
+ );
112
+ });
113
+
114
+ test('aria-label passed via spread props overrides ariaLabel', () => {
115
+ render(
116
+ <ThemeContextProvider>
117
+ <Checkbox
118
+ ariaLabel='Default label'
119
+ aria-label='Override label'
120
+ />
121
+ </ThemeContextProvider>
122
+ );
123
+ expect(screen.getByRole('checkbox')).toHaveAttribute(
124
+ 'aria-label',
125
+ 'Override label'
126
+ );
127
+ });
99
128
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`Checkbox > snapshot: checked prop 1`] = `
4
4
  <span
5
- class="ucl-uikit-checkbox css-1g4adr4"
5
+ class="ucl-uikit-checkbox css-xzd91z"
6
6
  >
7
7
  <input
8
8
  checked=""
@@ -32,7 +32,7 @@ exports[`Checkbox > snapshot: checked prop 1`] = `
32
32
 
33
33
  exports[`Checkbox > snapshot: indeterminate prop 1`] = `
34
34
  <span
35
- class="ucl-uikit-checkbox css-1g4adr4"
35
+ class="ucl-uikit-checkbox css-xzd91z"
36
36
  >
37
37
  <input
38
38
  class="css-nzy7im"
@@ -64,7 +64,7 @@ exports[`Checkbox > snapshot: indeterminate prop 1`] = `
64
64
 
65
65
  exports[`Checkbox > snapshot: no props 1`] = `
66
66
  <span
67
- class="ucl-uikit-checkbox css-cg31xm"
67
+ class="ucl-uikit-checkbox css-tumlz"
68
68
  >
69
69
  <input
70
70
  class="css-nzy7im"
@@ -76,7 +76,7 @@ exports[`Checkbox > snapshot: no props 1`] = `
76
76
 
77
77
  exports[`Checkbox > snapshot: testId prop 1`] = `
78
78
  <span
79
- class="ucl-uikit-checkbox css-cg31xm"
79
+ class="ucl-uikit-checkbox css-tumlz"
80
80
  >
81
81
  <input
82
82
  class="css-nzy7im"
@@ -1,3 +1,4 @@
1
+ import { useState } from 'react';
1
2
  import { describe, test, expect, vi, beforeEach } from 'vitest';
2
3
  import { render, screen, fireEvent } from '@testing-library/react';
3
4
  import userEvent from '@testing-library/user-event';
@@ -226,5 +227,121 @@ describe('Datepicker', () => {
226
227
  const input = screen.getByTestId('ucl-uikit-datepicker__input');
227
228
  expect(input).toHaveAttribute('aria-label', customAriaLabel);
228
229
  });
230
+
231
+ test('Default Datepicker does not add an extra icon tab stop', async () => {
232
+ const user = userEvent.setup();
233
+
234
+ customRender(
235
+ <div>
236
+ <button type='button'>Before</button>
237
+ <Datepicker />
238
+ <button type='button'>After</button>
239
+ </div>
240
+ );
241
+
242
+ await user.tab();
243
+ expect(screen.getByRole('button', { name: 'Before' })).toHaveFocus();
244
+
245
+ await user.tab();
246
+ expect(screen.getByRole('textbox')).toHaveFocus();
247
+
248
+ await user.tab();
249
+ expect(screen.getByRole('button', { name: 'After' })).toHaveFocus();
250
+ });
251
+
252
+ test('Clearable Datepicker clear icon is focusable when a value is present', async () => {
253
+ const user = userEvent.setup();
254
+
255
+ customRender(
256
+ <div>
257
+ <button type='button'>Before</button>
258
+ <Datepicker
259
+ clearable
260
+ value={new Date(2025, 2, 10)}
261
+ />
262
+ <button type='button'>After</button>
263
+ </div>
264
+ );
265
+
266
+ await user.tab();
267
+ expect(screen.getByRole('button', { name: 'Before' })).toHaveFocus();
268
+
269
+ await user.tab();
270
+ expect(screen.getByRole('textbox')).toHaveFocus();
271
+
272
+ await user.tab();
273
+ expect(screen.getByRole('button', { name: 'Clear date' })).toHaveFocus();
274
+
275
+ await user.tab();
276
+ expect(screen.getByRole('button', { name: 'After' })).toHaveFocus();
277
+ });
278
+
279
+ test('Clearing with the keyboard restores focus to the input', async () => {
280
+ const user = userEvent.setup();
281
+
282
+ const ControlledDatepicker = () => {
283
+ const [value, setValue] = useState<Date | null>(new Date(2025, 2, 10));
284
+
285
+ return (
286
+ <Datepicker
287
+ clearable
288
+ value={value}
289
+ onValueChange={setValue}
290
+ />
291
+ );
292
+ };
293
+
294
+ customRender(<ControlledDatepicker />);
295
+
296
+ await user.tab();
297
+ expect(screen.getByRole('textbox')).toHaveFocus();
298
+
299
+ await user.tab();
300
+ const clearButton = screen.getByRole('button', { name: 'Clear date' });
301
+ expect(clearButton).toHaveFocus();
302
+
303
+ await user.keyboard('{Enter}');
304
+
305
+ expect(screen.getByRole('textbox')).toHaveFocus();
306
+ expect(
307
+ screen.queryByRole('button', { name: 'Clear date' })
308
+ ).not.toBeInTheDocument();
309
+ });
310
+
311
+ test('Disabled Datepicker is skipped when tabbing', async () => {
312
+ const user = userEvent.setup();
313
+
314
+ customRender(
315
+ <div>
316
+ <button type='button'>Before</button>
317
+ <Datepicker disabled />
318
+ <button type='button'>After</button>
319
+ </div>
320
+ );
321
+
322
+ await user.tab();
323
+ expect(screen.getByRole('button', { name: 'Before' })).toHaveFocus();
324
+
325
+ await user.tab();
326
+ expect(screen.getByRole('button', { name: 'After' })).toHaveFocus();
327
+ });
328
+
329
+ test('Disabled Datepicker icon control is not tabbable and cannot open', async () => {
330
+ const user = userEvent.setup();
331
+
332
+ customRender(<Datepicker disabled />);
333
+
334
+ const iconButton = screen.getByTestId(
335
+ 'ucl-uikit-datepicker__visible-field-icon-button'
336
+ );
337
+
338
+ expect(iconButton).toHaveAttribute('aria-label', 'Open calendar');
339
+ expect(iconButton).toHaveAttribute('tabindex', '-1');
340
+ expect(iconButton).toBeDisabled();
341
+
342
+ await user.click(iconButton);
343
+
344
+ expect(screen.queryByTestId('ucl-uikit-calendar')).not.toBeInTheDocument();
345
+ });
229
346
  // #endregion
230
347
  });
@@ -17,17 +17,18 @@ exports[`Datepicker > Snapshot: no date provided 1`] = `
17
17
  type="text"
18
18
  value=""
19
19
  />
20
- <div
20
+ <button
21
21
  aria-label="Open calendar"
22
- class="css-nnfy6l"
22
+ class="ucl-uikit-icon-button css-1uz96ir"
23
23
  data-testid="ucl-uikit-datepicker__visible-field-icon-button"
24
- role="button"
25
- tabindex="0"
24
+ tabindex="-1"
25
+ type="button"
26
26
  >
27
27
  <svg
28
28
  class="ucl-uikit-icon css-1u4xgls"
29
29
  data-testid="ucl-uikit-icon"
30
30
  fill="none"
31
+ focusable="false"
31
32
  height="24"
32
33
  stroke="currentColor"
33
34
  stroke-linecap="round"
@@ -45,26 +46,11 @@ exports[`Datepicker > Snapshot: no date provided 1`] = `
45
46
  x="3"
46
47
  y="4"
47
48
  />
48
- <line
49
- x1="16"
50
- x2="16"
51
- y1="2"
52
- y2="6"
53
- />
54
- <line
55
- x1="8"
56
- x2="8"
57
- y1="2"
58
- y2="6"
59
- />
60
- <line
61
- x1="3"
62
- x2="21"
63
- y1="10"
64
- y2="10"
49
+ <path
50
+ d="M16 2v4M8 2v4m-5 4h18"
65
51
  />
66
52
  </svg>
67
- </div>
53
+ </button>
68
54
  </div>
69
55
  </div>
70
56
  `;
@@ -86,17 +72,18 @@ exports[`Datepicker > Snapshot: with date provided 1`] = `
86
72
  type="text"
87
73
  value="10/03/2025"
88
74
  />
89
- <div
75
+ <button
90
76
  aria-label="Open calendar"
91
- class="css-nnfy6l"
77
+ class="ucl-uikit-icon-button css-1uz96ir"
92
78
  data-testid="ucl-uikit-datepicker__visible-field-icon-button"
93
- role="button"
94
- tabindex="0"
79
+ tabindex="-1"
80
+ type="button"
95
81
  >
96
82
  <svg
97
83
  class="ucl-uikit-icon css-1u4xgls"
98
84
  data-testid="ucl-uikit-icon"
99
85
  fill="none"
86
+ focusable="false"
100
87
  height="24"
101
88
  stroke="currentColor"
102
89
  stroke-linecap="round"
@@ -114,26 +101,11 @@ exports[`Datepicker > Snapshot: with date provided 1`] = `
114
101
  x="3"
115
102
  y="4"
116
103
  />
117
- <line
118
- x1="16"
119
- x2="16"
120
- y1="2"
121
- y2="6"
122
- />
123
- <line
124
- x1="8"
125
- x2="8"
126
- y1="2"
127
- y2="6"
128
- />
129
- <line
130
- x1="3"
131
- x2="21"
132
- y1="10"
133
- y2="10"
104
+ <path
105
+ d="M16 2v4M8 2v4m-5 4h18"
134
106
  />
135
107
  </svg>
136
- </div>
108
+ </button>
137
109
  </div>
138
110
  </div>
139
111
  `;
@@ -55,6 +55,7 @@ const CustomDatepicker = ({
55
55
  const effectiveRef = ref || internalRef;
56
56
  const internalInputRef = useRef<HTMLInputElement>(null);
57
57
  const effectiveInputRef = inputRef || internalInputRef;
58
+ const restoreFocusAfterClearRef = useRef(false);
58
59
 
59
60
  const [panelOpen, setPanelOpen] = useState(false);
60
61
 
@@ -75,6 +76,13 @@ const CustomDatepicker = ({
75
76
  resetField();
76
77
  }, [value, resetField]);
77
78
 
79
+ useEffect(() => {
80
+ if (!value && restoreFocusAfterClearRef.current) {
81
+ effectiveInputRef.current?.focus();
82
+ restoreFocusAfterClearRef.current = false;
83
+ }
84
+ }, [value, effectiveInputRef]);
85
+
78
86
  const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
79
87
  setInputValue(event.target.value);
80
88
  };
@@ -191,7 +199,8 @@ const CustomDatepicker = ({
191
199
 
192
200
  const handleClear = (event: React.SyntheticEvent) => {
193
201
  event.stopPropagation(); // Prevent opening the calendar panel
194
- onValueChange(null);
202
+ restoreFocusAfterClearRef.current = true;
203
+ onValueChange(null, event);
195
204
  };
196
205
 
197
206
  const baseStyle = css`
@@ -1,6 +1,6 @@
1
1
  import { css, cx } from '@emotion/css';
2
2
  import { DatepickerInput } from './';
3
- import { Icon } from '../../..';
3
+ import { Icon, IconButton } from '../../..';
4
4
  import { useTheme } from '../../../theme';
5
5
  import React from 'react';
6
6
  import type { InputProps } from './DatepickerInput';
@@ -71,6 +71,8 @@ const VisibleField = ({
71
71
  align-items: center;
72
72
  justify-content: center;
73
73
  padding: 0 16px;
74
+ border: none;
75
+ background: transparent;
74
76
  // padding: 0 16px 0 4px;
75
77
  height: 100%;
76
78
  cursor: pointer;
@@ -110,30 +112,29 @@ const VisibleField = ({
110
112
  ref={inputRef}
111
113
  {...inputProps}
112
114
  />
113
- <div
114
- onClick={showClearIcon ? onClear : onButtonClick}
115
- onKeyDown={(e) => {
116
- if (e.key === 'Enter' || e.key === ' ') {
117
- e.preventDefault();
118
- if (showClearIcon) {
119
- onClear(e);
120
- } else {
121
- onButtonClick();
122
- }
123
- }
124
- }}
125
- className={iconButtonStyle}
126
- tabIndex={0}
127
- role='button'
128
- aria-label={showClearIcon ? 'Clear date' : 'Open calendar'}
129
- data-testid={`${NAME}-icon-button`}
130
- >
131
- {showClearIcon ? (
115
+ {showClearIcon ? (
116
+ <IconButton
117
+ type='button'
118
+ onClick={onClear}
119
+ className={iconButtonStyle}
120
+ aria-label='Clear date'
121
+ data-testid={`${NAME}-icon-button`}
122
+ >
132
123
  <Icon.X className={iconStyle} />
133
- ) : (
124
+ </IconButton>
125
+ ) : (
126
+ <IconButton
127
+ type='button'
128
+ onClick={onButtonClick}
129
+ className={iconButtonStyle}
130
+ aria-label='Open calendar'
131
+ data-testid={`${NAME}-icon-button`}
132
+ tabIndex={-1}
133
+ disabled={disabled}
134
+ >
134
135
  <Icon.Calendar className={iconStyle} />
135
- )}
136
- </div>
136
+ </IconButton>
137
+ )}
137
138
  </div>
138
139
  );
139
140
  };
@@ -174,11 +174,11 @@ const BaseDialog = ({
174
174
 
175
175
  @media (min-width: ${theme.breakpoints.tablet}px) {
176
176
  width: ${width}px;
177
- max-width: calc(100vw - ${theme.margin.m16}px);
177
+ max-width: calc(100vw - ${theme.margin.m16});
178
178
  height: fit-content;
179
179
 
180
180
  &:modal {
181
- max-width: ${MEDIUM_WIDTH}px;
181
+ max-width: min(${width}px, calc(100vw - ${theme.margin.m16}));
182
182
  max-height: calc(100vh - 32px);
183
183
  }
184
184
  }
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import Dialog from './Dialog';
3
3
 
4
4
  const meta = {
5
- title: 'Components/Work in progress/Dialog',
5
+ title: 'Components/Dialog',
6
6
  component: Dialog,
7
7
  parameters: {
8
8
  docs: {