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
|
@@ -7,7 +7,11 @@ interface PanelProps {
|
|
|
7
7
|
|
|
8
8
|
const NAME = 'ucl-uikit-datepicker__panel';
|
|
9
9
|
|
|
10
|
-
const Panel = ({
|
|
10
|
+
const Panel = ({
|
|
11
|
+
zIndex = 10,
|
|
12
|
+
children,
|
|
13
|
+
}: PanelProps) => {
|
|
14
|
+
|
|
11
15
|
const datepickerHeight = 48;
|
|
12
16
|
const gapFromDatepicker = 8;
|
|
13
17
|
|
|
@@ -27,6 +31,6 @@ const Panel = ({ zIndex = 10, children }: PanelProps) => {
|
|
|
27
31
|
{children}
|
|
28
32
|
</div>
|
|
29
33
|
);
|
|
30
|
-
}
|
|
34
|
+
}
|
|
31
35
|
|
|
32
36
|
export default Panel;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { css, cx } from '@emotion/css';
|
|
2
2
|
import { DatepickerInput } from './';
|
|
3
|
-
import { Icon } from '../../..';
|
|
3
|
+
import { Icon, IconButton } from '../../..';
|
|
4
4
|
import { useTheme } from '../../../theme';
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import type { InputProps } from './DatepickerInput';
|
|
6
7
|
|
|
7
8
|
interface VisibleFieldProps {
|
|
8
9
|
inputValue: string;
|
|
@@ -10,8 +11,12 @@ interface VisibleFieldProps {
|
|
|
10
11
|
onInputKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
11
12
|
onInputFocus: () => void;
|
|
12
13
|
onButtonClick: () => void;
|
|
14
|
+
onClear: (event: React.SyntheticEvent) => void;
|
|
13
15
|
disabled: boolean;
|
|
16
|
+
clearable?: boolean;
|
|
17
|
+
hasValue?: boolean;
|
|
14
18
|
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
19
|
+
inputProps: InputProps;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
const NAME = 'ucl-uikit-datepicker__visible-field';
|
|
@@ -22,8 +27,12 @@ const VisibleField = ({
|
|
|
22
27
|
onInputKeyDown,
|
|
23
28
|
onInputFocus,
|
|
24
29
|
onButtonClick,
|
|
30
|
+
onClear,
|
|
25
31
|
disabled,
|
|
32
|
+
clearable = false,
|
|
33
|
+
hasValue = false,
|
|
26
34
|
inputRef,
|
|
35
|
+
inputProps,
|
|
27
36
|
}: VisibleFieldProps) => {
|
|
28
37
|
const [theme] = useTheme();
|
|
29
38
|
|
|
@@ -61,9 +70,17 @@ const VisibleField = ({
|
|
|
61
70
|
display: flex;
|
|
62
71
|
align-items: center;
|
|
63
72
|
justify-content: center;
|
|
64
|
-
padding: 0 16px
|
|
73
|
+
padding: 0 16px;
|
|
74
|
+
border: none;
|
|
75
|
+
background: transparent;
|
|
76
|
+
// padding: 0 16px 0 4px;
|
|
65
77
|
height: 100%;
|
|
66
78
|
cursor: pointer;
|
|
79
|
+
|
|
80
|
+
&:focus-visible {
|
|
81
|
+
outline: none;
|
|
82
|
+
box-shadow: ${theme.boxShadow.focus};
|
|
83
|
+
}
|
|
67
84
|
`;
|
|
68
85
|
|
|
69
86
|
// `min-width` here accounts for a recurring problem,
|
|
@@ -76,6 +93,9 @@ const VisibleField = ({
|
|
|
76
93
|
: '#8C8C8C'}; // TODO: Needs a design token
|
|
77
94
|
`;
|
|
78
95
|
|
|
96
|
+
// Determine which icon to show
|
|
97
|
+
const showClearIcon = clearable && hasValue && !disabled;
|
|
98
|
+
|
|
79
99
|
const style = cx(NAME, baseStyle, disabled && disabledStyle);
|
|
80
100
|
|
|
81
101
|
return (
|
|
@@ -90,13 +110,31 @@ const VisibleField = ({
|
|
|
90
110
|
onFocus={onInputFocus}
|
|
91
111
|
disabled={disabled}
|
|
92
112
|
ref={inputRef}
|
|
113
|
+
{...inputProps}
|
|
93
114
|
/>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
115
|
+
{showClearIcon ? (
|
|
116
|
+
<IconButton
|
|
117
|
+
type='button'
|
|
118
|
+
onClick={onClear}
|
|
119
|
+
className={iconButtonStyle}
|
|
120
|
+
aria-label='Clear date'
|
|
121
|
+
data-testid={`${NAME}-icon-button`}
|
|
122
|
+
>
|
|
123
|
+
<Icon.X className={iconStyle} />
|
|
124
|
+
</IconButton>
|
|
125
|
+
) : (
|
|
126
|
+
<IconButton
|
|
127
|
+
type='button'
|
|
128
|
+
onClick={onButtonClick}
|
|
129
|
+
className={iconButtonStyle}
|
|
130
|
+
aria-label='Open calendar'
|
|
131
|
+
data-testid={`${NAME}-icon-button`}
|
|
132
|
+
tabIndex={-1}
|
|
133
|
+
disabled={disabled}
|
|
134
|
+
>
|
|
135
|
+
<Icon.Calendar className={iconStyle} />
|
|
136
|
+
</IconButton>
|
|
137
|
+
)}
|
|
100
138
|
</div>
|
|
101
139
|
);
|
|
102
140
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as CustomDatepicker } from './CustomDatepicker';
|
|
2
|
-
export { default as NativeDatepicker } from './NativeDatepicker';
|
|
3
2
|
export { default as VisibleField } from './VisibleField';
|
|
4
3
|
export { default as DatepickerInput } from './DatepickerInput';
|
|
5
4
|
export { default as Panel } from './Panel';
|
|
@@ -4,10 +4,12 @@ import React, {
|
|
|
4
4
|
memo,
|
|
5
5
|
useEffect,
|
|
6
6
|
useRef,
|
|
7
|
+
useContext,
|
|
7
8
|
} from 'react';
|
|
8
9
|
import { css, cx } from '@emotion/css';
|
|
9
10
|
import useTheme from '../../theme/useTheme';
|
|
10
11
|
import { useFocusTrap } from '../../hooks/useFocusTrap';
|
|
12
|
+
import { DialogContext } from './Dialog';
|
|
11
13
|
|
|
12
14
|
export const NAME = 'ucl-uikit-base-dialog';
|
|
13
15
|
export const SMALL_WIDTH = 495;
|
|
@@ -27,6 +29,7 @@ export interface BaseDialogProps extends HTMLAttributes<HTMLDialogElement> {
|
|
|
27
29
|
finalFocusRef?: React.RefObject<HTMLElement>;
|
|
28
30
|
disableFocusTrap?: boolean;
|
|
29
31
|
restoreFocus?: boolean;
|
|
32
|
+
skipCloseOnInitialFocus?: boolean;
|
|
30
33
|
testId?: string;
|
|
31
34
|
}
|
|
32
35
|
|
|
@@ -44,6 +47,7 @@ const BaseDialog = ({
|
|
|
44
47
|
finalFocusRef,
|
|
45
48
|
disableFocusTrap = false,
|
|
46
49
|
restoreFocus = true,
|
|
50
|
+
skipCloseOnInitialFocus = false,
|
|
47
51
|
testId = NAME,
|
|
48
52
|
...props
|
|
49
53
|
}: BaseDialogProps) => {
|
|
@@ -58,6 +62,10 @@ const BaseDialog = ({
|
|
|
58
62
|
const dialogRef = useRef<HTMLDialogElement>(null);
|
|
59
63
|
const previousActiveElement = useRef<HTMLElement | null>(null);
|
|
60
64
|
|
|
65
|
+
const context = useContext(DialogContext);
|
|
66
|
+
const dialogHeaderId = context?.dialogHeaderId;
|
|
67
|
+
const dialogBodyId = context?.dialogBodyId;
|
|
68
|
+
|
|
61
69
|
// Use the focus trap hook
|
|
62
70
|
useFocusTrap({
|
|
63
71
|
isActive: open && modal && !disableFocusTrap,
|
|
@@ -65,6 +73,7 @@ const BaseDialog = ({
|
|
|
65
73
|
initialFocusRef,
|
|
66
74
|
finalFocusRef,
|
|
67
75
|
restoreFocus,
|
|
76
|
+
skipFirstFocusable: skipCloseOnInitialFocus,
|
|
68
77
|
});
|
|
69
78
|
|
|
70
79
|
const hideBodyScroll = css`
|
|
@@ -165,11 +174,11 @@ const BaseDialog = ({
|
|
|
165
174
|
|
|
166
175
|
@media (min-width: ${theme.breakpoints.tablet}px) {
|
|
167
176
|
width: ${width}px;
|
|
168
|
-
max-width: calc(100vw - ${theme.margin.m16}
|
|
177
|
+
max-width: calc(100vw - ${theme.margin.m16});
|
|
169
178
|
height: fit-content;
|
|
170
179
|
|
|
171
180
|
&:modal {
|
|
172
|
-
max-width: ${
|
|
181
|
+
max-width: min(${width}px, calc(100vw - ${theme.margin.m16}));
|
|
173
182
|
max-height: calc(100vh - 32px);
|
|
174
183
|
}
|
|
175
184
|
}
|
|
@@ -190,6 +199,8 @@ const BaseDialog = ({
|
|
|
190
199
|
onClick={handleClick}
|
|
191
200
|
onClose={handleDialogClose}
|
|
192
201
|
aria-modal={modal ? 'true' : 'false'}
|
|
202
|
+
aria-labelledby={dialogHeaderId}
|
|
203
|
+
aria-describedby={dialogBodyId}
|
|
193
204
|
{...props}
|
|
194
205
|
>
|
|
195
206
|
{children}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext } from 'react';
|
|
1
|
+
import { createContext, useId } from 'react';
|
|
2
2
|
import { css, cx } from '@emotion/css';
|
|
3
3
|
import useTheme from '../../theme/useTheme';
|
|
4
4
|
import BaseDialog, { BaseDialogProps } from './BaseDialog';
|
|
@@ -9,6 +9,8 @@ import DialogFooter from './DialogFooter';
|
|
|
9
9
|
export const NAME = 'ucl-uikit-dialog';
|
|
10
10
|
|
|
11
11
|
interface DialogContextValue {
|
|
12
|
+
dialogHeaderId?: string;
|
|
13
|
+
dialogBodyId?: string;
|
|
12
14
|
onClose?: (ev: React.MouseEvent) => void;
|
|
13
15
|
onSecondaryAction?: () => void;
|
|
14
16
|
onAction?: () => void;
|
|
@@ -31,8 +33,12 @@ const Dialog = ({
|
|
|
31
33
|
...props
|
|
32
34
|
}: DialogProps) => {
|
|
33
35
|
const [theme] = useTheme();
|
|
36
|
+
const dialogHeaderId = useId();
|
|
37
|
+
const dialogBodyId = useId();
|
|
34
38
|
|
|
35
39
|
const contextValue: DialogContextValue = {
|
|
40
|
+
dialogHeaderId,
|
|
41
|
+
dialogBodyId,
|
|
36
42
|
onClose,
|
|
37
43
|
onAction,
|
|
38
44
|
onSecondaryAction,
|
|
@@ -50,6 +56,7 @@ const Dialog = ({
|
|
|
50
56
|
onClose={onClose}
|
|
51
57
|
testId={testId}
|
|
52
58
|
className={style}
|
|
59
|
+
skipCloseOnInitialFocus={true}
|
|
53
60
|
{...props}
|
|
54
61
|
>
|
|
55
62
|
{children}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { memo, HTMLAttributes } from 'react';
|
|
1
|
+
import { memo, HTMLAttributes, useContext } from 'react';
|
|
2
2
|
import { css, cx } from '@emotion/css';
|
|
3
3
|
import useTheme from '../../theme/useTheme';
|
|
4
|
+
import { DialogContext } from './Dialog';
|
|
4
5
|
|
|
5
6
|
export const NAME = 'ucl-uikit-dialog__body';
|
|
6
7
|
|
|
@@ -15,6 +16,8 @@ const DialogBody = ({
|
|
|
15
16
|
}: DialogBodyProps) => {
|
|
16
17
|
const [theme] = useTheme();
|
|
17
18
|
|
|
19
|
+
const { dialogBodyId } = useContext(DialogContext);
|
|
20
|
+
|
|
18
21
|
const contentStyle = css`
|
|
19
22
|
margin: ${theme.padding.p24} ${theme.padding.p32};
|
|
20
23
|
`;
|
|
@@ -23,6 +26,7 @@ const DialogBody = ({
|
|
|
23
26
|
|
|
24
27
|
return (
|
|
25
28
|
<div
|
|
29
|
+
id={dialogBodyId}
|
|
26
30
|
className={style}
|
|
27
31
|
data-testid={testId}
|
|
28
32
|
role='document'
|
|
@@ -23,7 +23,7 @@ const DialogHeader = ({
|
|
|
23
23
|
testId = NAME,
|
|
24
24
|
className,
|
|
25
25
|
}: DialogHeaderProps) => {
|
|
26
|
-
const { onClose } = useContext(DialogContext);
|
|
26
|
+
const { onClose, dialogHeaderId } = useContext(DialogContext);
|
|
27
27
|
|
|
28
28
|
const [theme] = useTheme();
|
|
29
29
|
|
|
@@ -73,6 +73,7 @@ const DialogHeader = ({
|
|
|
73
73
|
level={3}
|
|
74
74
|
margins={false}
|
|
75
75
|
{...headingProps}
|
|
76
|
+
id={dialogHeaderId}
|
|
76
77
|
>
|
|
77
78
|
{children}
|
|
78
79
|
</Heading>
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Breadcrumbs > Snapshot: No props 1`] = `
|
|
4
4
|
<nav
|
|
5
|
-
class="ucl-
|
|
6
|
-
data-testid="ucl-
|
|
5
|
+
class="ucl-uikit-breadcrumbs"
|
|
6
|
+
data-testid="ucl-uikit-breadcrumbs"
|
|
7
7
|
>
|
|
8
8
|
<span
|
|
9
9
|
class="css-cdcdpg"
|
|
10
10
|
>
|
|
11
11
|
<span
|
|
12
|
-
class="css-0 ucl-
|
|
13
|
-
data-testid="ucl-
|
|
12
|
+
class="css-0 ucl-uikit-breadcrumb ucl-uikit-breadcrumb--active"
|
|
13
|
+
data-testid="ucl-uikit-breadcrumb"
|
|
14
14
|
>
|
|
15
15
|
Home
|
|
16
16
|
</span>
|
|
@@ -35,8 +35,8 @@ exports[`Breadcrumbs > Snapshot: No props 1`] = `
|
|
|
35
35
|
class="css-cdcdpg"
|
|
36
36
|
>
|
|
37
37
|
<a
|
|
38
|
-
class="ucl-link ucl-
|
|
39
|
-
data-testid="ucl-
|
|
38
|
+
class="ucl-link ucl-uikit-breadcrumb ucl-uikit-breadcrumb--inactive css-1tsyuoi"
|
|
39
|
+
data-testid="ucl-uikit-breadcrumb"
|
|
40
40
|
href="/showcase"
|
|
41
41
|
>
|
|
42
42
|
Timetable
|
|
@@ -62,8 +62,8 @@ exports[`Breadcrumbs > Snapshot: No props 1`] = `
|
|
|
62
62
|
class="css-cdcdpg"
|
|
63
63
|
>
|
|
64
64
|
<a
|
|
65
|
-
class="ucl-link ucl-
|
|
66
|
-
data-testid="ucl-
|
|
65
|
+
class="ucl-link ucl-uikit-breadcrumb ucl-uikit-breadcrumb--inactive css-1tsyuoi"
|
|
66
|
+
data-testid="ucl-uikit-breadcrumb"
|
|
67
67
|
href="/showcase/breadcrumbs"
|
|
68
68
|
>
|
|
69
69
|
Personal
|
|
@@ -74,14 +74,14 @@ exports[`Breadcrumbs > Snapshot: No props 1`] = `
|
|
|
74
74
|
|
|
75
75
|
exports[`Breadcrumbs > snapshot: Custom Test ID 1`] = `
|
|
76
76
|
<nav
|
|
77
|
-
class="ucl-
|
|
77
|
+
class="ucl-uikit-breadcrumbs"
|
|
78
78
|
data-testid="custom-testid"
|
|
79
79
|
>
|
|
80
80
|
<span
|
|
81
81
|
class="css-cdcdpg"
|
|
82
82
|
>
|
|
83
83
|
<span
|
|
84
|
-
class="css-0 ucl-
|
|
84
|
+
class="css-0 ucl-uikit-breadcrumb ucl-uikit-breadcrumb--active"
|
|
85
85
|
data-testid="custom-testid-1"
|
|
86
86
|
>
|
|
87
87
|
Home
|
|
@@ -107,7 +107,7 @@ exports[`Breadcrumbs > snapshot: Custom Test ID 1`] = `
|
|
|
107
107
|
class="css-cdcdpg"
|
|
108
108
|
>
|
|
109
109
|
<a
|
|
110
|
-
class="ucl-link ucl-
|
|
110
|
+
class="ucl-link ucl-uikit-breadcrumb ucl-uikit-breadcrumb--inactive css-1tsyuoi"
|
|
111
111
|
data-testid="custom-testid-2"
|
|
112
112
|
href="/showcase"
|
|
113
113
|
>
|
|
@@ -134,7 +134,7 @@ exports[`Breadcrumbs > snapshot: Custom Test ID 1`] = `
|
|
|
134
134
|
class="css-cdcdpg"
|
|
135
135
|
>
|
|
136
136
|
<a
|
|
137
|
-
class="ucl-link ucl-
|
|
137
|
+
class="ucl-link ucl-uikit-breadcrumb ucl-uikit-breadcrumb--inactive css-1tsyuoi"
|
|
138
138
|
data-testid="custom-testid-3"
|
|
139
139
|
href="/showcase/breadcrumbs"
|
|
140
140
|
>
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import FeedbackDialog from './FeedbackDialog';
|
|
3
3
|
|
|
4
4
|
const meta = {
|
|
5
|
-
title: 'Components/
|
|
5
|
+
title: 'Components/FeedbackDialog',
|
|
6
6
|
component: FeedbackDialog,
|
|
7
7
|
parameters: {
|
|
8
8
|
docs: {
|
|
@@ -31,9 +31,7 @@ const FeedbackDialog = ({
|
|
|
31
31
|
const [theme] = useTheme();
|
|
32
32
|
|
|
33
33
|
const {
|
|
34
|
-
|
|
35
|
-
system: { green70, orange70, red70 },
|
|
36
|
-
},
|
|
34
|
+
colour: { icon: iconColour },
|
|
37
35
|
} = theme;
|
|
38
36
|
|
|
39
37
|
const iconBaseStyle = css`
|
|
@@ -48,15 +46,15 @@ const FeedbackDialog = ({
|
|
|
48
46
|
iconBaseStyle,
|
|
49
47
|
type === 'success' &&
|
|
50
48
|
css`
|
|
51
|
-
color: ${
|
|
49
|
+
color: ${iconColour.success};
|
|
52
50
|
`,
|
|
53
51
|
type === 'warning' &&
|
|
54
52
|
css`
|
|
55
|
-
color: ${
|
|
53
|
+
color: ${iconColour.warning};
|
|
56
54
|
`,
|
|
57
55
|
type === 'error' &&
|
|
58
56
|
css`
|
|
59
|
-
color: ${
|
|
57
|
+
color: ${iconColour.critical};
|
|
60
58
|
`
|
|
61
59
|
);
|
|
62
60
|
|
|
@@ -21,7 +21,7 @@ const CharacaterCount = ({
|
|
|
21
21
|
const { disabled, charCount } = use(FieldContext);
|
|
22
22
|
|
|
23
23
|
const baseStyle = css`
|
|
24
|
-
color: ${theme.
|
|
24
|
+
color: ${theme.colour.text.secondary};
|
|
25
25
|
font-size: ${theme.font.size.f14};
|
|
26
26
|
font-family: ${theme.font.family.primary};
|
|
27
27
|
line-height: ${theme.font.lineHeight.h120};
|
|
@@ -29,7 +29,7 @@ const CharacaterCount = ({
|
|
|
29
29
|
`;
|
|
30
30
|
|
|
31
31
|
const disabledStyle = css`
|
|
32
|
-
color: ${theme.
|
|
32
|
+
color: ${theme.colour.text.disabled};
|
|
33
33
|
`;
|
|
34
34
|
|
|
35
35
|
const style = cx(NAME, baseStyle, disabled && disabledStyle, className);
|
|
@@ -26,7 +26,7 @@ const ErrorText = ({
|
|
|
26
26
|
align-items: flex-start;
|
|
27
27
|
gap: 8px;
|
|
28
28
|
margin-top: 8px;
|
|
29
|
-
color: ${theme.
|
|
29
|
+
color: ${theme.colour.text.critical};
|
|
30
30
|
font-family: ${theme.font.family.primary};
|
|
31
31
|
font-size: ${theme.font.size.f14};
|
|
32
32
|
line-height: ${theme.font.lineHeight.h120};
|
|
@@ -45,6 +45,7 @@ const ErrorText = ({
|
|
|
45
45
|
className={style}
|
|
46
46
|
data-testid={testId}
|
|
47
47
|
{...props}
|
|
48
|
+
role='alert'
|
|
48
49
|
>
|
|
49
50
|
<Icon.Info className={iconStyle} />
|
|
50
51
|
{children}
|
|
@@ -9,7 +9,7 @@ import Input from '../Input/Input';
|
|
|
9
9
|
import Textarea from '../Textarea/Textarea';
|
|
10
10
|
|
|
11
11
|
const meta = {
|
|
12
|
-
title: 'Components/
|
|
12
|
+
title: 'Components/Field',
|
|
13
13
|
component: Field,
|
|
14
14
|
parameters: { layout: 'padded' },
|
|
15
15
|
} satisfies Meta<typeof Field>;
|
|
@@ -20,7 +20,9 @@ const HelperText = ({
|
|
|
20
20
|
const { disabled } = use(FieldContext);
|
|
21
21
|
|
|
22
22
|
const baseStyle = css`
|
|
23
|
-
color: ${disabled
|
|
23
|
+
color: ${disabled
|
|
24
|
+
? theme.colour.text.disabled
|
|
25
|
+
: theme.colour.text.secondary};
|
|
24
26
|
font-family: ${theme.font.family.primary};
|
|
25
27
|
font-size: ${theme.font.size.f16};
|
|
26
28
|
line-height: ${theme.font.lineHeight.h120};
|
|
@@ -507,4 +507,17 @@ describe('Field', () => {
|
|
|
507
507
|
expect(label2).not.toHaveAttribute('for', idForField2);
|
|
508
508
|
expect(textarea1).not.toHaveAttribute('id', idForField1);
|
|
509
509
|
});
|
|
510
|
+
|
|
511
|
+
test('Field.ErrorText has role alert', () => {
|
|
512
|
+
const testId = 'error-text-01';
|
|
513
|
+
render(
|
|
514
|
+
<ThemeContextProvider>
|
|
515
|
+
<Field error>
|
|
516
|
+
<Field.ErrorText testId={testId}> Error text </Field.ErrorText>
|
|
517
|
+
</Field>
|
|
518
|
+
</ThemeContextProvider>
|
|
519
|
+
);
|
|
520
|
+
const errorText = screen.getByTestId(testId);
|
|
521
|
+
expect(errorText).toHaveAttribute('role', 'alert');
|
|
522
|
+
});
|
|
510
523
|
});
|
|
@@ -12,6 +12,7 @@ exports[`Input > snapshot: no props 1`] = `
|
|
|
12
12
|
class="ucl-uikit-icon css-148hpxb"
|
|
13
13
|
data-testid="ucl-uikit-icon"
|
|
14
14
|
fill="none"
|
|
15
|
+
focusable="false"
|
|
15
16
|
height="24"
|
|
16
17
|
stroke="currentColor"
|
|
17
18
|
stroke-linecap="round"
|
|
@@ -22,16 +23,7 @@ exports[`Input > snapshot: no props 1`] = `
|
|
|
22
23
|
xmlns="http://www.w3.org/2000/svg"
|
|
23
24
|
>
|
|
24
25
|
<path
|
|
25
|
-
d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-
|
|
26
|
-
/>
|
|
27
|
-
<polyline
|
|
28
|
-
points="17 8 12 3 7 8"
|
|
29
|
-
/>
|
|
30
|
-
<line
|
|
31
|
-
x1="12"
|
|
32
|
-
x2="12"
|
|
33
|
-
y1="3"
|
|
34
|
-
y2="15"
|
|
26
|
+
d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4m14-7-5-5-5 5m5-5v12"
|
|
35
27
|
/>
|
|
36
28
|
</svg>
|
|
37
29
|
Upload File
|
|
@@ -57,6 +49,7 @@ exports[`Input > snapshot: value prop 1`] = `
|
|
|
57
49
|
class="ucl-uikit-icon css-148hpxb"
|
|
58
50
|
data-testid="ucl-uikit-icon"
|
|
59
51
|
fill="none"
|
|
52
|
+
focusable="false"
|
|
60
53
|
height="24"
|
|
61
54
|
stroke="currentColor"
|
|
62
55
|
stroke-linecap="round"
|
|
@@ -67,16 +60,7 @@ exports[`Input > snapshot: value prop 1`] = `
|
|
|
67
60
|
xmlns="http://www.w3.org/2000/svg"
|
|
68
61
|
>
|
|
69
62
|
<path
|
|
70
|
-
d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-
|
|
71
|
-
/>
|
|
72
|
-
<polyline
|
|
73
|
-
points="17 8 12 3 7 8"
|
|
74
|
-
/>
|
|
75
|
-
<line
|
|
76
|
-
x1="12"
|
|
77
|
-
x2="12"
|
|
78
|
-
y1="3"
|
|
79
|
-
y2="15"
|
|
63
|
+
d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4m14-7-5-5-5 5m5-5v12"
|
|
80
64
|
/>
|
|
81
65
|
</svg>
|
|
82
66
|
Upload File/Image
|