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.
- package/README.md +2 -4
- package/dist/components/Accordion/Accordion.Heading.d.ts +1 -0
- package/dist/components/AppHeader/AppHeader.d.ts +1 -1
- package/dist/components/AppHeader/AppHeaderBottom.d.ts +1 -1
- package/dist/components/AppHeader/AppHeaderNav.d.ts +1 -1
- package/dist/components/AppHeader/AppHeaderTop.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumb.d.ts +3 -4
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +7 -3
- package/dist/components/Button/Button.stories.d.ts +17 -7
- package/dist/components/Button/style/buttonAccentStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonPrimaryDestructiveStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonPrimaryStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonPrimarySubtleStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonPrimaryWarningStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonSecondaryDestructiveStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonSecondaryStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonSecondarySubtleStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonTertiaryDestructiveStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonTertiaryNoPaddingStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonTertiaryStyle.d.ts +4 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/FooterNew/BackToTop.d.ts +8 -0
- package/dist/components/FooterNew/Footer.d.ts +23 -0
- package/dist/components/FooterNew/FooterColumn.d.ts +8 -0
- package/dist/components/FooterNew/FooterLinks.d.ts +7 -0
- package/dist/components/FooterNew/FooterNavLink.d.ts +8 -0
- package/dist/components/FooterNew/LegalAndCopyright.d.ts +14 -0
- package/dist/components/FooterNew/LogoAddressAndSocial.d.ts +10 -0
- package/dist/components/FooterNew/SocialLink.d.ts +8 -0
- package/dist/components/FooterNew/__tests__/Footer.test.d.ts +1 -0
- package/dist/components/FooterNew/index.d.ts +2 -0
- package/dist/components/HeaderNew/Header.d.ts +18 -0
- package/dist/components/HeaderNew/HeaderBorder.d.ts +7 -0
- package/dist/components/HeaderNew/HeaderLogo.d.ts +9 -0
- package/dist/components/HeaderNew/HeaderMenuContainer.d.ts +7 -0
- package/dist/components/HeaderNew/HeaderTitle.d.ts +9 -0
- package/dist/components/HeaderNew/__tests__/Header.test.d.ts +1 -0
- package/dist/components/HeaderNew/constants.d.ts +3 -0
- package/dist/components/HeaderNew/index.d.ts +3 -0
- package/dist/components/Heading/Heading.d.ts +6 -4
- package/dist/components/Heading/Heading.stories.d.ts +8 -6
- package/dist/components/Icon/svgImports.d.ts +7 -881
- package/dist/components/Link/BaseLink.d.ts +14 -5
- package/dist/components/Link/Link.d.ts +8 -3
- package/dist/components/Link/Link.stories.d.ts +3 -1
- package/dist/components/MenuNew/Menu.context.d.ts +14 -0
- package/dist/components/MenuNew/Menu.d.ts +20 -0
- package/dist/components/MenuNew/MenuContent.d.ts +9 -0
- package/dist/components/MenuNew/MenuItem.d.ts +10 -0
- package/dist/components/MenuNew/MenuSection.d.ts +7 -0
- package/dist/components/MenuNew/index.d.ts +6 -0
- package/dist/components/MenuNew/trigger/ButtonMenuTrigger.d.ts +8 -0
- package/dist/components/MenuNew/trigger/IconMenuTrigger.d.ts +8 -0
- package/dist/components/Overlay/Overlay.stories.d.ts +12 -12
- package/dist/components/Paragraph/Paragraph.d.ts +5 -2
- package/dist/components/Paragraph/Paragraph.stories.d.ts +6 -3
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.stories.d.ts +13 -1
- package/dist/components/Select/Select.types.d.ts +40 -13
- package/dist/components/Select/subcomponents/CustomSelect.d.ts +3 -3
- package/dist/components/Select/subcomponents/FilterInput.d.ts +3 -1
- package/dist/components/Select/subcomponents/NativeSelect.d.ts +2 -2
- package/dist/components/Select/subcomponents/VisibleField.d.ts +4 -1
- package/dist/components/Spinner/Spinner.d.ts +2 -0
- package/dist/components/StandaloneLink/StandaloneLink.d.ts +8 -5
- package/dist/components/StandaloneLink/StandaloneLink.stories.d.ts +3 -1
- package/dist/components/Table/Table.d.ts +3 -3
- package/dist/components/Table/Table.stories.d.ts +3 -3
- package/dist/components/Table/Table.types.d.ts +1 -0
- package/dist/components/Table/subcomponents/Cell/Cell.d.ts +5 -1
- package/dist/components/Table/subcomponents/Cell/Cell.stories.d.ts +15 -13
- package/dist/components/Table/subcomponents/Cell/CellContent.d.ts +5 -1
- package/dist/components/Table/subcomponents/HeadCell/HeadCell.d.ts +2 -1
- package/dist/components/Table/subcomponents/HeadCell/HeadCell.stories.d.ts +14 -13
- package/dist/components/Table/subcomponents/HeadCell/HeadCellContent.d.ts +2 -1
- package/dist/components/Table/subcomponents/__tests__/Row.test.d.ts +1 -0
- package/dist/components/UclLogoNew/UclLogo.d.ts +8 -0
- package/dist/components/UclLogoNew/index.d.ts +2 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/index.js +20104 -15317
- package/dist/theme/__tests__/fonts.test.d.ts +1 -0
- package/dist/theme/common/themeCommon.d.ts +904 -0
- package/dist/theme/fonts.d.ts +18 -0
- package/dist/theme/index.d.ts +6 -3
- package/dist/theme/light/lightColour.d.ts +126 -0
- package/dist/theme/light/lightTheme.d.ts +3 -0
- package/dist/theme/original/color.d.ts +166 -0
- package/dist/theme/original/defaultTheme.d.ts +1340 -0
- package/dist/theme/original/originalColourNewStructure.d.ts +126 -0
- package/dist/theme/useTheme.d.ts +2174 -0
- package/dist/utils/addAlphaToHex.d.ts +5 -0
- package/dist/utils/scrollToTop.d.ts +2 -0
- package/lib/components/Accordion/Accordion.Heading.tsx +51 -39
- package/lib/components/Accordion/Accordion.Panel.tsx +0 -4
- package/lib/components/Accordion/Accordion.tsx +34 -28
- package/lib/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap +12 -10
- package/lib/components/Alert/Alert.tsx +12 -12
- package/lib/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap +13 -39
- package/lib/components/AppHeader/AppHeader.tsx +6 -11
- package/lib/components/AppHeader/AppHeaderBottom.tsx +2 -3
- package/lib/components/AppHeader/AppHeaderNav.tsx +2 -3
- package/lib/components/AppHeader/AppHeaderTop.tsx +1 -1
- package/lib/components/AppHeader/__tests__/__snapshots__/AppHeader.test.tsx.snap +2 -2
- package/lib/components/AppMenu/__tests__/__snapshots__/AppMenu.test.tsx.snap +6 -19
- package/lib/components/Badge/Badge.stories.tsx +1 -1
- package/lib/components/Breadcrumbs/Breadcrumb.tsx +26 -12
- package/lib/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/lib/components/Breadcrumbs/__tests__/Breadcrumbs.test.tsx +9 -27
- package/lib/components/Breadcrumbs/__tests__/__snapshots__/Breadcrumbs.test.tsx.snap +24 -20
- package/lib/components/Button/Button.mdx +32 -279
- package/lib/components/Button/Button.stories.tsx +43 -50
- package/lib/components/Button/Button.tsx +165 -25
- package/lib/components/Button/__tests__/Button.test.tsx +49 -15
- package/lib/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +80 -73
- package/lib/components/Button/style/buttonAccentStyle.ts +53 -0
- package/lib/components/Button/style/buttonPrimaryDestructiveStyle.ts +55 -0
- package/lib/components/Button/style/buttonPrimaryStyle.ts +53 -0
- package/lib/components/Button/style/buttonPrimarySubtleStyle.ts +64 -0
- package/lib/components/Button/style/buttonPrimaryWarningStyle.ts +56 -0
- package/lib/components/Button/style/buttonSecondaryDestructiveStyle.ts +63 -0
- package/lib/components/Button/style/buttonSecondaryStyle.ts +62 -0
- package/lib/components/Button/style/buttonSecondarySubtleStyle.ts +72 -0
- package/lib/components/Button/style/buttonTertiaryDestructiveStyle.ts +65 -0
- package/lib/components/Button/style/buttonTertiaryNoPaddingStyle.ts +52 -0
- package/lib/components/Button/style/buttonTertiaryStyle.ts +62 -0
- package/lib/components/Calendar/Calendar.stories.tsx +33 -13
- package/lib/components/Calendar/Calendar.tsx +2 -2
- package/lib/components/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +99 -95
- package/lib/components/Calendar/subcomponents/AcademicWeek.tsx +2 -1
- package/lib/components/Calendar/subcomponents/AcademicWeeks.tsx +2 -3
- package/lib/components/Calendar/subcomponents/ColumnHeading.tsx +3 -7
- package/lib/components/Calendar/subcomponents/Controls.tsx +1 -1
- package/lib/components/Calendar/subcomponents/Day.stories.tsx +1 -1
- package/lib/components/Calendar/subcomponents/Day.tsx +7 -9
- package/lib/components/Calendar/subcomponents/EventDot.tsx +4 -8
- package/lib/components/Checkbox/Checkbox.stories.tsx +1 -1
- package/lib/components/Checkbox/Checkbox.tsx +12 -10
- package/lib/components/Checkbox/__tests__/Checkbox.test.tsx +29 -0
- package/lib/components/Checkbox/__tests__/__snapshots__/Checkbox.test.tsx.snap +4 -4
- package/lib/components/Datepicker/__tests__/Datepicker.test.tsx +117 -0
- package/lib/components/Datepicker/__tests__/__snapshots__/Datepicker.test.tsx.snap +16 -44
- package/lib/components/Datepicker/subcomponents/CustomDatepicker.tsx +10 -1
- package/lib/components/Datepicker/subcomponents/VisibleField.tsx +24 -23
- package/lib/components/Dialog/BaseDialog.tsx +2 -2
- package/lib/components/Dialog/Dialog.stories.tsx +1 -1
- package/lib/components/Divider/__tests__/__snapshots__/Breadcrumbs.test.tsx.snap +12 -12
- package/lib/components/FeedbackDialog/FeedbackDialog.stories.tsx +1 -1
- package/lib/components/FeedbackDialog/FeedbackDialog.tsx +4 -6
- package/lib/components/Field/CharacterCount.tsx +2 -2
- package/lib/components/Field/ErrorText.tsx +1 -1
- package/lib/components/Field/Field.tsx +1 -1
- package/lib/components/Field/HelperText.tsx +3 -1
- package/lib/components/FileInput/FileInput.stories.tsx +1 -1
- package/lib/components/FileInput/__tests__/__snapshots__/FileInput.test.tsx.snap +4 -20
- package/lib/components/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +70 -79
- package/lib/components/FooterNew/BackToTop.tsx +83 -0
- package/lib/components/FooterNew/Footer.tsx +110 -0
- package/lib/components/FooterNew/FooterColumn.tsx +79 -0
- package/lib/components/FooterNew/FooterLinks.tsx +44 -0
- package/lib/components/FooterNew/FooterNavLink.tsx +63 -0
- package/lib/components/FooterNew/LegalAndCopyright.tsx +150 -0
- package/lib/components/FooterNew/LogoAddressAndSocial.tsx +154 -0
- package/lib/components/FooterNew/SocialLink.tsx +108 -0
- package/lib/components/FooterNew/__tests__/Footer.test.tsx +51 -0
- package/lib/components/FooterNew/__tests__/__snapshots__/Footer.test.tsx.snap +1107 -0
- package/lib/components/FooterNew/index.ts +2 -0
- package/lib/components/HeaderDraft/__tests__/__snapshots__/Header.test.tsx.snap +3 -2
- package/lib/components/HeaderNew/Header.tsx +93 -0
- package/lib/components/HeaderNew/HeaderBorder.tsx +55 -0
- package/lib/components/HeaderNew/HeaderLogo.tsx +70 -0
- package/lib/components/HeaderNew/HeaderMenuContainer.tsx +35 -0
- package/lib/components/HeaderNew/HeaderTitle.tsx +53 -0
- package/lib/components/HeaderNew/__tests__/Header.test.tsx +42 -0
- package/lib/components/HeaderNew/__tests__/__snapshots__/Header.test.tsx.snap +79 -0
- package/lib/components/HeaderNew/constants.ts +3 -0
- package/lib/components/HeaderNew/index.ts +7 -0
- package/lib/components/Heading/Heading.stories.tsx +34 -41
- package/lib/components/Heading/Heading.tsx +180 -49
- package/lib/components/Heading/__tests__/__snapshots__/Heading.test.tsx.snap +4 -4
- package/lib/components/Icon/__tests__/__snapshots__/Icon.test.tsx.snap +16 -12
- package/lib/components/Icon/svgImports.ts +318 -296
- package/lib/components/IconButton/IconButton.tsx +3 -4
- package/lib/components/IconButton/__tests__/__snapshots__/IconButton.test.tsx.snap +12 -9
- package/lib/components/Link/BaseLink.tsx +114 -71
- package/lib/components/Link/Link.stories.tsx +1 -1
- package/lib/components/Link/Link.tsx +120 -109
- package/lib/components/Link/__tests__/__snapshots__/link.test.tsx.snap +2 -2
- package/lib/components/MenuNew/Menu.context.tsx +149 -0
- package/lib/components/MenuNew/Menu.tsx +75 -0
- package/lib/components/MenuNew/MenuContent.tsx +140 -0
- package/lib/components/MenuNew/MenuItem.tsx +101 -0
- package/lib/components/MenuNew/MenuSection.tsx +47 -0
- package/lib/components/MenuNew/index.ts +8 -0
- package/lib/components/MenuNew/trigger/ButtonMenuTrigger.tsx +42 -0
- package/lib/components/MenuNew/trigger/IconMenuTrigger.tsx +40 -0
- package/lib/components/Pagination/Pagination.stories.tsx +1 -1
- package/lib/components/Pagination/PaginationControls.tsx +4 -5
- package/lib/components/Pagination/PaginationInfo.tsx +2 -3
- package/lib/components/Paragraph/Paragraph.stories.tsx +29 -27
- package/lib/components/Paragraph/Paragraph.tsx +212 -81
- package/lib/components/Paragraph/__tests__/__snapshots__/Paragraph.test.tsx.snap +5 -5
- package/lib/components/Radio/Radio.stories.tsx +1 -1
- package/lib/components/Radio/Radio.tsx +8 -8
- package/lib/components/Radio/__tests__/__snapshots__/Radio.test.tsx.snap +4 -4
- package/lib/components/Search/__tests__/__snapshots__/Search.test.tsx.snap +12 -32
- package/lib/components/Select/Select.mdx +23 -0
- package/lib/components/Select/Select.stories.tsx +43 -10
- package/lib/components/Select/Select.tsx +14 -3
- package/lib/components/Select/Select.types.ts +53 -16
- package/lib/components/Select/__tests__/Select.test.tsx +250 -1
- package/lib/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +5 -4
- package/lib/components/Select/subcomponents/CustomOption.tsx +10 -3
- package/lib/components/Select/subcomponents/CustomSelect.tsx +110 -10
- package/lib/components/Select/subcomponents/FilterInput.tsx +13 -3
- package/lib/components/Select/subcomponents/NativeSelect.tsx +10 -18
- package/lib/components/Select/subcomponents/Panel.tsx +2 -2
- package/lib/components/Select/subcomponents/VisibleField.tsx +48 -3
- package/lib/components/Snackbar/__tests__/__snapshots__/Snackbar.test.tsx.snap +9 -15
- package/lib/components/Spinner/Spinner.tsx +24 -5
- package/lib/components/Spinner/__tests__/Spinner.test.tsx +35 -5
- package/lib/components/Spinner/__tests__/__snapshots__/Spinner.test.tsx.snap +40 -16
- package/lib/components/StandaloneLink/StandaloneLink.stories.tsx +1 -1
- package/lib/components/StandaloneLink/StandaloneLink.tsx +180 -163
- package/lib/components/StandaloneLink/__tests__/__snapshots__/StandaloneLink.test.tsx.snap +2 -2
- package/lib/components/Table/Table.stories.tsx +1 -1
- package/lib/components/Table/Table.tsx +2 -0
- package/lib/components/Table/Table.types.ts +1 -0
- package/lib/components/Table/__tests__/Table.test.tsx +19 -0
- package/lib/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +7 -3
- package/lib/components/Table/subcomponents/Cell/Cell.stories.tsx +1 -1
- package/lib/components/Table/subcomponents/Cell/Cell.tsx +23 -2
- package/lib/components/Table/subcomponents/Cell/CellContent.tsx +12 -1
- package/lib/components/Table/subcomponents/Cell/__tests__/Cell.test.tsx +106 -0
- package/lib/components/Table/subcomponents/Cell/__tests__/__snapshots__/Cell.test.tsx.snap +4 -3
- package/lib/components/Table/subcomponents/HeadCell/HeadCell.stories.tsx +1 -1
- package/lib/components/Table/subcomponents/HeadCell/HeadCell.tsx +28 -6
- package/lib/components/Table/subcomponents/HeadCell/HeadCellContent.tsx +3 -0
- package/lib/components/Table/subcomponents/HeadCell/__tests__/HeadCell.test.tsx +221 -2
- package/lib/components/Table/subcomponents/HeadCell/__tests__/__snapshots__/HeadCell.test.tsx.snap +6 -4
- package/lib/components/Table/subcomponents/Row.tsx +2 -2
- package/lib/components/Table/subcomponents/SortIcon.tsx +1 -0
- package/lib/components/Table/subcomponents/__tests__/Row.test.tsx +59 -0
- package/lib/components/Tabs/Tab.tsx +3 -3
- package/lib/components/Tabs/Tabs.stories.tsx +1 -1
- package/lib/components/Tabs/Tabs.tsx +5 -3
- package/lib/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +4 -4
- package/lib/components/Timepicker/Timepicker.stories.tsx +1 -1
- package/lib/components/Toggle/Toggle.tsx +5 -5
- package/lib/components/Toggle/ToggleHandle.tsx +2 -3
- package/lib/components/Tooltip/Tooltip.tsx +2 -2
- package/lib/components/Tooltip/__tests__/__snapshots__/tooltip.test.tsx.snap +2 -2
- package/lib/components/UclLogoNew/UclLogo.tsx +42 -0
- package/lib/components/UclLogoNew/index.ts +2 -0
- package/lib/components/WeekPicker/WeekPicker.stories.tsx +3 -5
- package/lib/components/common/Common.mdx +0 -1
- package/lib/components/index.ts +19 -1
- package/lib/theme/Colours.mdx +1 -1
- package/lib/theme/Theme.mdx +1 -1
- package/lib/theme/Typography.mdx +1 -1
- package/lib/theme/__tests__/fonts.test.ts +37 -0
- package/lib/theme/common/themeCommon.ts +515 -0
- package/lib/theme/fonts.ts +110 -0
- package/lib/theme/index.ts +6 -6
- package/lib/theme/light/lightColour.ts +232 -0
- package/lib/theme/light/lightTheme.ts +37 -0
- package/lib/theme/{defaultTheme.ts → original/color.ts} +17 -199
- package/lib/theme/original/defaultTheme.ts +207 -0
- package/lib/theme/original/originalColourNewStructure.ts +185 -0
- package/lib/theme/useTheme.tsx +72 -15
- package/lib/types/assets.d.ts +10 -0
- package/lib/utils/addAlphaToHex.ts +29 -0
- package/lib/utils/scrollToTop.ts +5 -0
- package/package.json +11 -6
- package/dist/components/Button/buttonPrimaryStyle.d.ts +0 -4
- package/dist/components/Button/buttonSecondaryStyle.d.ts +0 -4
- package/dist/components/Button/buttonTertiaryStyle.d.ts +0 -4
- package/dist/theme/defaultTheme.d.ts +0 -274
- package/lib/components/Button/buttonPrimaryStyle.ts +0 -62
- package/lib/components/Button/buttonSecondaryStyle.ts +0 -65
- package/lib/components/Button/buttonTertiaryStyle.ts +0 -54
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { css, cx } from '@emotion/css';
|
|
3
|
+
import { useTheme } from '../..';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
import scrollToTop from '../../utils/scrollToTop';
|
|
6
|
+
|
|
7
|
+
export const NAME = 'ucl-uikit-footer__back-to-top';
|
|
8
|
+
|
|
9
|
+
export interface BackToTopProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
compact?: boolean;
|
|
11
|
+
testId?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const BackToTop = ({
|
|
15
|
+
compact,
|
|
16
|
+
testId = NAME,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: BackToTopProps) => {
|
|
20
|
+
const [theme] = useTheme();
|
|
21
|
+
|
|
22
|
+
const handleBackToTopButtonClick = () => {
|
|
23
|
+
scrollToTop();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const baseStyle = css`
|
|
27
|
+
margin-top: ${theme.margin.m56};
|
|
28
|
+
text-align: right;
|
|
29
|
+
|
|
30
|
+
@media screen and (min-width: ${theme.breakpoints.tablet}px) {
|
|
31
|
+
margin-top: ${theme.margin.m80};
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
const compactStyle = css`
|
|
36
|
+
margin-top: ${theme.margin.m16};
|
|
37
|
+
|
|
38
|
+
@media screen and (min-width: ${theme.breakpoints.tablet}px) {
|
|
39
|
+
margin-top: ${theme.margin.m16};
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
const style = cx(NAME, baseStyle, compact && compactStyle, className);
|
|
44
|
+
|
|
45
|
+
const buttonStyle = css`
|
|
46
|
+
display: inline;
|
|
47
|
+
background-color: transparent;
|
|
48
|
+
border: none;
|
|
49
|
+
color: ${theme.colour.link.inverse};
|
|
50
|
+
font-family: ${theme.typography.body.md.fontFamily};
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
line-height: ${theme.typography.body.md.lineHeight}%;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 6px;
|
|
57
|
+
|
|
58
|
+
&:hover {
|
|
59
|
+
opacity: 0.9;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media screen and (min-width: ${theme.breakpoints.desktop}px) {
|
|
63
|
+
font-size: 16px;
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div
|
|
69
|
+
className={style}
|
|
70
|
+
data-testid={testId}
|
|
71
|
+
{...props}
|
|
72
|
+
>
|
|
73
|
+
<button
|
|
74
|
+
className={buttonStyle}
|
|
75
|
+
onClick={handleBackToTopButtonClick}
|
|
76
|
+
>
|
|
77
|
+
Back to top <Icon.ArrowUp />
|
|
78
|
+
</button>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export default BackToTop;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { memo, HTMLAttributes } from 'react';
|
|
2
|
+
import { css, cx } from '@emotion/css';
|
|
3
|
+
import { useTheme } from '../..';
|
|
4
|
+
import FooterColumn from './FooterColumn';
|
|
5
|
+
import FooterNavLink from './FooterNavLink';
|
|
6
|
+
import LogoAddressAndSocial from './LogoAddressAndSocial';
|
|
7
|
+
import LegalAndCopyright from './LegalAndCopyright';
|
|
8
|
+
import BackToTop from './BackToTop';
|
|
9
|
+
import FooterLinks from './FooterLinks';
|
|
10
|
+
|
|
11
|
+
export const NAME = 'ucl-uikit-footer';
|
|
12
|
+
|
|
13
|
+
export interface FooterProps extends HTMLAttributes<HTMLElement> {
|
|
14
|
+
testId?: string;
|
|
15
|
+
addressFormat?: 'compact' | 'full';
|
|
16
|
+
showSocialLinks?: boolean;
|
|
17
|
+
disclaimer?: string;
|
|
18
|
+
freedomOfInformation?: string;
|
|
19
|
+
accessibility?: string;
|
|
20
|
+
cookies?: string;
|
|
21
|
+
privacy?: string;
|
|
22
|
+
slaveryStatement?: string;
|
|
23
|
+
login?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const Footer = ({
|
|
27
|
+
testId = NAME,
|
|
28
|
+
className,
|
|
29
|
+
addressFormat = 'full',
|
|
30
|
+
showSocialLinks = true,
|
|
31
|
+
disclaimer = 'https://www.ucl.ac.uk/legal-services/disclaimer',
|
|
32
|
+
freedomOfInformation = 'https://www.ucl.ac.uk/foi',
|
|
33
|
+
accessibility = 'https://www.ucl.ac.uk/accessibility',
|
|
34
|
+
cookies = 'https://www.ucl.ac.uk/legal-services/privacy/cookie-policy',
|
|
35
|
+
privacy = 'https://www.ucl.ac.uk/legal-services/privacy',
|
|
36
|
+
slaveryStatement = 'https://www.ucl.ac.uk/commercial-procurement/modern-day-slavery-statement',
|
|
37
|
+
login,
|
|
38
|
+
children,
|
|
39
|
+
...props
|
|
40
|
+
}: FooterProps) => {
|
|
41
|
+
const hasChildLinks = !!children;
|
|
42
|
+
const isCompact = !hasChildLinks;
|
|
43
|
+
|
|
44
|
+
const [theme] = useTheme();
|
|
45
|
+
|
|
46
|
+
const baseStyle = css`
|
|
47
|
+
background-color: ${theme.colour.surface.inverseBrandPrimary};
|
|
48
|
+
color: ${theme.colour.text.brandInverse};
|
|
49
|
+
padding: ${theme.padding.p40} ${theme.padding.p16};
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
|
|
52
|
+
@media screen and (min-width: ${theme.breakpoints.tablet}px) {
|
|
53
|
+
padding: ${theme.padding.p64} ${theme.padding.p32};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@media screen and (min-width: ${theme.breakpoints.desktop}px) {
|
|
57
|
+
padding: ${theme.padding.p64} ${theme.padding.p64} ${theme.padding.p48};
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
const style = cx(NAME, baseStyle, className);
|
|
62
|
+
|
|
63
|
+
const linksAndDetailsStyle = css`
|
|
64
|
+
@media screen and (min-width: ${theme.breakpoints.desktopLarge}px) {
|
|
65
|
+
display: flex;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<footer
|
|
71
|
+
className={style}
|
|
72
|
+
data-testid={testId}
|
|
73
|
+
{...props}
|
|
74
|
+
>
|
|
75
|
+
<div className={linksAndDetailsStyle}>
|
|
76
|
+
{hasChildLinks && <FooterLinks>{children}</FooterLinks>}
|
|
77
|
+
<LogoAddressAndSocial
|
|
78
|
+
compact={isCompact}
|
|
79
|
+
addressFormat={addressFormat}
|
|
80
|
+
showSocialLinks={showSocialLinks}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<BackToTop compact={isCompact} />
|
|
84
|
+
<LegalAndCopyright
|
|
85
|
+
disclaimer={disclaimer}
|
|
86
|
+
freedomOfInformation={freedomOfInformation}
|
|
87
|
+
accessibility={accessibility}
|
|
88
|
+
cookies={cookies}
|
|
89
|
+
privacy={privacy}
|
|
90
|
+
slaveryStatement={slaveryStatement}
|
|
91
|
+
login={login}
|
|
92
|
+
/>
|
|
93
|
+
</footer>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const MemoFooter = memo(Footer);
|
|
98
|
+
|
|
99
|
+
export interface IFooterSubComponents {
|
|
100
|
+
Column: typeof FooterColumn;
|
|
101
|
+
NavLink: typeof FooterNavLink;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const FooterWithSubComponents = MemoFooter as typeof MemoFooter &
|
|
105
|
+
IFooterSubComponents;
|
|
106
|
+
|
|
107
|
+
FooterWithSubComponents.Column = FooterColumn;
|
|
108
|
+
FooterWithSubComponents.NavLink = FooterNavLink;
|
|
109
|
+
|
|
110
|
+
export default FooterWithSubComponents;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { memo, HTMLAttributes } from 'react';
|
|
2
|
+
import { css, cx } from '@emotion/css';
|
|
3
|
+
import { useTheme } from '../..';
|
|
4
|
+
|
|
5
|
+
export const NAME = 'ucl-uikit-footer__column';
|
|
6
|
+
|
|
7
|
+
export interface FooterColumnProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
heading: string;
|
|
9
|
+
testId?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const FooterColumn = ({
|
|
13
|
+
heading,
|
|
14
|
+
testId = NAME,
|
|
15
|
+
className,
|
|
16
|
+
children,
|
|
17
|
+
...props
|
|
18
|
+
}: FooterColumnProps) => {
|
|
19
|
+
const [theme] = useTheme();
|
|
20
|
+
|
|
21
|
+
const baseStyle = css`
|
|
22
|
+
flex: 1;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
justify-content: flex-start;
|
|
26
|
+
align-items: start;
|
|
27
|
+
gap: 16px;
|
|
28
|
+
font-family: ${theme.typography.body.md.fontFamily};
|
|
29
|
+
font-weight: ${theme.typography.body.md.fontWeight};
|
|
30
|
+
font-size: ${theme.typography.body.md.fontSize}px;
|
|
31
|
+
|
|
32
|
+
:not(:first-child) {
|
|
33
|
+
margin-top: ${theme.margin.m24};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:not(:last-child) {
|
|
37
|
+
margin-bottom: ${theme.margin.m24};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@media screen and (min-width: ${theme.breakpoints.tablet}px) {
|
|
41
|
+
margin-top: 0;
|
|
42
|
+
margin-bottom: 0;
|
|
43
|
+
flex: 0 0 200px;
|
|
44
|
+
/* background-color: rgba(255, 255, 255, 0.1); */
|
|
45
|
+
|
|
46
|
+
:not(:first-child) {
|
|
47
|
+
margin-top: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:not(:last-child) {
|
|
51
|
+
margin-bottom: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
const style = cx(NAME, baseStyle, className);
|
|
57
|
+
|
|
58
|
+
const headingStyle = css`
|
|
59
|
+
margin: 0;
|
|
60
|
+
color: #fafafa;
|
|
61
|
+
font-family: ${theme.typography.body.mdSemibold.fontFamily};
|
|
62
|
+
font-weight: ${theme.typography.body.mdSemibold.fontWeight};
|
|
63
|
+
font-size: ${theme.typography.body.mdSemibold.fontSize}px;
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div
|
|
68
|
+
className={style}
|
|
69
|
+
data-testid={testId}
|
|
70
|
+
{...props}
|
|
71
|
+
>
|
|
72
|
+
<h3 className={headingStyle}>{heading}</h3>
|
|
73
|
+
|
|
74
|
+
{children}
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default memo(FooterColumn);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { css, cx } from '@emotion/css';
|
|
3
|
+
import { useTheme } from '../..';
|
|
4
|
+
|
|
5
|
+
export const NAME = 'ucl-uikit-footer__links';
|
|
6
|
+
|
|
7
|
+
export interface FooterLinksProps extends HTMLAttributes<HTMLElement> {
|
|
8
|
+
testId?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const FooterLinks = ({
|
|
12
|
+
testId = NAME,
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
...props
|
|
16
|
+
}: FooterLinksProps) => {
|
|
17
|
+
const [theme] = useTheme();
|
|
18
|
+
|
|
19
|
+
const baseStyle = css`
|
|
20
|
+
@media screen and (min-width: ${theme.breakpoints.tablet}px) {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: start;
|
|
23
|
+
gap: 40px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media screen and (min-width: ${theme.breakpoints.desktop}px) {
|
|
27
|
+
gap: 72px;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
const style = cx(NAME, baseStyle, className);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<nav
|
|
35
|
+
className={style}
|
|
36
|
+
data-testid={testId}
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</nav>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default FooterLinks;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import { css, cx } from '@emotion/css';
|
|
3
|
+
import { Link, LinkProps, useTheme } from '../..';
|
|
4
|
+
|
|
5
|
+
export const NAME = 'ucl-uikit-footer__nav-link';
|
|
6
|
+
|
|
7
|
+
export interface FooterNavLinkProps extends LinkProps {
|
|
8
|
+
href: string;
|
|
9
|
+
testId?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const FooterNavLink = ({
|
|
13
|
+
href,
|
|
14
|
+
testId = NAME,
|
|
15
|
+
className,
|
|
16
|
+
children,
|
|
17
|
+
...props
|
|
18
|
+
}: FooterNavLinkProps) => {
|
|
19
|
+
const [theme] = useTheme();
|
|
20
|
+
|
|
21
|
+
const baseStyle = css`
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
color: #fafafa; // todo: fix ${theme.colour.text.brandInverse};
|
|
24
|
+
font-family: ${theme.typography.body.md.fontFamily};
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
line-height: ${theme.typography.body.md
|
|
27
|
+
.lineHeight}%; // todo: change foundations lib to use non-percent number
|
|
28
|
+
transition: color 0.2s ease-out;
|
|
29
|
+
|
|
30
|
+
&:focus-visible {
|
|
31
|
+
outline: none;
|
|
32
|
+
box-shadow: ${theme.boxShadow.focus};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:visited {
|
|
36
|
+
color: ${theme.color.text.inverted};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:hover {
|
|
40
|
+
text-decoration: underline;
|
|
41
|
+
color: ${theme.color.text.inverted};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media screen and (min-width: ${theme.breakpoints.desktop}px) {
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
const style = cx(NAME, baseStyle, className);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Link
|
|
53
|
+
href={href}
|
|
54
|
+
className={style}
|
|
55
|
+
data-testid={testId}
|
|
56
|
+
{...props}
|
|
57
|
+
>
|
|
58
|
+
{children}
|
|
59
|
+
</Link>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default memo(FooterNavLink);
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { css, cx } from '@emotion/css';
|
|
3
|
+
import { useTheme } from '../..';
|
|
4
|
+
|
|
5
|
+
export const NAME = 'ucl-uikit-footer__legal-and-copyright';
|
|
6
|
+
|
|
7
|
+
export interface LegalAndCopyrightProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
disclaimer: string;
|
|
9
|
+
freedomOfInformation: string;
|
|
10
|
+
accessibility: string;
|
|
11
|
+
cookies: string;
|
|
12
|
+
privacy: string;
|
|
13
|
+
slaveryStatement: string;
|
|
14
|
+
login?: string;
|
|
15
|
+
testId?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const LegalAndCopyright = ({
|
|
19
|
+
disclaimer,
|
|
20
|
+
freedomOfInformation,
|
|
21
|
+
accessibility,
|
|
22
|
+
cookies,
|
|
23
|
+
privacy,
|
|
24
|
+
slaveryStatement,
|
|
25
|
+
login,
|
|
26
|
+
testId = NAME,
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}: LegalAndCopyrightProps) => {
|
|
30
|
+
const copyrightYear = new Date().getFullYear();
|
|
31
|
+
|
|
32
|
+
const [theme] = useTheme();
|
|
33
|
+
|
|
34
|
+
const baseStyle = css`
|
|
35
|
+
margin-top: ${theme.margin.m16};
|
|
36
|
+
border-top: 6px solid ${theme.colour.border.brandInverseSecondary};
|
|
37
|
+
padding-top: ${theme.padding.p24};
|
|
38
|
+
|
|
39
|
+
@media screen and (min-width: ${theme.breakpoints.desktop}px) {
|
|
40
|
+
padding-top: 36px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@media screen and (min-width: ${theme.breakpoints.desktopLarge}px) {
|
|
44
|
+
display: flex;
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
const style = cx(NAME, baseStyle, className);
|
|
49
|
+
|
|
50
|
+
const linksStyle = css`
|
|
51
|
+
color: ${theme.colour.text.brandInverseSecondary};
|
|
52
|
+
font-family: ${theme.typography.body.md.fontFamily};
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
line-height: 1.4;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-wrap: wrap;
|
|
57
|
+
gap: 16px;
|
|
58
|
+
|
|
59
|
+
@media screen and (min-width: ${theme.breakpoints.desktop}px) {
|
|
60
|
+
gap: 32px;
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
const linkStyle = css`
|
|
65
|
+
text-decoration: none;
|
|
66
|
+
color: inherit;
|
|
67
|
+
transition: color 0.2s ease-out;
|
|
68
|
+
|
|
69
|
+
&:focus-visible {
|
|
70
|
+
outline: none;
|
|
71
|
+
box-shadow: ${theme.boxShadow.focus};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
text-decoration: underline;
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
const copyrightStyle = css`
|
|
80
|
+
margin-top: ${theme.margin.m24};
|
|
81
|
+
color: ${theme.colour.text.inverse};
|
|
82
|
+
opacity: 0.6; // todo
|
|
83
|
+
font-family: ${theme.typography.body.md.fontFamily};
|
|
84
|
+
line-height: ${theme.typography.body.md.lineHeight}%;
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
|
|
87
|
+
@media screen and (min-width: ${theme.breakpoints.desktopLarge}px) {
|
|
88
|
+
margin-top: 0;
|
|
89
|
+
margin-left: auto;
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<div
|
|
95
|
+
className={style}
|
|
96
|
+
data-testid={testId}
|
|
97
|
+
{...props}
|
|
98
|
+
>
|
|
99
|
+
<div className={linksStyle}>
|
|
100
|
+
<a
|
|
101
|
+
className={linkStyle}
|
|
102
|
+
href={disclaimer}
|
|
103
|
+
>
|
|
104
|
+
Disclaimer
|
|
105
|
+
</a>
|
|
106
|
+
<a
|
|
107
|
+
className={linkStyle}
|
|
108
|
+
href={freedomOfInformation}
|
|
109
|
+
>
|
|
110
|
+
Freedom of Information
|
|
111
|
+
</a>
|
|
112
|
+
<a
|
|
113
|
+
className={linkStyle}
|
|
114
|
+
href={accessibility}
|
|
115
|
+
>
|
|
116
|
+
Accessibility
|
|
117
|
+
</a>
|
|
118
|
+
<a
|
|
119
|
+
className={linkStyle}
|
|
120
|
+
href={cookies}
|
|
121
|
+
>
|
|
122
|
+
Cookies
|
|
123
|
+
</a>
|
|
124
|
+
<a
|
|
125
|
+
className={linkStyle}
|
|
126
|
+
href={privacy}
|
|
127
|
+
>
|
|
128
|
+
Privacy
|
|
129
|
+
</a>
|
|
130
|
+
<a
|
|
131
|
+
className={linkStyle}
|
|
132
|
+
href={slaveryStatement}
|
|
133
|
+
>
|
|
134
|
+
Slavery statement
|
|
135
|
+
</a>
|
|
136
|
+
{login && (
|
|
137
|
+
<a
|
|
138
|
+
className={linkStyle}
|
|
139
|
+
href={login}
|
|
140
|
+
>
|
|
141
|
+
Login
|
|
142
|
+
</a>
|
|
143
|
+
)}
|
|
144
|
+
</div>
|
|
145
|
+
<div className={copyrightStyle}>© {copyrightYear} UCL</div>
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export default LegalAndCopyright;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { css, cx } from '@emotion/css';
|
|
3
|
+
import { UclLogoNew, useTheme } from '../..';
|
|
4
|
+
import SocialLink from './SocialLink';
|
|
5
|
+
|
|
6
|
+
export const NAME = 'ucl-uikit-footer__logo-address-social';
|
|
7
|
+
|
|
8
|
+
export interface LogoAddressAndSocialProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
compact?: boolean;
|
|
10
|
+
addressFormat: 'compact' | 'full';
|
|
11
|
+
showSocialLinks?: boolean;
|
|
12
|
+
testId?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const LogoAddressAndSocial = ({
|
|
16
|
+
compact = false,
|
|
17
|
+
addressFormat,
|
|
18
|
+
showSocialLinks = true,
|
|
19
|
+
testId = NAME,
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}: LogoAddressAndSocialProps) => {
|
|
23
|
+
const [theme] = useTheme();
|
|
24
|
+
|
|
25
|
+
const baseStyle = css`
|
|
26
|
+
margin-top: ${theme.margin.m48};
|
|
27
|
+
font-size: ${theme.font.size.f14};
|
|
28
|
+
font-weight: 300;
|
|
29
|
+
|
|
30
|
+
@media screen and (min-width: ${theme.breakpoints.tablet}px) {
|
|
31
|
+
margin-top: ${theme.margin.m72};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media screen and (min-width: ${theme.breakpoints.desktopLarge}px) {
|
|
35
|
+
margin-top: 0;
|
|
36
|
+
margin-left: auto;
|
|
37
|
+
width: 256px;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
const compactStyle = css`
|
|
42
|
+
margin-top: 0;
|
|
43
|
+
|
|
44
|
+
@media screen and (min-width: ${theme.breakpoints.tablet}px) {
|
|
45
|
+
margin-top: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media screen and (min-width: ${theme.breakpoints.desktopLarge}px) {
|
|
49
|
+
margin-left: 0;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
const style = cx(NAME, baseStyle, compact && compactStyle, className);
|
|
54
|
+
|
|
55
|
+
const logoStyle = css`
|
|
56
|
+
display: block;
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
const contactDetailsStyle = css`
|
|
60
|
+
margin-top: ${theme.margin.m16};
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
const addressStyle = css`
|
|
64
|
+
color: ${theme.colour.text.inverse};
|
|
65
|
+
opacity: 0.6; // todo: use alpha white colour from theme
|
|
66
|
+
font-family: ${theme.typography.body.md.fontFamily};
|
|
67
|
+
line-height: ${theme.typography.body.md
|
|
68
|
+
.lineHeight}%; // todo: change foundations lib to use non-percent number
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
const telephoneStyle = css`
|
|
72
|
+
margin-top: ${theme.margin.m4};
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
const telephoneLinkStyle = css`
|
|
76
|
+
color: ${theme.colour.text.inverse};
|
|
77
|
+
opacity: 0.6; // todo: use alpha white colour from theme
|
|
78
|
+
font-family: ${theme.typography.body.md.fontFamily};
|
|
79
|
+
line-height: ${theme.typography.body.md
|
|
80
|
+
.lineHeight}%; // todo: change foundations lib to use non-percent number
|
|
81
|
+
text-decoration: none;
|
|
82
|
+
transition: color 0.2s ease-out;
|
|
83
|
+
|
|
84
|
+
@media screen and (min-width: ${theme.breakpoints.tablet}px) {
|
|
85
|
+
margin-top: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:focus-visible {
|
|
89
|
+
outline: none;
|
|
90
|
+
box-shadow: ${theme.boxShadow.focus};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:hover {
|
|
94
|
+
text-decoration: underline;
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
|
|
98
|
+
const socialLinksStyle = css`
|
|
99
|
+
margin-top: ${theme.margin.m24};
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-wrap: wrap;
|
|
102
|
+
gap: 12px;
|
|
103
|
+
`;
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<div
|
|
107
|
+
className={style}
|
|
108
|
+
data-testid={testId}
|
|
109
|
+
{...props}
|
|
110
|
+
>
|
|
111
|
+
<UclLogoNew
|
|
112
|
+
className={logoStyle}
|
|
113
|
+
variant='secondary-inverse'
|
|
114
|
+
height={34}
|
|
115
|
+
/>
|
|
116
|
+
|
|
117
|
+
<div className={contactDetailsStyle}>
|
|
118
|
+
{addressFormat === 'full' && (
|
|
119
|
+
<div className={addressStyle}>
|
|
120
|
+
University College London
|
|
121
|
+
<br />
|
|
122
|
+
Gower Street, London, WC1E 6BT
|
|
123
|
+
</div>
|
|
124
|
+
)}
|
|
125
|
+
{addressFormat === 'compact' && (
|
|
126
|
+
<div className={addressStyle}>Gower Street, London, WC1E 6BT</div>
|
|
127
|
+
)}
|
|
128
|
+
<div className={telephoneStyle}>
|
|
129
|
+
<a
|
|
130
|
+
className={telephoneLinkStyle}
|
|
131
|
+
href='tel:+4402076792000'
|
|
132
|
+
>
|
|
133
|
+
Tel: +44 (0) 20 7679 2000
|
|
134
|
+
</a>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
{showSocialLinks && (
|
|
139
|
+
<div className={socialLinksStyle}>
|
|
140
|
+
<SocialLink socialNetwork='instagram' />
|
|
141
|
+
<SocialLink socialNetwork='linkedin' />
|
|
142
|
+
<SocialLink socialNetwork='youtube' />
|
|
143
|
+
<SocialLink socialNetwork='tiktok' />
|
|
144
|
+
<SocialLink socialNetwork='facebook' />
|
|
145
|
+
<SocialLink socialNetwork='bluesky' />
|
|
146
|
+
<SocialLink socialNetwork='threads' />
|
|
147
|
+
<SocialLink socialNetwork='soundcloud' />
|
|
148
|
+
</div>
|
|
149
|
+
)}
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export default LogoAddressAndSocial;
|