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
|
@@ -31,7 +31,7 @@ const Tab = ({
|
|
|
31
31
|
border: none;
|
|
32
32
|
cursor: pointer;
|
|
33
33
|
font-family: ${theme.font.family.primary};
|
|
34
|
-
color: ${theme.
|
|
34
|
+
color: ${theme.colour.text.secondary};
|
|
35
35
|
border-bottom: 4px solid transparent;
|
|
36
36
|
text-align: center;
|
|
37
37
|
font-style: normal;
|
|
@@ -53,8 +53,8 @@ const Tab = ({
|
|
|
53
53
|
`;
|
|
54
54
|
|
|
55
55
|
const activeStyle = css`
|
|
56
|
-
border-bottom: 4px solid ${color || theme.
|
|
57
|
-
color: ${theme.
|
|
56
|
+
border-bottom: 4px solid ${color || theme.colour.border.brand};
|
|
57
|
+
color: ${theme.colour.text.default};
|
|
58
58
|
margin-bottom: -1px;
|
|
59
59
|
font-weight: 700;
|
|
60
60
|
|
|
@@ -7,8 +7,10 @@ import marginsStyle, { MarginProps } from '../common/marginsStyle';
|
|
|
7
7
|
|
|
8
8
|
export const NAME = 'ucl-uikit-tabs';
|
|
9
9
|
|
|
10
|
-
export interface TabsBaseProps
|
|
11
|
-
|
|
10
|
+
export interface TabsBaseProps extends Omit<
|
|
11
|
+
HTMLAttributes<HTMLDivElement>,
|
|
12
|
+
'onChange'
|
|
13
|
+
> {
|
|
12
14
|
activeTab: string;
|
|
13
15
|
onChange?: (value: string) => void;
|
|
14
16
|
fullWidth?: boolean;
|
|
@@ -42,7 +44,7 @@ const TabsBase = ({
|
|
|
42
44
|
|
|
43
45
|
const baseStyle = css`
|
|
44
46
|
display: flex;
|
|
45
|
-
border-bottom: 1px solid ${theme.
|
|
47
|
+
border-bottom: 1px solid ${theme.colour.border.subtle};
|
|
46
48
|
`;
|
|
47
49
|
|
|
48
50
|
const style = cx(NAME, baseStyle, marginsStyle(props, theme), className);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Tabs > snapshot: Auto width 1`] = `
|
|
4
4
|
<div
|
|
5
|
-
class="ucl-uikit-tabs css-
|
|
5
|
+
class="ucl-uikit-tabs css-1hchved"
|
|
6
6
|
data-testid="ucl-uikit-tabs"
|
|
7
7
|
role="tablist"
|
|
8
8
|
>
|
|
@@ -47,7 +47,7 @@ exports[`Tabs > snapshot: Auto width 1`] = `
|
|
|
47
47
|
|
|
48
48
|
exports[`Tabs > snapshot: Counter 1`] = `
|
|
49
49
|
<div
|
|
50
|
-
class="ucl-uikit-tabs css-
|
|
50
|
+
class="ucl-uikit-tabs css-1hchved"
|
|
51
51
|
data-testid="ucl-uikit-tabs"
|
|
52
52
|
role="tablist"
|
|
53
53
|
>
|
|
@@ -96,7 +96,7 @@ exports[`Tabs > snapshot: Counter 1`] = `
|
|
|
96
96
|
|
|
97
97
|
exports[`Tabs > snapshot: Custom test id 1`] = `
|
|
98
98
|
<div
|
|
99
|
-
class="ucl-uikit-tabs css-
|
|
99
|
+
class="ucl-uikit-tabs css-1hchved"
|
|
100
100
|
data-testid="custom-test-id"
|
|
101
101
|
role="tablist"
|
|
102
102
|
>
|
|
@@ -141,7 +141,7 @@ exports[`Tabs > snapshot: Custom test id 1`] = `
|
|
|
141
141
|
|
|
142
142
|
exports[`Tabs > snapshot: Minimal props 1`] = `
|
|
143
143
|
<div
|
|
144
|
-
class="ucl-uikit-tabs css-
|
|
144
|
+
class="ucl-uikit-tabs css-1hchved"
|
|
145
145
|
data-testid="ucl-uikit-tabs"
|
|
146
146
|
role="tablist"
|
|
147
147
|
>
|
|
@@ -3,7 +3,7 @@ import { useState } from 'react';
|
|
|
3
3
|
import Timepicker from './Timepicker';
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Timepicker> = {
|
|
6
|
-
title: 'Components/
|
|
6
|
+
title: 'Components/TimePicker',
|
|
7
7
|
component: Timepicker,
|
|
8
8
|
decorators: [(Story) => <Story />],
|
|
9
9
|
};
|
|
@@ -33,7 +33,7 @@ const Toggle = forwardRef<Ref, ToggleProps>(
|
|
|
33
33
|
width: 48px;
|
|
34
34
|
height: 24px;
|
|
35
35
|
border-radius: 12px;
|
|
36
|
-
background-color: ${theme.
|
|
36
|
+
background-color: ${theme.colour.icon.tertiary};
|
|
37
37
|
cursor: pointer;
|
|
38
38
|
transition: background-color 0.2s ease-in-out;
|
|
39
39
|
&:focus-visible {
|
|
@@ -43,11 +43,11 @@ const Toggle = forwardRef<Ref, ToggleProps>(
|
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
45
|
const checkedStyle = css`
|
|
46
|
-
background-color: ${theme.
|
|
46
|
+
background-color: ${theme.colour.fill.brand};
|
|
47
47
|
`;
|
|
48
48
|
|
|
49
49
|
const disabledStyle = css`
|
|
50
|
-
background-color: ${theme.
|
|
50
|
+
background-color: ${theme.colour.surface.disabled};
|
|
51
51
|
cursor: not-allowed;
|
|
52
52
|
`;
|
|
53
53
|
|
|
@@ -56,8 +56,8 @@ const Toggle = forwardRef<Ref, ToggleProps>(
|
|
|
56
56
|
css`
|
|
57
57
|
&:hover {
|
|
58
58
|
background-color: ${checked
|
|
59
|
-
? theme.
|
|
60
|
-
: theme.
|
|
59
|
+
? theme.colour.fill.brandHover
|
|
60
|
+
: theme.colour.icon.secondary};
|
|
61
61
|
}
|
|
62
62
|
`;
|
|
63
63
|
|
|
@@ -4,8 +4,7 @@ import { useTheme } from '../../theme';
|
|
|
4
4
|
|
|
5
5
|
export const NAME = 'ucl-uikit-toggle__handle';
|
|
6
6
|
|
|
7
|
-
export interface ToggleHandleProps
|
|
8
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
export interface ToggleHandleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
8
|
checked: boolean;
|
|
10
9
|
disabled: boolean;
|
|
11
10
|
}
|
|
@@ -18,7 +17,7 @@ const ToggleHandle = ({ checked, className }: ToggleHandleProps) => {
|
|
|
18
17
|
width: 20px;
|
|
19
18
|
height: 20px;
|
|
20
19
|
border-radius: 50%;
|
|
21
|
-
background-color: ${theme.
|
|
20
|
+
background-color: ${theme.colour.fill.inverse};
|
|
22
21
|
position: absolute;
|
|
23
22
|
top: 2px;
|
|
24
23
|
left: 2px;
|
|
@@ -15,8 +15,8 @@ const Tooltip = forwardRef<Ref, TooltipProps>(
|
|
|
15
15
|
const [theme] = useTheme();
|
|
16
16
|
|
|
17
17
|
const baseStyle = css`
|
|
18
|
-
background-color: ${theme.
|
|
19
|
-
color: ${theme.
|
|
18
|
+
background-color: ${theme.colour.surface.inverseBrandPrimary};
|
|
19
|
+
color: ${theme.colour.text.inverse};
|
|
20
20
|
font-family: ${theme.font.family.primary};
|
|
21
21
|
height: 32px;
|
|
22
22
|
padding: 4px 8px 4px 8px;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Tooltip > snapshot: no props 1`] = `
|
|
4
4
|
<span
|
|
5
|
-
class="ucl-uikit-tooltip css-
|
|
5
|
+
class="ucl-uikit-tooltip css-x1asgy"
|
|
6
6
|
data-testid="ucl-uikit-tooltip"
|
|
7
7
|
>
|
|
8
8
|
test
|
|
@@ -11,7 +11,7 @@ exports[`Tooltip > snapshot: no props 1`] = `
|
|
|
11
11
|
|
|
12
12
|
exports[`Tooltip > snapshot: testId prop 1`] = `
|
|
13
13
|
<span
|
|
14
|
-
class="ucl-uikit-tooltip css-
|
|
14
|
+
class="ucl-uikit-tooltip css-x1asgy"
|
|
15
15
|
data-testid="test123"
|
|
16
16
|
>
|
|
17
17
|
Info Tooltip
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SVGAttributes, memo } from 'react';
|
|
2
|
+
import { ts } from 'design-system-foundations-public';
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
logos: {
|
|
6
|
+
ucl: { Primary: PrimaryUclLogoSvg },
|
|
7
|
+
ucl: { Secondary: SecondaryUclLogoSvg },
|
|
8
|
+
ucl: { PrimaryInverse: PrimaryInverseyUclLogoSvg },
|
|
9
|
+
ucl: { SecondaryInverse: SecondaryInverseyUclLogoSvg },
|
|
10
|
+
},
|
|
11
|
+
} = ts;
|
|
12
|
+
|
|
13
|
+
export const NAME = 'ucl-uikit-logo';
|
|
14
|
+
|
|
15
|
+
export interface UclLogoProps extends SVGAttributes<SVGElement> {
|
|
16
|
+
variant?: 'primary' | 'secondary' | 'primary-inverse' | 'secondary-inverse';
|
|
17
|
+
testId?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const UclLogo = ({
|
|
21
|
+
variant = 'primary',
|
|
22
|
+
testId,
|
|
23
|
+
...props
|
|
24
|
+
}: UclLogoProps) => {
|
|
25
|
+
|
|
26
|
+
const LogoSvg = {
|
|
27
|
+
primary: PrimaryUclLogoSvg,
|
|
28
|
+
secondary: SecondaryUclLogoSvg,
|
|
29
|
+
'primary-inverse': PrimaryInverseyUclLogoSvg,
|
|
30
|
+
'secondary-inverse': SecondaryInverseyUclLogoSvg,
|
|
31
|
+
}[variant];
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<LogoSvg
|
|
35
|
+
data-testid={testId}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default memo(UclLogo);
|
|
@@ -3,7 +3,7 @@ import { useArgs } from '@storybook/preview-api';
|
|
|
3
3
|
import WeekPicker from './WeekPicker';
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
|
-
title: 'Components/
|
|
6
|
+
title: 'Components/WeekPicker',
|
|
7
7
|
component: WeekPicker,
|
|
8
8
|
parameters: { layout: 'padded' },
|
|
9
9
|
argTypes: {
|
|
@@ -33,8 +33,7 @@ export const Default: Story = {
|
|
|
33
33
|
? new Date(args.maxDate).toLocaleDateString('sv-SE')
|
|
34
34
|
: null;
|
|
35
35
|
|
|
36
|
-
const onValueChange = (value: Date | null) =>
|
|
37
|
-
updateArgs({ value: value });
|
|
36
|
+
const onValueChange = (value: Date | null) => updateArgs({ value: value });
|
|
38
37
|
return (
|
|
39
38
|
<WeekPicker
|
|
40
39
|
{...args}
|
|
@@ -120,8 +119,7 @@ export const WithAcademicWeeks: Story = {
|
|
|
120
119
|
? new Date(args.maxDate).toLocaleDateString('sv-SE')
|
|
121
120
|
: null;
|
|
122
121
|
|
|
123
|
-
const onValueChange = (value: Date | null) =>
|
|
124
|
-
updateArgs({ value: value });
|
|
122
|
+
const onValueChange = (value: Date | null) => updateArgs({ value: value });
|
|
125
123
|
return (
|
|
126
124
|
<WeekPicker
|
|
127
125
|
{...args}
|
|
@@ -79,4 +79,3 @@ The available margin props are:
|
|
|
79
79
|
[A live example of common margin props can be found in this `<Button>` story.](?path=/story/components-button--common-margins)
|
|
80
80
|
|
|
81
81
|
Implementation details can be found in <a href='https://github.com/ucl-isd/uikit-react/blob/main/lib/components/common/marginsStyle.ts' target='_blank'>uikit-react/components/common/MarginsStyle.tsx</a>
|
|
82
|
-
|
package/lib/components/index.ts
CHANGED
|
@@ -40,8 +40,15 @@ export type { TextareaProps } from './Textarea';
|
|
|
40
40
|
export { default as Heading } from './Heading';
|
|
41
41
|
export type { HeadingProps } from './Heading';
|
|
42
42
|
|
|
43
|
+
export { default as HeadingNew } from './Heading';
|
|
44
|
+
export type { HeadingProps as HeadingNewProps } from './Heading';
|
|
45
|
+
|
|
43
46
|
export { default as Paragraph } from './Paragraph';
|
|
44
47
|
export type { ParagraphProps } from './Paragraph';
|
|
48
|
+
|
|
49
|
+
export { default as ParagraphNew } from './Paragraph';
|
|
50
|
+
export type { ParagraphProps as ParagraphNewProps } from './Paragraph';
|
|
51
|
+
|
|
45
52
|
// TODO: Remove aliased export in future breaking release
|
|
46
53
|
// <Paragraph> will be used in place of <Text> in the future
|
|
47
54
|
export { default as Text } from './Paragraph';
|
|
@@ -53,6 +60,9 @@ export type { ModalProps } from './Modal';
|
|
|
53
60
|
export { UclLogo } from './UclLogo';
|
|
54
61
|
export type { UclLogoProps } from './UclLogo';
|
|
55
62
|
|
|
63
|
+
export { UclLogoNew } from './UclLogoNew';
|
|
64
|
+
export type { UclLogoProps as UclLogoNewProps } from './UclLogoNew';
|
|
65
|
+
|
|
56
66
|
export { UclLogoNegativeSpace } from './UclLogo';
|
|
57
67
|
export type { UclLogoNegativeSpaceProps } from './UclLogo';
|
|
58
68
|
|
|
@@ -77,18 +87,27 @@ export type { AppMenuProps } from './AppMenu';
|
|
|
77
87
|
export { default as Menu } from './Menu';
|
|
78
88
|
export type { MenuProps } from './Menu';
|
|
79
89
|
|
|
90
|
+
export { default as MenuNew } from './MenuNew';
|
|
91
|
+
export type { MenuProps as MenuNewProps } from './MenuNew';
|
|
92
|
+
|
|
80
93
|
export { default as Select } from './Select';
|
|
81
94
|
export type { SelectProps } from './Select';
|
|
82
95
|
|
|
83
96
|
export { default as Footer } from './Footer';
|
|
84
97
|
export type { FooterProps } from './Footer';
|
|
85
98
|
|
|
99
|
+
export { default as FooterNew } from './FooterNew';
|
|
100
|
+
export type { FooterProps as FooterNewProps } from './FooterNew';
|
|
101
|
+
|
|
86
102
|
export { default as Divider } from './Divider';
|
|
87
103
|
export type { DividerProps } from './Divider';
|
|
88
104
|
|
|
89
105
|
export { default as Header } from './Header';
|
|
90
106
|
export type { HeaderProps } from './Header';
|
|
91
107
|
|
|
108
|
+
export { default as HeaderNew } from './HeaderNew';
|
|
109
|
+
export type { HeaderProps as HeaderNewProps } from './HeaderNew';
|
|
110
|
+
|
|
92
111
|
export { default as HeaderDraft } from './HeaderDraft';
|
|
93
112
|
export type { HeaderDraftProps } from './HeaderDraft';
|
|
94
113
|
|
|
@@ -102,7 +121,6 @@ export { default as Tabs } from './Tabs';
|
|
|
102
121
|
export type { TabsProps } from './Tabs';
|
|
103
122
|
export type { TabProps } from './Tabs/Tab';
|
|
104
123
|
|
|
105
|
-
// todo:
|
|
106
124
|
export { default as Accordion } from './Accordion';
|
|
107
125
|
export type { AccordionProps } from './Accordion';
|
|
108
126
|
|
package/lib/theme/Colours.mdx
CHANGED
package/lib/theme/Theme.mdx
CHANGED
package/lib/theme/Typography.mdx
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { uikitFontUrls, uikitFonts } from '../fonts';
|
|
3
|
+
|
|
4
|
+
describe('theme/fonts exports', () => {
|
|
5
|
+
test('exports font URL map with expected keys', () => {
|
|
6
|
+
expect(uikitFontUrls).toMatchObject({
|
|
7
|
+
dmSansNormal: expect.any(String),
|
|
8
|
+
dmSansItalic: expect.any(String),
|
|
9
|
+
dmMonoItalic: expect.any(String),
|
|
10
|
+
dmMonoLight: expect.any(String),
|
|
11
|
+
dmMonoLightItalic: expect.any(String),
|
|
12
|
+
dmMonoMedium: expect.any(String),
|
|
13
|
+
dmMonoMediumItalic: expect.any(String),
|
|
14
|
+
dmMonoRegular: expect.any(String),
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('exports font source map with required shape', () => {
|
|
19
|
+
expect(uikitFonts['DM Sans']).toBeDefined();
|
|
20
|
+
expect(uikitFonts['DM Mono']).toBeDefined();
|
|
21
|
+
|
|
22
|
+
Object.values(uikitFonts).forEach((fontSources) => {
|
|
23
|
+
expect(Array.isArray(fontSources)).toBe(true);
|
|
24
|
+
expect(fontSources.length).toBeGreaterThan(0);
|
|
25
|
+
|
|
26
|
+
fontSources.forEach((source) => {
|
|
27
|
+
expect(typeof source.src).toBe('string');
|
|
28
|
+
expect(source.src.length).toBeGreaterThan(0);
|
|
29
|
+
expect(
|
|
30
|
+
source.fontStyle === 'normal' || source.fontStyle === 'italic'
|
|
31
|
+
).toBe(true);
|
|
32
|
+
expect(typeof source.fontWeight).toBe('number');
|
|
33
|
+
expect(typeof source.fontFeatureSettings).toBe('string');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|