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
@@ -0,0 +1,5 @@
1
+ declare const tokenToHex: (token: {
2
+ hex: string;
3
+ alpha?: number;
4
+ }) => string;
5
+ export default tokenToHex;
@@ -0,0 +1,2 @@
1
+ declare const scrollToTop: () => void;
2
+ export default scrollToTop;
@@ -5,6 +5,7 @@ import Icon from '../Icon/Icon';
5
5
  import { useAccordionContext } from './Accordion';
6
6
 
7
7
  export const NAME = 'ucl-uikit-accordion__heading';
8
+ export const ICON_NAME = 'ucl-uikit-accordion__heading__icon';
8
9
 
9
10
  export interface AccordionHeadingProps extends HTMLAttributes<HTMLElement> {
10
11
  as?: keyof HTMLElementTagNameMap;
@@ -28,44 +29,61 @@ const AccordionHeading: React.FC<AccordionHeadingProps> = ({
28
29
  }
29
30
  };
30
31
 
31
- const headingStyle = cx(
32
- NAME,
33
- css`
34
- display: flex;
35
- position: relative;
36
- justify-content: space-between;
37
- align-items: center;
38
- padding: ${theme.padding.p16};
39
- background-color: ${theme.color.neutral.white};
40
- cursor: ${disabled ? 'not-allowed' : 'pointer'};
41
- font-weight: ${theme.font.weight.bold};
42
- transition:
43
- background-color 0.3s ease,
44
- box-shadow 0.3s ease;
45
- margin: 0;
46
- border: none;
47
- outline: none;
48
- text-decoration: none;
49
- box-sizing: border-box;
50
- width: 100%;
51
- font-size: inherit;
52
- line-height: inherit;
32
+ const baseStyle = css`
33
+ display: flex;
34
+ position: relative;
35
+ justify-content: space-between;
36
+ align-items: center;
37
+ padding: ${theme.padding.p16};
38
+ background-color: ${theme.colour.fill.inverse};
39
+ cursor: pointer;
40
+ font-weight: ${theme.font.weight.bold};
41
+ transition: background-color 0.15s ease;
42
+ margin: 0;
43
+ border: none;
44
+ outline: none;
45
+ text-decoration: none;
46
+ box-sizing: border-box;
47
+ width: 100%;
48
+ font-size: inherit;
49
+ line-height: inherit;
53
50
 
54
- &:hover {
55
- background-color: ${!disabled
56
- ? theme.color.neutral.grey5
57
- : theme.color.text.disabled};
58
- }
51
+ &:hover {
52
+ background-color: ${theme.colour.surface.brandHover};
59
53
 
60
- &:focus-visible {
61
- outline: none;
62
- box-shadow: ${theme.boxShadow.focus};
63
- z-index: 20;
54
+ [class*='${ICON_NAME}'] {
55
+ color: ${theme.colour.icon.default};
64
56
  }
65
- `,
57
+ }
58
+ `;
59
+
60
+ const disabledStyle = css`
61
+ cursor: 'not-allowed';
62
+
63
+ &:hover {
64
+ background-color: ${theme.colour.text.disabled};
65
+ }
66
+ `;
67
+
68
+ const headingStyle = cx(
69
+ NAME,
70
+ baseStyle,
71
+ disabled && disabledStyle,
66
72
  className
67
73
  );
68
74
 
75
+ const iconBaseStyle = css`
76
+ transform: rotate(${isOpen ? '180deg' : '0deg'});
77
+ transition: transform 0.15s ease;
78
+ color: ${theme.colour.icon.brand};
79
+ `;
80
+
81
+ const iconDisabledStyle = css`
82
+ color: ${theme.colour.icon.disabled};
83
+ `;
84
+
85
+ const iconStyle = cx(ICON_NAME, iconBaseStyle, disabled && iconDisabledStyle);
86
+
69
87
  return (
70
88
  <Component
71
89
  className={headingStyle}
@@ -79,13 +97,7 @@ const AccordionHeading: React.FC<AccordionHeadingProps> = ({
79
97
  {children}
80
98
  <Icon.ChevronDown
81
99
  size={size === 'medium' ? 32 : 24}
82
- className={css`
83
- transform: rotate(${isOpen ? '180deg' : '0deg'});
84
- transition: transform 0.15s ease;
85
- color: ${disabled
86
- ? theme.color.text.disabled
87
- : theme.color.interaction.blue70};
88
- `}
100
+ className={iconStyle}
89
101
  />
90
102
  </Component>
91
103
  );
@@ -29,11 +29,7 @@ const AccordionPanel: React.FC<AccordionPanelProps> = ({
29
29
  min-width: 0;
30
30
  flex-shrink: 1;
31
31
  padding: ${theme.padding.p16};
32
- font-family: ${theme.font.family.primary};
33
32
  font-weight: ${theme.font.weight.regular};
34
- background-color: ${theme.color.neutral.white};
35
- font-size: ${theme.font.size.f16};
36
- color: ${theme.color.text.primary};
37
33
  box-sizing: border-box;
38
34
  overflow: hidden;
39
35
  overflow-wrap: break-word;
@@ -59,34 +59,40 @@ const Accordion: React.FC<AccordionProps> & {
59
59
  }
60
60
  };
61
61
 
62
- const accordionStyle = cx(
62
+ const baseStyle = css`
63
+ width: 660px;
64
+ min-width: 288px;
65
+ max-width: 660px;
66
+ box-sizing: border-box;
67
+ border: 1px solid ${theme.colour.border.default};
68
+ background-color: ${theme.colour.surface.default};
69
+ color: ${theme.colour.text.default};
70
+ font-family: ${theme.font.family.primary};
71
+ font-size: ${theme.font.size.f16};
72
+ flex-shrink: 1;
73
+ `;
74
+
75
+ const sizeSmallStyle = css`
76
+ font-size: ${theme.font.size.f16};
77
+ line-height: ${theme.height.h24};
78
+ `;
79
+
80
+ const sizeMediumStyle = css`
81
+ font-size: ${theme.font.size.f20};
82
+ `;
83
+
84
+ const disabledStyle = css`
85
+ pointer-events: none;
86
+ background-color: ${theme.colour.fill.inverse};
87
+ color: ${theme.colour.text.disabled};
88
+ `;
89
+
90
+ const style = cx(
63
91
  NAME,
64
- css`
65
- width: 660px;
66
- min-width: 288px;
67
- max-width: 660px;
68
- box-sizing: border-box;
69
- border: 1px solid ${theme.color.neutral.grey10};
70
- background-color: ${theme.color.neutral.white};
71
- font-family: ${theme.font.family.primary};
72
- font-size: ${theme.font.size.f16};
73
- flex-shrink: 1;
74
- `,
75
- size === 'small' &&
76
- css`
77
- font-size: ${theme.font.size.f16};
78
- line-height: ${theme.height.h24};
79
- `,
80
- size === 'medium' &&
81
- css`
82
- font-size: ${theme.font.size.f20};
83
- `,
84
- disabled &&
85
- css`
86
- pointer-events: none;
87
- background-color: ${theme.color.link.disabled};
88
- color: ${theme.color.text.muted};
89
- `,
92
+ baseStyle,
93
+ size === 'small' && sizeSmallStyle,
94
+ size === 'medium' && sizeMediumStyle,
95
+ disabled && disabledStyle,
90
96
  className
91
97
  );
92
98
 
@@ -100,7 +106,7 @@ const Accordion: React.FC<AccordionProps> & {
100
106
  }}
101
107
  >
102
108
  <div
103
- className={accordionStyle}
109
+ className={style}
104
110
  aria-disabled={disabled}
105
111
  data-testid={testId}
106
112
  >
@@ -3,21 +3,22 @@
3
3
  exports[`Accordion > snapshot: no props 1`] = `
4
4
  <div
5
5
  aria-disabled="false"
6
- class="ucl-uikit-accordion css-rs0koa"
6
+ class="ucl-uikit-accordion css-1o0gcpe"
7
7
  data-testid="ucl-uikit-accordion"
8
8
  >
9
9
  <div
10
10
  aria-expanded="false"
11
- class="ucl-uikit-accordion__heading css-1yg3n9"
11
+ class="ucl-uikit-accordion__heading css-18gluve"
12
12
  data-testid="ucl-uikit-accordion__heading"
13
13
  role="button"
14
14
  tabindex="0"
15
15
  >
16
16
  Heading
17
17
  <svg
18
- class="ucl-uikit-icon css-oi0ukk"
18
+ class="ucl-uikit-icon ucl-uikit-accordion__heading__icon css-o97cjm"
19
19
  data-testid="ucl-uikit-icon"
20
20
  fill="none"
21
+ focusable="false"
21
22
  height="32"
22
23
  stroke="currentColor"
23
24
  stroke-linecap="round"
@@ -27,8 +28,8 @@ exports[`Accordion > snapshot: no props 1`] = `
27
28
  width="32"
28
29
  xmlns="http://www.w3.org/2000/svg"
29
30
  >
30
- <polyline
31
- points="6 9 12 15 18 9"
31
+ <path
32
+ d="m6 9 6 6 6-6"
32
33
  />
33
34
  </svg>
34
35
  </div>
@@ -38,21 +39,22 @@ exports[`Accordion > snapshot: no props 1`] = `
38
39
  exports[`Accordion > snapshot: testId prop 1`] = `
39
40
  <div
40
41
  aria-disabled="false"
41
- class="ucl-uikit-accordion css-rs0koa"
42
+ class="ucl-uikit-accordion css-1o0gcpe"
42
43
  data-testid="abc"
43
44
  >
44
45
  <div
45
46
  aria-expanded="false"
46
- class="ucl-uikit-accordion__heading css-1yg3n9"
47
+ class="ucl-uikit-accordion__heading css-18gluve"
47
48
  data-testid="ucl-uikit-accordion__heading"
48
49
  role="button"
49
50
  tabindex="0"
50
51
  >
51
52
  Heading
52
53
  <svg
53
- class="ucl-uikit-icon css-oi0ukk"
54
+ class="ucl-uikit-icon ucl-uikit-accordion__heading__icon css-o97cjm"
54
55
  data-testid="ucl-uikit-icon"
55
56
  fill="none"
57
+ focusable="false"
56
58
  height="32"
57
59
  stroke="currentColor"
58
60
  stroke-linecap="round"
@@ -62,8 +64,8 @@ exports[`Accordion > snapshot: testId prop 1`] = `
62
64
  width="32"
63
65
  xmlns="http://www.w3.org/2000/svg"
64
66
  >
65
- <polyline
66
- points="6 9 12 15 18 9"
67
+ <path
68
+ d="m6 9 6 6 6-6"
67
69
  />
68
70
  </svg>
69
71
  </div>
@@ -56,23 +56,23 @@ const Alert = ({
56
56
  `;
57
57
 
58
58
  const infoStyle = css`
59
- background-color: ${theme.color.interaction.blue10};
60
- border-color: ${theme.color.interaction.blue70};
59
+ background-color: ${theme.colour.surface.brand};
60
+ border-color: ${theme.colour.border.brand};
61
61
  `;
62
62
 
63
63
  const successStyle = css`
64
- background-color: ${theme.color.system.green10};
65
- border-color: ${theme.color.system.green70};
64
+ background-color: ${theme.colour.surface.success};
65
+ border-color: ${theme.colour.border.success};
66
66
  `;
67
67
 
68
68
  const warningStyle = css`
69
- background-color: ${theme.color.system.orange10};
70
- border-color: ${theme.color.system.orange70};
69
+ background-color: ${theme.colour.surface.warning};
70
+ border-color: ${theme.colour.border.warning};
71
71
  `;
72
72
 
73
73
  const errorStyle = css`
74
- background-color: ${theme.color.system.red10};
75
- border-color: ${theme.color.system.red70};
74
+ background-color: ${theme.colour.surface.critical};
75
+ border-color: ${theme.colour.border.critical};
76
76
  `;
77
77
 
78
78
  const style = cx(
@@ -89,19 +89,19 @@ const Alert = ({
89
89
  const iconStyle = cx(
90
90
  type === 'info' &&
91
91
  css`
92
- color: ${theme.color.interaction.blue70};
92
+ color: ${theme.colour.icon.brand};
93
93
  `,
94
94
  type === 'success' &&
95
95
  css`
96
- color: ${theme.color.system.green70};
96
+ color: ${theme.colour.icon.success};
97
97
  `,
98
98
  type === 'warning' &&
99
99
  css`
100
- color: ${theme.color.system.orange70};
100
+ color: ${theme.colour.icon.warning};
101
101
  `,
102
102
  type === 'error' &&
103
103
  css`
104
- color: ${theme.color.system.red70};
104
+ color: ${theme.colour.icon.critical};
105
105
  `
106
106
  );
107
107
 
@@ -11,6 +11,7 @@ exports[`Alert > snapshot: type=error 1`] = `
11
11
  class="ucl-uikit-icon css-nysdxe"
12
12
  data-testid="ucl-uikit-icon"
13
13
  fill="none"
14
+ focusable="false"
14
15
  height="24"
15
16
  stroke="currentColor"
16
17
  stroke-linecap="round"
@@ -25,17 +26,8 @@ exports[`Alert > snapshot: type=error 1`] = `
25
26
  cy="12"
26
27
  r="10"
27
28
  />
28
- <line
29
- x1="15"
30
- x2="9"
31
- y1="9"
32
- y2="15"
33
- />
34
- <line
35
- x1="9"
36
- x2="15"
37
- y1="9"
38
- y2="15"
29
+ <path
30
+ d="m15 9-6 6m0-6 6 6"
39
31
  />
40
32
  </svg>
41
33
  <div>
@@ -57,7 +49,7 @@ exports[`Alert > snapshot: type=error 1`] = `
57
49
 
58
50
  exports[`Alert > snapshot: type=info, no title 1`] = `
59
51
  <div
60
- class="ucl-uikit-alert css-lzalin"
52
+ class="ucl-uikit-alert css-153fxq6"
61
53
  data-testid="ucl-uikit-alert"
62
54
  role="alert"
63
55
  >
@@ -66,6 +58,7 @@ exports[`Alert > snapshot: type=info, no title 1`] = `
66
58
  class="ucl-uikit-icon css-1oh4ubr"
67
59
  data-testid="ucl-uikit-icon"
68
60
  fill="none"
61
+ focusable="false"
69
62
  height="24"
70
63
  stroke="currentColor"
71
64
  stroke-linecap="round"
@@ -80,17 +73,8 @@ exports[`Alert > snapshot: type=info, no title 1`] = `
80
73
  cy="12"
81
74
  r="10"
82
75
  />
83
- <line
84
- x1="12"
85
- x2="12"
86
- y1="16"
87
- y2="12"
88
- />
89
- <line
90
- x1="12"
91
- x2="12.01"
92
- y1="8"
93
- y2="8"
76
+ <path
77
+ d="M12 16v-4m0-4h.01"
94
78
  />
95
79
  </svg>
96
80
  <div>
@@ -115,6 +99,7 @@ exports[`Alert > snapshot: type=success 1`] = `
115
99
  class="ucl-uikit-icon css-4xbsfp"
116
100
  data-testid="ucl-uikit-icon"
117
101
  fill="none"
102
+ focusable="false"
118
103
  height="24"
119
104
  stroke="currentColor"
120
105
  stroke-linecap="round"
@@ -127,8 +112,8 @@ exports[`Alert > snapshot: type=success 1`] = `
127
112
  <path
128
113
  d="M22 11.08V12a10 10 0 1 1-5.93-9.14"
129
114
  />
130
- <polyline
131
- points="22 4 12 14.01 9 11.01"
115
+ <path
116
+ d="M22 4 12 14.01l-3-3"
132
117
  />
133
118
  </svg>
134
119
  <div>
@@ -156,9 +141,10 @@ exports[`Alert > snapshot: type=warning 1`] = `
156
141
  >
157
142
  <svg
158
143
  aria-label="Warning"
159
- class="ucl-uikit-icon css-dwkbnw"
144
+ class="ucl-uikit-icon css-1k868z9"
160
145
  data-testid="ucl-uikit-icon"
161
146
  fill="none"
147
+ focusable="false"
162
148
  height="24"
163
149
  stroke="currentColor"
164
150
  stroke-linecap="round"
@@ -169,19 +155,7 @@ exports[`Alert > snapshot: type=warning 1`] = `
169
155
  xmlns="http://www.w3.org/2000/svg"
170
156
  >
171
157
  <path
172
- d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"
173
- />
174
- <line
175
- x1="12"
176
- x2="12"
177
- y1="9"
178
- y2="13"
179
- />
180
- <line
181
- x1="12"
182
- x2="12.01"
183
- y1="17"
184
- y2="17"
158
+ d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0M12 9v4m0 4h.01"
185
159
  />
186
160
  </svg>
187
161
  <div>
@@ -1,23 +1,19 @@
1
1
  import { memo, HTMLAttributes } from 'react';
2
2
  import { css, cx } from '@emotion/css';
3
3
  import { useTheme } from '../../../lib';
4
- import AppHeaderTop, {
5
- HEIGHT as APP_HEADER_TOP_HEIGHT,
6
- } from './AppHeaderTop';
4
+ import AppHeaderTop, { HEIGHT as APP_HEADER_TOP_HEIGHT } from './AppHeaderTop';
7
5
  import AppHeaderBottom, {
8
6
  HEIGHT as APP_HEADER_BOTTOM_HEIGHT,
9
7
  } from './AppHeaderBottom';
10
8
  import AppHeaderNav from './AppHeaderNav';
11
9
 
12
- export const NAME = 'ucl-timetable-app-header';
10
+ export const NAME = 'ucl-uikit-app-header';
13
11
 
14
12
  export const Z_INDEX = 3;
15
13
 
16
- export const HEIGHT =
17
- APP_HEADER_TOP_HEIGHT + APP_HEADER_BOTTOM_HEIGHT;
14
+ export const HEIGHT = APP_HEADER_TOP_HEIGHT + APP_HEADER_BOTTOM_HEIGHT;
18
15
 
19
- export interface AppHeaderProps
20
- extends HTMLAttributes<HTMLDivElement> {
16
+ export interface AppHeaderProps extends HTMLAttributes<HTMLDivElement> {
21
17
  fixed?: boolean;
22
18
  sticky?: boolean;
23
19
  testId?: string;
@@ -79,9 +75,8 @@ export interface IHeaderSubComponents {
79
75
  Nav: typeof AppHeaderNav;
80
76
  }
81
77
 
82
- const AppHeaderWithSubComponents =
83
- MemoAppHeader as typeof MemoAppHeader &
84
- IHeaderSubComponents;
78
+ const AppHeaderWithSubComponents = MemoAppHeader as typeof MemoAppHeader &
79
+ IHeaderSubComponents;
85
80
 
86
81
  AppHeaderWithSubComponents.Top = AppHeaderTop;
87
82
  AppHeaderWithSubComponents.Bottom = AppHeaderBottom;
@@ -2,12 +2,11 @@ import { memo, HTMLAttributes } from 'react';
2
2
  import { css, cx } from '@emotion/css';
3
3
  import { useTheme } from '../../../lib';
4
4
 
5
- export const NAME = 'ucl-timetable-app-header__bottom';
5
+ export const NAME = 'ucl-uikit-app-header__bottom';
6
6
 
7
7
  export const HEIGHT = 48;
8
8
 
9
- export interface AppHeaderBottomProps
10
- extends HTMLAttributes<HTMLDivElement> {
9
+ export interface AppHeaderBottomProps extends HTMLAttributes<HTMLDivElement> {
11
10
  testId?: string;
12
11
  }
13
12
 
@@ -1,10 +1,9 @@
1
1
  import { memo, HTMLAttributes } from 'react';
2
2
  import { css, cx } from '@emotion/css';
3
3
 
4
- export const NAME = 'ucl-timetable-app-header__nav';
4
+ export const NAME = 'ucl-uikit-app-header__nav';
5
5
 
6
- export interface AppHeaderNavProps
7
- extends HTMLAttributes<HTMLDivElement> {
6
+ export interface AppHeaderNavProps extends HTMLAttributes<HTMLDivElement> {
8
7
  testId?: string;
9
8
  }
10
9
 
@@ -2,7 +2,7 @@ import { memo, HTMLAttributes } from 'react';
2
2
  import { css, cx } from '@emotion/css';
3
3
  import { UclLogo, useTheme } from '../../';
4
4
 
5
- export const NAME = 'ucl-timetable-app-header__top';
5
+ export const NAME = 'ucl-uikit-app-header__top';
6
6
 
7
7
  export const HEIGHT = 56;
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`AppHeader > snapshot: no props 1`] = `
4
4
  <div
5
- class="ucl-timetable-app-header css-14i4gnx"
6
- data-testid="ucl-timetable-app-header"
5
+ class="ucl-uikit-app-header css-14i4gnx"
6
+ data-testid="ucl-uikit-app-header"
7
7
  />
8
8
  `;
@@ -19,6 +19,7 @@ exports[`AppMenu > snapshot: defaultOpen prop 1`] = `
19
19
  class="ucl-uikit-icon css-148hpxb"
20
20
  data-testid="ucl-uikit-icon"
21
21
  fill="none"
22
+ focusable="false"
22
23
  height="24"
23
24
  stroke="currentColor"
24
25
  stroke-linecap="round"
@@ -28,23 +29,8 @@ exports[`AppMenu > snapshot: defaultOpen prop 1`] = `
28
29
  width="24"
29
30
  xmlns="http://www.w3.org/2000/svg"
30
31
  >
31
- <line
32
- x1="3"
33
- x2="21"
34
- y1="12"
35
- y2="12"
36
- />
37
- <line
38
- x1="3"
39
- x2="21"
40
- y1="6"
41
- y2="6"
42
- />
43
- <line
44
- x1="3"
45
- x2="21"
46
- y1="18"
47
- y2="18"
32
+ <path
33
+ d="M3 12h18M3 6h18M3 18h18"
48
34
  />
49
35
  </svg>
50
36
  </button>
@@ -71,6 +57,7 @@ exports[`AppMenu > snapshot: defaultOpen prop 1`] = `
71
57
  class="ucl-uikit-icon css-148hpxb"
72
58
  data-testid="ucl-uikit-icon"
73
59
  fill="none"
60
+ focusable="false"
74
61
  height="24"
75
62
  stroke="currentColor"
76
63
  stroke-linecap="round"
@@ -80,8 +67,8 @@ exports[`AppMenu > snapshot: defaultOpen prop 1`] = `
80
67
  width="24"
81
68
  xmlns="http://www.w3.org/2000/svg"
82
69
  >
83
- <polyline
84
- points="15 18 9 12 15 6"
70
+ <path
71
+ d="m15 18-6-6 6-6"
85
72
  />
86
73
  </svg>
87
74
  </span>
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import Badge from './Badge';
3
3
 
4
4
  const meta = {
5
- title: 'Components/Work in progress/Badge',
5
+ title: 'Components/Badge',
6
6
  component: Badge,
7
7
  parameters: {
8
8
  layout: 'centered',