uikit-react-public 0.14.21 → 0.21.8
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 -2
- package/dist/components/Accordion/Accordion.Heading.d.ts +5 -4
- package/dist/components/Accordion/Accordion.Panel.d.ts +2 -2
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.stories.d.ts +57 -0
- package/dist/components/Accordion/index.d.ts +2 -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/Avatar/Avatar.stories.d.ts +107 -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 +8 -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/Calendar/index.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Datepicker/Datepicker.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.stories.d.ts +4 -3
- package/dist/components/Datepicker/Datepicker.types.d.ts +4 -5
- package/dist/components/Datepicker/subcomponents/CustomDatepicker.d.ts +4 -1
- package/dist/components/Datepicker/subcomponents/DatepickerInput.d.ts +15 -2
- package/dist/components/Datepicker/subcomponents/Panel.d.ts +1 -1
- package/dist/components/Datepicker/subcomponents/VisibleField.d.ts +6 -1
- package/dist/components/Datepicker/subcomponents/index.d.ts +0 -1
- package/dist/components/Datepicker/utils/index.d.ts +0 -1
- package/dist/components/Dialog/BaseDialog.d.ts +2 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -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/index.d.ts +2 -0
- package/dist/components/Header/Header.d.ts +4 -1
- package/dist/components/Header/Header.stories.d.ts +40 -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/HeadingNew/Heading.d.ts +13 -0
- package/dist/components/HeadingNew/index.d.ts +2 -0
- 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/Main/Main.d.ts +21 -0
- package/dist/components/Main/Main.stories.d.ts +15 -0
- package/dist/components/Main/__tests__/Main.test.d.ts +1 -0
- package/dist/components/Main/index.d.ts +2 -0
- 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/NativeDatepicker/NativeDatepicker.d.ts +3 -0
- package/dist/components/NativeDatepicker/NativeDatepicker.stories.d.ts +36 -0
- package/dist/components/NativeDatepicker/NativeDatepicker.types.d.ts +10 -0
- package/dist/components/NativeDatepicker/index.d.ts +2 -0
- package/dist/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.d.ts +1 -1
- package/dist/components/NativeDatepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.d.ts +1 -0
- package/dist/components/NativeDatepicker/utils/index.d.ts +1 -0
- package/dist/components/Overlay/Overlay.stories.d.ts +12 -12
- package/dist/components/ParagraphNew/Paragraph.d.ts +13 -0
- package/dist/components/ParagraphNew/index.d.ts +4 -0
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.stories.d.ts +167 -3
- package/dist/components/Select/Select.types.d.ts +75 -19
- package/dist/components/Select/subcomponents/CustomOption.d.ts +1 -1
- package/dist/components/Select/subcomponents/CustomSelect.d.ts +3 -2
- package/dist/components/Select/subcomponents/FilterInput.d.ts +16 -0
- package/dist/components/Select/subcomponents/NativeSelect.d.ts +5 -1
- package/dist/components/Select/subcomponents/VisibleField.d.ts +6 -1
- package/dist/components/Select/subcomponents/index.d.ts +1 -0
- 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/WeekPicker/WeekPicker.d.ts +2 -2
- package/dist/components/WeekPicker/WeekPicker.stories.d.ts +41 -0
- package/dist/components/WeekPicker/WeekPicker.types.d.ts +16 -0
- package/dist/components/WeekPicker/index.d.ts +1 -0
- package/dist/components/WeekPicker/subcomponents/CustomDatepicker.d.ts +1 -1
- package/dist/components/index.d.ts +20 -0
- package/dist/hooks/useFocusTrap.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22204 -16719
- 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/__tests__/announce.test.d.ts +1 -0
- package/dist/utils/addAlphaToHex.d.ts +5 -0
- package/dist/utils/announce.d.ts +6 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/scrollToTop.d.ts +2 -0
- package/lib/components/Accordion/Accordion.Heading.tsx +65 -34
- package/lib/components/Accordion/Accordion.Panel.tsx +11 -7
- package/lib/components/Accordion/Accordion.stories.tsx +139 -0
- package/lib/components/Accordion/Accordion.tsx +39 -31
- package/lib/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap +15 -13
- package/lib/components/Accordion/index.ts +2 -0
- package/lib/components/Alert/Alert.stories.tsx +1 -1
- 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/Avatar/Avatar.mdx +117 -0
- package/lib/components/Avatar/Avatar.stories.tsx +110 -2
- package/lib/components/Badge/Badge.stories.tsx +1 -1
- package/lib/components/Blanket/Blanket.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 +44 -51
- package/lib/components/Button/Button.tsx +166 -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 +1 -1
- package/lib/components/Calendar/Calendar.tsx +2 -2
- package/lib/components/Calendar/__tests__/Calendar.test.tsx +23 -15
- package/lib/components/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +99 -95
- package/lib/components/Calendar/index.ts +1 -5
- package/lib/components/Calendar/subcomponents/AcademicWeek.tsx +2 -1
- package/lib/components/Calendar/subcomponents/AcademicWeeks.tsx +1 -1
- package/lib/components/Calendar/subcomponents/ColumnHeading.tsx +2 -2
- 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 +3 -6
- package/lib/components/Calendar/subcomponents/index.ts +1 -1
- package/lib/components/Calendar/utils/getDatesForCalendarGrid/getDatesForCalendarGrid.ts +43 -11
- package/lib/components/Calendar/utils/normaliseMonth/normaliseMonth.test.ts +5 -5
- 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/Datepicker.lld.md +108 -0
- package/lib/components/Datepicker/Datepicker.stories.tsx +44 -5
- package/lib/components/Datepicker/Datepicker.tsx +14 -36
- package/lib/components/Datepicker/Datepicker.types.ts +5 -14
- package/lib/components/Datepicker/__tests__/Datepicker.test.tsx +267 -8
- package/lib/components/Datepicker/__tests__/__snapshots__/Datepicker.test.tsx.snap +20 -42
- package/lib/components/Datepicker/subcomponents/CustomDatepicker.tsx +48 -5
- package/lib/components/Datepicker/subcomponents/DatepickerInput.tsx +30 -17
- package/lib/components/Datepicker/subcomponents/Panel.tsx +6 -2
- package/lib/components/Datepicker/subcomponents/VisibleField.tsx +46 -8
- package/lib/components/Datepicker/subcomponents/index.ts +0 -1
- package/lib/components/Datepicker/utils/index.ts +0 -1
- package/lib/components/Dialog/BaseDialog.tsx +13 -2
- package/lib/components/Dialog/Dialog.stories.tsx +1 -1
- package/lib/components/Dialog/Dialog.tsx +8 -1
- package/lib/components/Dialog/DialogBody.tsx +5 -1
- package/lib/components/Dialog/DialogHeader.tsx +2 -1
- package/lib/components/Divider/Divider.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 +2 -1
- package/lib/components/Field/Field.stories.tsx +1 -1
- package/lib/components/Field/Field.tsx +1 -1
- package/lib/components/Field/HelperText.tsx +3 -1
- package/lib/components/Field/__tests__/Field.test.tsx +13 -0
- 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/Footer.stories.tsx +1 -1
- package/lib/components/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +73 -82
- 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/Header/Header.mdx +52 -0
- package/lib/components/Header/Header.stories.tsx +98 -0
- package/lib/components/Header/Header.tsx +51 -6
- package/lib/components/Header/__tests__/Header.test.tsx +17 -1
- 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 +1 -1
- package/lib/components/HeadingNew/Heading.tsx +208 -0
- package/lib/components/HeadingNew/index.ts +2 -0
- package/lib/components/Icon/Icon.stories.tsx +1 -1
- 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.stories.tsx +1 -1
- package/lib/components/IconButton/IconButton.tsx +3 -4
- package/lib/components/IconButton/__tests__/__snapshots__/IconButton.test.tsx.snap +12 -9
- package/lib/components/Input/Input.stories.tsx +1 -1
- package/lib/components/Label/Label.stories.tsx +1 -1
- 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/Main/Main.stories.tsx +36 -0
- package/lib/components/Main/Main.tsx +46 -0
- package/lib/components/Main/__tests__/Main.test.tsx +80 -0
- package/lib/components/Main/__tests__/__snapshots__/Main.test.tsx.snap +33 -0
- package/lib/components/Main/index.ts +2 -0
- 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/NativeDatepicker/NativeDatepicker.stories.tsx +100 -0
- package/lib/components/{Datepicker/subcomponents → NativeDatepicker}/NativeDatepicker.tsx +14 -15
- package/lib/components/NativeDatepicker/NativeDatepicker.types.ts +19 -0
- package/lib/components/NativeDatepicker/index.ts +2 -0
- package/lib/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.ts +1 -1
- package/lib/components/NativeDatepicker/utils/index.ts +1 -0
- package/lib/components/Pagination/Pagination.stories.tsx +1 -1
- package/lib/components/Pagination/PaginationControls.tsx +59 -17
- package/lib/components/Pagination/PaginationInfo.tsx +7 -4
- package/lib/components/Paragraph/Paragraph.stories.tsx +1 -1
- package/lib/components/ParagraphNew/Paragraph.tsx +200 -0
- package/lib/components/ParagraphNew/index.ts +6 -0
- 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/Search.stories.tsx +1 -1
- package/lib/components/Search/Search.tsx +4 -1
- package/lib/components/Search/__tests__/Search.test.tsx +19 -1
- package/lib/components/Search/__tests__/__snapshots__/Search.test.tsx.snap +12 -32
- package/lib/components/Select/Select.mdx +192 -0
- package/lib/components/Select/Select.stories.tsx +229 -48
- package/lib/components/Select/Select.tsx +50 -15
- package/lib/components/Select/Select.types.ts +99 -44
- package/lib/components/Select/__tests__/Select.test.tsx +698 -8
- package/lib/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +5 -4
- package/lib/components/Select/subcomponents/CustomOption.tsx +12 -4
- package/lib/components/Select/subcomponents/CustomSelect.tsx +411 -41
- package/lib/components/Select/subcomponents/FilterInput.tsx +90 -0
- package/lib/components/Select/subcomponents/NativeSelect.tsx +21 -17
- package/lib/components/Select/subcomponents/Panel.tsx +2 -2
- package/lib/components/Select/subcomponents/VisibleField.tsx +59 -6
- package/lib/components/Select/subcomponents/index.tsx +1 -0
- package/lib/components/Snackbar/Snackbar.stories.tsx +1 -1
- package/lib/components/Snackbar/__tests__/__snapshots__/Snackbar.test.tsx.snap +9 -15
- package/lib/components/Spinner/Spinner.stories.tsx +1 -1
- 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/Textarea/Textarea.stories.tsx +1 -1
- package/lib/components/Timepicker/Timepicker.stories.tsx +1 -1
- package/lib/components/Timepicker/Timepicker.tsx +4 -0
- package/lib/components/Timepicker/__tests__/__snapshots__/Timepicker.test.tsx.snap +2 -2
- package/lib/components/Toggle/Toggle.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.stories.tsx +1 -1
- 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 +145 -0
- package/lib/components/WeekPicker/WeekPicker.tsx +2 -2
- package/lib/components/WeekPicker/WeekPicker.types.ts +21 -0
- package/lib/components/WeekPicker/index.ts +1 -0
- package/lib/components/WeekPicker/subcomponents/CustomDatepicker.tsx +1 -1
- package/lib/components/common/Common.mdx +1 -2
- package/lib/components/index.ts +30 -3
- package/lib/hooks/useFocusTrap.ts +40 -4
- package/lib/index.ts +1 -0
- 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/__tests__/announce.test.ts +121 -0
- package/lib/utils/addAlphaToHex.ts +29 -0
- package/lib/utils/announce.ts +134 -0
- package/lib/utils/index.ts +1 -0
- package/lib/utils/scrollToTop.ts +5 -0
- package/package.json +11 -9
- 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/components/Datepicker/subcomponents/NativeDatepicker.d.ts +0 -6
- package/dist/theme/defaultTheme.d.ts +0 -274
- package/lib/components/Accordion/Accordion.stories.tsx.NOT_READY +0 -93
- package/lib/components/Button/buttonPrimaryStyle.ts +0 -62
- package/lib/components/Button/buttonSecondaryStyle.ts +0 -65
- package/lib/components/Button/buttonTertiaryStyle.ts +0 -54
- /package/dist/components/{Datepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.d.ts → FooterNew/__tests__/Footer.test.d.ts} +0 -0
- /package/lib/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.test.ts +0 -0
|
@@ -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,6 +33,10 @@ const Timepicker = ({
|
|
|
33
33
|
border-color: ${theme.color.text.primary};
|
|
34
34
|
font-family: ${theme.font.family.primary};
|
|
35
35
|
padding: ${theme.padding.p4};
|
|
36
|
+
|
|
37
|
+
&:focus-within {
|
|
38
|
+
box-shadow: ${theme.boxShadow.focus};
|
|
39
|
+
}
|
|
36
40
|
`;
|
|
37
41
|
|
|
38
42
|
const style = cx(NAME, baseStyle, className);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Timepicker > snapshot 1`] = `
|
|
4
4
|
<input
|
|
5
|
-
class="ucl-uikit-timepicker css-
|
|
5
|
+
class="ucl-uikit-timepicker css-4iq7dt"
|
|
6
6
|
data-testid="ucl-uikit-timepicker"
|
|
7
7
|
type="time"
|
|
8
8
|
value=""
|
|
@@ -11,7 +11,7 @@ exports[`Timepicker > snapshot 1`] = `
|
|
|
11
11
|
|
|
12
12
|
exports[`Timepicker > snapshot: testID prop 1`] = `
|
|
13
13
|
<input
|
|
14
|
-
class="ucl-uikit-timepicker css-
|
|
14
|
+
class="ucl-uikit-timepicker css-4iq7dt"
|
|
15
15
|
data-testid="testId"
|
|
16
16
|
type="time"
|
|
17
17
|
value=""
|
|
@@ -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);
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { useArgs } from '@storybook/preview-api';
|
|
3
|
+
import WeekPicker from './WeekPicker';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/WeekPicker',
|
|
7
|
+
component: WeekPicker,
|
|
8
|
+
parameters: { layout: 'padded' },
|
|
9
|
+
argTypes: {
|
|
10
|
+
value: { control: { type: 'date' } },
|
|
11
|
+
minDate: { control: { type: 'date' } },
|
|
12
|
+
maxDate: { control: { type: 'date' } },
|
|
13
|
+
disabled: { control: { type: 'boolean' } },
|
|
14
|
+
showAcademicWeeks: { control: { type: 'boolean' } },
|
|
15
|
+
},
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
} satisfies Meta<typeof WeekPicker>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
render: () => {
|
|
24
|
+
const [args, updateArgs] = useArgs();
|
|
25
|
+
|
|
26
|
+
// Storybook controls provide UNIX timestamps for dates, need to convert
|
|
27
|
+
// https://storybook.js.org/docs/essentials/controls#annotation
|
|
28
|
+
args.value = args.value ? new Date(args.value) : null;
|
|
29
|
+
args.minDate = args.minDate
|
|
30
|
+
? new Date(args.minDate).toLocaleDateString('sv-SE')
|
|
31
|
+
: null;
|
|
32
|
+
args.maxDate = args.maxDate
|
|
33
|
+
? new Date(args.maxDate).toLocaleDateString('sv-SE')
|
|
34
|
+
: null;
|
|
35
|
+
|
|
36
|
+
const onValueChange = (value: Date | null) => updateArgs({ value: value });
|
|
37
|
+
return (
|
|
38
|
+
<WeekPicker
|
|
39
|
+
{...args}
|
|
40
|
+
onValueChange={onValueChange}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const academicWeeks = [
|
|
47
|
+
{ start: '2025-08-25', number: 1 },
|
|
48
|
+
{ start: '2025-09-01', number: 2 },
|
|
49
|
+
{ start: '2025-09-08', number: 3 },
|
|
50
|
+
{ start: '2025-09-15', number: 4 },
|
|
51
|
+
{ start: '2025-09-22', number: 5 },
|
|
52
|
+
{ start: '2025-09-29', number: 6 },
|
|
53
|
+
{ start: '2025-10-06', number: 7 },
|
|
54
|
+
{ start: '2025-10-13', number: 8 },
|
|
55
|
+
{ start: '2025-10-20', number: 9 },
|
|
56
|
+
{ start: '2025-10-27', number: 10 },
|
|
57
|
+
{ start: '2025-11-03', number: 11 },
|
|
58
|
+
{ start: '2025-11-10', number: 12 },
|
|
59
|
+
{ start: '2025-11-17', number: 13 },
|
|
60
|
+
{ start: '2025-11-24', number: 14 },
|
|
61
|
+
{ start: '2025-12-01', number: 15 },
|
|
62
|
+
{ start: '2025-12-08', number: 16 },
|
|
63
|
+
{ start: '2025-12-15', number: 17 },
|
|
64
|
+
{ start: '2025-12-22', number: 18 },
|
|
65
|
+
{ start: '2025-12-29', number: 19 },
|
|
66
|
+
{ start: '2026-01-05', number: 20 },
|
|
67
|
+
{ start: '2026-01-12', number: 21 },
|
|
68
|
+
{ start: '2026-01-19', number: 22 },
|
|
69
|
+
{ start: '2026-01-26', number: 23 },
|
|
70
|
+
{ start: '2026-02-02', number: 24 },
|
|
71
|
+
{ start: '2026-02-09', number: 25 },
|
|
72
|
+
{ start: '2026-02-16', number: 26 },
|
|
73
|
+
{ start: '2026-02-23', number: 27 },
|
|
74
|
+
{ start: '2026-03-02', number: 28 },
|
|
75
|
+
{ start: '2026-03-09', number: 29 },
|
|
76
|
+
{ start: '2026-03-16', number: 30 },
|
|
77
|
+
{ start: '2026-03-23', number: 31 },
|
|
78
|
+
{ start: '2026-03-30', number: 32 },
|
|
79
|
+
{ start: '2026-04-06', number: 33 },
|
|
80
|
+
{ start: '2026-04-13', number: 34 },
|
|
81
|
+
{ start: '2026-04-20', number: 35 },
|
|
82
|
+
{ start: '2026-04-27', number: 36 },
|
|
83
|
+
{ start: '2026-05-04', number: 37 },
|
|
84
|
+
{ start: '2026-05-11', number: 38 },
|
|
85
|
+
{ start: '2026-05-18', number: 39 },
|
|
86
|
+
{ start: '2026-05-25', number: 40 },
|
|
87
|
+
{ start: '2026-06-01', number: 41 },
|
|
88
|
+
{ start: '2026-06-08', number: 42 },
|
|
89
|
+
{ start: '2026-06-15', number: 43 },
|
|
90
|
+
{ start: '2026-06-22', number: 44 },
|
|
91
|
+
{ start: '2026-06-29', number: 45 },
|
|
92
|
+
{ start: '2026-07-06', number: 46 },
|
|
93
|
+
{ start: '2026-07-13', number: 47 },
|
|
94
|
+
{ start: '2026-07-20', number: 48 },
|
|
95
|
+
{ start: '2026-07-27', number: 49 },
|
|
96
|
+
{ start: '2026-08-03', number: 50 },
|
|
97
|
+
{ start: '2026-08-10', number: 51 },
|
|
98
|
+
{ start: '2026-08-17', number: 52 },
|
|
99
|
+
{ start: '2026-08-24', number: 53 },
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
export const WithAcademicWeeks: Story = {
|
|
103
|
+
name: 'With academic weeks',
|
|
104
|
+
args: {
|
|
105
|
+
showAcademicWeeks: true,
|
|
106
|
+
academicWeeks: academicWeeks,
|
|
107
|
+
value: new Date(academicWeeks[0].start), // So the week numbers appear on story mount
|
|
108
|
+
},
|
|
109
|
+
render: () => {
|
|
110
|
+
const [args, updateArgs] = useArgs();
|
|
111
|
+
|
|
112
|
+
// Storybook controls provide UNIX timestamps for dates, need to convert
|
|
113
|
+
// https://storybook.js.org/docs/essentials/controls#annotation
|
|
114
|
+
args.value = args.value ? new Date(args.value) : null;
|
|
115
|
+
args.minDate = args.minDate
|
|
116
|
+
? new Date(args.minDate).toLocaleDateString('sv-SE')
|
|
117
|
+
: null;
|
|
118
|
+
args.maxDate = args.maxDate
|
|
119
|
+
? new Date(args.maxDate).toLocaleDateString('sv-SE')
|
|
120
|
+
: null;
|
|
121
|
+
|
|
122
|
+
const onValueChange = (value: Date | null) => updateArgs({ value: value });
|
|
123
|
+
return (
|
|
124
|
+
<WeekPicker
|
|
125
|
+
{...args}
|
|
126
|
+
onValueChange={onValueChange}
|
|
127
|
+
/>
|
|
128
|
+
);
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const Disabled: Story = {
|
|
133
|
+
name: 'Disabled',
|
|
134
|
+
args: {
|
|
135
|
+
disabled: true,
|
|
136
|
+
value: new Date(),
|
|
137
|
+
},
|
|
138
|
+
render: () => {
|
|
139
|
+
const [args] = useArgs();
|
|
140
|
+
|
|
141
|
+
args.value = args.value ? new Date(args.value) : null;
|
|
142
|
+
|
|
143
|
+
return <WeekPicker {...args} />;
|
|
144
|
+
},
|
|
145
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CustomDatepicker } from './subcomponents';
|
|
2
|
-
import type {
|
|
2
|
+
import type { WeekPickerProps } from './WeekPicker.types';
|
|
3
3
|
|
|
4
4
|
const WeekPicker = ({
|
|
5
5
|
value,
|
|
@@ -9,7 +9,7 @@ const WeekPicker = ({
|
|
|
9
9
|
disabled,
|
|
10
10
|
className,
|
|
11
11
|
...props
|
|
12
|
-
}:
|
|
12
|
+
}: WeekPickerProps) => {
|
|
13
13
|
return (
|
|
14
14
|
<CustomDatepicker
|
|
15
15
|
value={value}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { HTMLAttributes, RefObject } from 'react';
|
|
2
|
+
import type { CalendarEvent, AcademicWeek } from '../Calendar';
|
|
3
|
+
|
|
4
|
+
export type DatepickerValue = Date | null;
|
|
5
|
+
|
|
6
|
+
export interface WeekPickerProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
value?: DatepickerValue;
|
|
8
|
+
onValueChange?: (
|
|
9
|
+
value: DatepickerValue,
|
|
10
|
+
event?: React.SyntheticEvent
|
|
11
|
+
) => void;
|
|
12
|
+
minDate?: string | null;
|
|
13
|
+
maxDate?: string | null;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
events?: CalendarEvent[];
|
|
16
|
+
showAcademicWeeks?: boolean;
|
|
17
|
+
academicWeeks?: AcademicWeek[];
|
|
18
|
+
testId?: string;
|
|
19
|
+
ref?: RefObject<HTMLDivElement>;
|
|
20
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
21
|
+
}
|
|
@@ -4,7 +4,7 @@ import { VisibleField } from './';
|
|
|
4
4
|
import { Panel } from '../../Datepicker/subcomponents';
|
|
5
5
|
import { Calendar, Icon, IconButton } from '../..';
|
|
6
6
|
import { parseInputValue } from '../../Datepicker/utils';
|
|
7
|
-
import type { DatepickerValue } from '
|
|
7
|
+
import type { DatepickerValue } from '../WeekPicker.types';
|
|
8
8
|
import type { CalendarEvent, AcademicWeek } from '../../Calendar';
|
|
9
9
|
|
|
10
10
|
interface CustomDatepickerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -76,7 +76,6 @@ The available margin props are:
|
|
|
76
76
|
include={['m', 'm', 'mv', 'mh', 'mt', 'mb', 'ml', 'mr', 'noMargins']}
|
|
77
77
|
/>
|
|
78
78
|
|
|
79
|
-
[A live example of common margin props can be found in this `<Button>` story.](?path=/story/components-
|
|
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 './HeadingNew';
|
|
44
|
+
export type { HeadingProps as HeadingNewProps } from './HeadingNew';
|
|
45
|
+
|
|
43
46
|
export { default as Paragraph } from './Paragraph';
|
|
44
47
|
export type { ParagraphProps } from './Paragraph';
|
|
48
|
+
|
|
49
|
+
export { default as ParagraphNew } from './ParagraphNew';
|
|
50
|
+
export type { ParagraphProps as ParagraphNewProps } from './ParagraphNew';
|
|
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,9 +121,8 @@ export { default as Tabs } from './Tabs';
|
|
|
102
121
|
export type { TabsProps } from './Tabs';
|
|
103
122
|
export type { TabProps } from './Tabs/Tab';
|
|
104
123
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
// export type { AccordionProps } from './Accordion';
|
|
124
|
+
export { default as Accordion } from './Accordion';
|
|
125
|
+
export type { AccordionProps } from './Accordion';
|
|
108
126
|
|
|
109
127
|
export { default as Field } from './Field';
|
|
110
128
|
export type { FieldProps } from './Field';
|
|
@@ -134,6 +152,9 @@ export type { RadioProps, LabelledRadioProps } from './Radio';
|
|
|
134
152
|
export { default as Datepicker } from './Datepicker';
|
|
135
153
|
export type { DatepickerProps } from './Datepicker';
|
|
136
154
|
|
|
155
|
+
export { default as NativeDatepicker } from './NativeDatepicker';
|
|
156
|
+
export type { NativeDatepickerProps } from './NativeDatepicker';
|
|
157
|
+
|
|
137
158
|
export { default as Calendar } from './Calendar';
|
|
138
159
|
export type { CalendarProps } from './Calendar';
|
|
139
160
|
|
|
@@ -150,3 +171,9 @@ export type { CookieNoticeProps } from './CookieNotice';
|
|
|
150
171
|
|
|
151
172
|
export { default as Search } from './Search';
|
|
152
173
|
export type { SearchProps } from './Search';
|
|
174
|
+
|
|
175
|
+
export { default as Layout } from './Layout';
|
|
176
|
+
export type { LayoutProps } from './Layout';
|
|
177
|
+
|
|
178
|
+
export { default as Main } from './Main';
|
|
179
|
+
export type { MainProps } from './Main';
|
|
@@ -22,6 +22,7 @@ interface UseFocusTrapOptions {
|
|
|
22
22
|
initialFocusRef?: React.RefObject<HTMLElement>;
|
|
23
23
|
finalFocusRef?: React.RefObject<HTMLElement>;
|
|
24
24
|
restoreFocus?: boolean;
|
|
25
|
+
skipFirstFocusable?: boolean;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export const useFocusTrap = ({
|
|
@@ -30,6 +31,7 @@ export const useFocusTrap = ({
|
|
|
30
31
|
initialFocusRef,
|
|
31
32
|
finalFocusRef,
|
|
32
33
|
restoreFocus = true,
|
|
34
|
+
skipFirstFocusable = false,
|
|
33
35
|
}: UseFocusTrapOptions) => {
|
|
34
36
|
const previousActiveElement = useRef<HTMLElement | null>(null);
|
|
35
37
|
|
|
@@ -87,10 +89,26 @@ export const useFocusTrap = ({
|
|
|
87
89
|
previousActiveElement.current = document.activeElement as HTMLElement;
|
|
88
90
|
|
|
89
91
|
// Focus the specified initial element or the first focusable element
|
|
90
|
-
const
|
|
92
|
+
const focusableElements = getFocusableElements();
|
|
93
|
+
const defaultIndex =
|
|
94
|
+
skipFirstFocusable && focusableElements.length > 1 ? 1 : 0;
|
|
95
|
+
const focusElement =
|
|
96
|
+
initialFocusRef?.current || focusableElements[defaultIndex];
|
|
97
|
+
|
|
98
|
+
let requestAnimationFrameId: number | null = null;
|
|
99
|
+
let setTimeoutId: ReturnType<typeof setTimeout> | undefined;
|
|
100
|
+
|
|
91
101
|
if (focusElement) {
|
|
92
|
-
// Use
|
|
93
|
-
|
|
102
|
+
// Use requestAnimationFrame if available, otherwise setTimeout
|
|
103
|
+
if (typeof requestAnimationFrame === 'function') {
|
|
104
|
+
requestAnimationFrameId = requestAnimationFrame(() => {
|
|
105
|
+
focusElement.focus();
|
|
106
|
+
});
|
|
107
|
+
} else {
|
|
108
|
+
setTimeoutId = setTimeout(() => {
|
|
109
|
+
focusElement.focus();
|
|
110
|
+
}, 0);
|
|
111
|
+
}
|
|
94
112
|
}
|
|
95
113
|
|
|
96
114
|
// Add event listener for keyboard navigation
|
|
@@ -98,8 +116,26 @@ export const useFocusTrap = ({
|
|
|
98
116
|
|
|
99
117
|
return () => {
|
|
100
118
|
document.removeEventListener('keydown', handleKeyDown);
|
|
119
|
+
if (
|
|
120
|
+
typeof requestAnimationFrame === 'function' &&
|
|
121
|
+
requestAnimationFrameId !== null
|
|
122
|
+
) {
|
|
123
|
+
cancelAnimationFrame(requestAnimationFrameId);
|
|
124
|
+
}
|
|
125
|
+
if (
|
|
126
|
+
typeof requestAnimationFrame !== 'function' &&
|
|
127
|
+
setTimeoutId !== undefined
|
|
128
|
+
) {
|
|
129
|
+
clearTimeout(setTimeoutId);
|
|
130
|
+
}
|
|
101
131
|
};
|
|
102
|
-
}, [
|
|
132
|
+
}, [
|
|
133
|
+
isActive,
|
|
134
|
+
initialFocusRef,
|
|
135
|
+
getFocusableElements,
|
|
136
|
+
handleKeyDown,
|
|
137
|
+
skipFirstFocusable,
|
|
138
|
+
]);
|
|
103
139
|
|
|
104
140
|
// Restore focus when trap becomes inactive
|
|
105
141
|
useEffect(() => {
|
package/lib/index.ts
CHANGED
package/lib/theme/Colours.mdx
CHANGED
package/lib/theme/Theme.mdx
CHANGED
package/lib/theme/Typography.mdx
CHANGED