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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as announce } from './announce';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React, { HTMLAttributes
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
2
|
import { css, cx } from '@emotion/css';
|
|
3
3
|
import useTheme from '../../theme/useTheme';
|
|
4
4
|
import Icon from '../Icon/Icon';
|
|
5
5
|
import { useAccordionContext } from './Accordion';
|
|
6
6
|
|
|
7
|
-
export const NAME = 'ucl-accordion__heading';
|
|
7
|
+
export const NAME = 'ucl-uikit-accordion__heading';
|
|
8
|
+
export const ICON_NAME = 'ucl-uikit-accordion__heading__icon';
|
|
8
9
|
|
|
9
|
-
interface AccordionHeadingProps
|
|
10
|
-
|
|
11
|
-
as?: keyof JSX.IntrinsicElements;
|
|
10
|
+
export interface AccordionHeadingProps extends HTMLAttributes<HTMLElement> {
|
|
11
|
+
as?: keyof HTMLElementTagNameMap;
|
|
12
12
|
testId?: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -19,41 +19,76 @@ const AccordionHeading: React.FC<AccordionHeadingProps> = ({
|
|
|
19
19
|
className,
|
|
20
20
|
}) => {
|
|
21
21
|
const [theme] = useTheme();
|
|
22
|
-
const { isOpen, toggleAccordion, disabled, size } =
|
|
23
|
-
useAccordionContext();
|
|
22
|
+
const { isOpen, toggleAccordion, disabled, size } = useAccordionContext();
|
|
24
23
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
background-color: ${theme.color.neutral.white};
|
|
33
|
-
cursor: ${disabled ? 'not-allowed' : 'pointer'};
|
|
34
|
-
font-weight: ${theme.font.weight.bold};
|
|
35
|
-
transition:
|
|
36
|
-
background-color 0.3s ease,
|
|
37
|
-
box-shadow 0.3s ease;
|
|
24
|
+
const handleKeyDown: React.KeyboardEventHandler<HTMLElement> = (e) => {
|
|
25
|
+
if (disabled) return;
|
|
26
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
toggleAccordion();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
const baseStyle = css`
|
|
33
|
+
display: flex;
|
|
34
|
+
position: relative;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
align-items: center;
|
|
37
|
+
padding: ${theme.padding.p16};
|
|
38
|
+
background-color: ${theme.colour.fill.inverse};
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
font-weight: ${theme.font.weight.bold};
|
|
41
|
+
transition: background-color 0.15s ease;
|
|
42
|
+
margin: 0;
|
|
43
|
+
border: none;
|
|
44
|
+
outline: none;
|
|
45
|
+
text-decoration: none;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
width: 100%;
|
|
48
|
+
font-size: inherit;
|
|
49
|
+
line-height: inherit;
|
|
44
50
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
&:hover {
|
|
52
|
+
background-color: ${theme.colour.surface.brandHover};
|
|
53
|
+
|
|
54
|
+
[class*='${ICON_NAME}'] {
|
|
55
|
+
color: ${theme.colour.icon.default};
|
|
48
56
|
}
|
|
49
|
-
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
const disabledStyle = css`
|
|
61
|
+
cursor: 'not-allowed';
|
|
62
|
+
|
|
63
|
+
&:hover {
|
|
64
|
+
background-color: ${theme.colour.text.disabled};
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
const headingStyle = cx(
|
|
69
|
+
NAME,
|
|
70
|
+
baseStyle,
|
|
71
|
+
disabled && disabledStyle,
|
|
50
72
|
className
|
|
51
73
|
);
|
|
52
74
|
|
|
75
|
+
const iconBaseStyle = css`
|
|
76
|
+
transform: rotate(${isOpen ? '180deg' : '0deg'});
|
|
77
|
+
transition: transform 0.15s ease;
|
|
78
|
+
color: ${theme.colour.icon.brand};
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
const iconDisabledStyle = css`
|
|
82
|
+
color: ${theme.colour.icon.disabled};
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
const iconStyle = cx(ICON_NAME, iconBaseStyle, disabled && iconDisabledStyle);
|
|
86
|
+
|
|
53
87
|
return (
|
|
54
88
|
<Component
|
|
55
89
|
className={headingStyle}
|
|
56
90
|
data-testid={testId}
|
|
91
|
+
onKeyDown={handleKeyDown}
|
|
57
92
|
onClick={!disabled ? toggleAccordion : undefined}
|
|
58
93
|
role='button'
|
|
59
94
|
tabIndex={0}
|
|
@@ -62,11 +97,7 @@ const AccordionHeading: React.FC<AccordionHeadingProps> = ({
|
|
|
62
97
|
{children}
|
|
63
98
|
<Icon.ChevronDown
|
|
64
99
|
size={size === 'medium' ? 32 : 24}
|
|
65
|
-
className={
|
|
66
|
-
transform: rotate(${isOpen ? '180deg' : '0deg'});
|
|
67
|
-
transition: transform 0.15s ease;
|
|
68
|
-
color: ${theme.color.interaction.blue70};
|
|
69
|
-
`}
|
|
100
|
+
className={iconStyle}
|
|
70
101
|
/>
|
|
71
102
|
</Component>
|
|
72
103
|
);
|
|
@@ -3,10 +3,9 @@ import { css, cx } from '@emotion/css';
|
|
|
3
3
|
import useTheme from '../../theme/useTheme';
|
|
4
4
|
import { useAccordionContext } from './Accordion';
|
|
5
5
|
|
|
6
|
-
export const NAME = 'ucl-accordion__panel';
|
|
6
|
+
export const NAME = 'ucl-uikit-accordion__panel';
|
|
7
7
|
|
|
8
|
-
interface AccordionPanelProps
|
|
9
|
-
extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
export interface AccordionPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
9
|
testId?: string;
|
|
11
10
|
}
|
|
12
11
|
|
|
@@ -24,12 +23,17 @@ const AccordionPanel: React.FC<AccordionPanelProps> = ({
|
|
|
24
23
|
NAME,
|
|
25
24
|
|
|
26
25
|
css`
|
|
26
|
+
position: relative;
|
|
27
|
+
width: 100%;
|
|
28
|
+
max-width: 100%;
|
|
29
|
+
min-width: 0;
|
|
30
|
+
flex-shrink: 1;
|
|
27
31
|
padding: ${theme.padding.p16};
|
|
28
|
-
font-family: ${theme.font.family.primary};
|
|
29
32
|
font-weight: ${theme.font.weight.regular};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
overflow-wrap: break-word;
|
|
36
|
+
word-break: break-word;
|
|
33
37
|
`,
|
|
34
38
|
className
|
|
35
39
|
);
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Accordion from './Accordion';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/Accordion',
|
|
6
|
+
component: Accordion,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
argTypes: {
|
|
11
|
+
size: {
|
|
12
|
+
options: ['small', 'medium'],
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
type: 'string',
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
control: { type: 'boolean' },
|
|
18
|
+
type: 'boolean',
|
|
19
|
+
},
|
|
20
|
+
isOpen: {
|
|
21
|
+
control: { type: 'boolean' },
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
},
|
|
24
|
+
testId: {
|
|
25
|
+
control: { type: 'text' },
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
className: {
|
|
29
|
+
control: { type: 'text' },
|
|
30
|
+
type: 'string',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
args: {
|
|
34
|
+
isOpen: false,
|
|
35
|
+
disabled: false,
|
|
36
|
+
size: 'medium',
|
|
37
|
+
},
|
|
38
|
+
tags: ['autodocs'],
|
|
39
|
+
} satisfies Meta<typeof Accordion>;
|
|
40
|
+
|
|
41
|
+
export default meta;
|
|
42
|
+
|
|
43
|
+
type Story = StoryObj<typeof meta>;
|
|
44
|
+
|
|
45
|
+
export const Default: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
isOpen: false,
|
|
48
|
+
disabled: false,
|
|
49
|
+
size: 'medium',
|
|
50
|
+
},
|
|
51
|
+
render: (args) => (
|
|
52
|
+
<Accordion {...args}>
|
|
53
|
+
<Accordion.Heading>Heading</Accordion.Heading>
|
|
54
|
+
<Accordion.Panel>Panel Content</Accordion.Panel>
|
|
55
|
+
</Accordion>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Disabled: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
isOpen: false,
|
|
62
|
+
disabled: true,
|
|
63
|
+
size: 'medium',
|
|
64
|
+
},
|
|
65
|
+
render: (args) => (
|
|
66
|
+
<Accordion {...args}>
|
|
67
|
+
<Accordion.Heading>Heading</Accordion.Heading>
|
|
68
|
+
<Accordion.Panel>Panel Content</Accordion.Panel>
|
|
69
|
+
</Accordion>
|
|
70
|
+
),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const SmallSize: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
isOpen: false,
|
|
76
|
+
disabled: false,
|
|
77
|
+
size: 'small',
|
|
78
|
+
},
|
|
79
|
+
render: (args) => (
|
|
80
|
+
<Accordion {...args}>
|
|
81
|
+
<Accordion.Heading>Heading</Accordion.Heading>
|
|
82
|
+
<Accordion.Panel>Panel Content</Accordion.Panel>
|
|
83
|
+
</Accordion>
|
|
84
|
+
),
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const CustomHeadingElement: Story = {
|
|
88
|
+
args: {
|
|
89
|
+
isOpen: false,
|
|
90
|
+
disabled: false,
|
|
91
|
+
size: 'medium',
|
|
92
|
+
},
|
|
93
|
+
render: (args) => (
|
|
94
|
+
<Accordion {...args}>
|
|
95
|
+
<Accordion.Heading as='h2'>Custom Heading as H2</Accordion.Heading>
|
|
96
|
+
<Accordion.Panel>
|
|
97
|
+
<p>This is the content of the accordion.</p>
|
|
98
|
+
</Accordion.Panel>
|
|
99
|
+
</Accordion>
|
|
100
|
+
),
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const MultipleAccordions: Story = {
|
|
104
|
+
args: {
|
|
105
|
+
isOpen: false,
|
|
106
|
+
disabled: false,
|
|
107
|
+
size: 'medium',
|
|
108
|
+
},
|
|
109
|
+
render: (args) => (
|
|
110
|
+
<div style={{ width: '100%', maxWidth: 660 }}>
|
|
111
|
+
<Accordion {...args}>
|
|
112
|
+
<Accordion.Heading>Heading</Accordion.Heading>
|
|
113
|
+
<Accordion.Panel>
|
|
114
|
+
<p>
|
|
115
|
+
This accordion reveals additional details. For enquiries, email
|
|
116
|
+
<a href='mailto:admissions@ucl.ac.uk'> admissions@ucl.ac.uk</a>.
|
|
117
|
+
</p>
|
|
118
|
+
<p>
|
|
119
|
+
You can also visit our FAQs for more information and guidance on
|
|
120
|
+
next steps.
|
|
121
|
+
</p>
|
|
122
|
+
</Accordion.Panel>
|
|
123
|
+
</Accordion>
|
|
124
|
+
<Accordion {...args}>
|
|
125
|
+
<Accordion.Heading>Heading</Accordion.Heading>
|
|
126
|
+
<Accordion.Panel>
|
|
127
|
+
<p>
|
|
128
|
+
This accordion reveals additional details. For enquiries, email
|
|
129
|
+
<a href='mailto:admissions@ucl.ac.uk'> admissions@ucl.ac.uk</a>.
|
|
130
|
+
</p>
|
|
131
|
+
<p>
|
|
132
|
+
You can also visit our FAQs for more information and guidance on
|
|
133
|
+
next steps.
|
|
134
|
+
</p>
|
|
135
|
+
</Accordion.Panel>
|
|
136
|
+
</Accordion>
|
|
137
|
+
</div>
|
|
138
|
+
),
|
|
139
|
+
};
|
|
@@ -9,7 +9,7 @@ import AccordionPanel from './Accordion.Panel';
|
|
|
9
9
|
import { css, cx } from '@emotion/css';
|
|
10
10
|
import useTheme from '../../theme/useTheme';
|
|
11
11
|
|
|
12
|
-
export const NAME = 'ucl-accordion';
|
|
12
|
+
export const NAME = 'ucl-uikit-accordion';
|
|
13
13
|
|
|
14
14
|
interface AccordionContextProps {
|
|
15
15
|
isOpen: boolean;
|
|
@@ -18,9 +18,9 @@ interface AccordionContextProps {
|
|
|
18
18
|
size: 'small' | 'medium';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const AccordionContext = createContext<
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const AccordionContext = createContext<AccordionContextProps | undefined>(
|
|
22
|
+
undefined
|
|
23
|
+
);
|
|
24
24
|
|
|
25
25
|
export const useAccordionContext = () => {
|
|
26
26
|
const context = useContext(AccordionContext);
|
|
@@ -32,8 +32,7 @@ export const useAccordionContext = () => {
|
|
|
32
32
|
return context;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
export interface AccordionProps
|
|
36
|
-
extends HTMLAttributes<HTMLDivElement> {
|
|
35
|
+
export interface AccordionProps extends HTMLAttributes<HTMLDivElement> {
|
|
37
36
|
testId?: string;
|
|
38
37
|
size?: 'small' | 'medium';
|
|
39
38
|
disabled?: boolean;
|
|
@@ -60,31 +59,40 @@ const Accordion: React.FC<AccordionProps> & {
|
|
|
60
59
|
}
|
|
61
60
|
};
|
|
62
61
|
|
|
63
|
-
const
|
|
62
|
+
const baseStyle = css`
|
|
63
|
+
width: 660px;
|
|
64
|
+
min-width: 288px;
|
|
65
|
+
max-width: 660px;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
border: 1px solid ${theme.colour.border.default};
|
|
68
|
+
background-color: ${theme.colour.surface.default};
|
|
69
|
+
color: ${theme.colour.text.default};
|
|
70
|
+
font-family: ${theme.font.family.primary};
|
|
71
|
+
font-size: ${theme.font.size.f16};
|
|
72
|
+
flex-shrink: 1;
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
const sizeSmallStyle = css`
|
|
76
|
+
font-size: ${theme.font.size.f16};
|
|
77
|
+
line-height: ${theme.height.h24};
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
const sizeMediumStyle = css`
|
|
81
|
+
font-size: ${theme.font.size.f20};
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
const disabledStyle = css`
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
background-color: ${theme.colour.fill.inverse};
|
|
87
|
+
color: ${theme.colour.text.disabled};
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
const style = cx(
|
|
64
91
|
NAME,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
font-family: ${theme.font.family.primary};
|
|
70
|
-
font-size: ${theme.font.size.f16};
|
|
71
|
-
`,
|
|
72
|
-
size === 'small' &&
|
|
73
|
-
css`
|
|
74
|
-
font-size: ${theme.font.size.f16};
|
|
75
|
-
line-height: ${theme.height.h24};
|
|
76
|
-
`,
|
|
77
|
-
size === 'medium' &&
|
|
78
|
-
css`
|
|
79
|
-
font-size: ${theme.font.size.f20};
|
|
80
|
-
`,
|
|
81
|
-
disabled &&
|
|
82
|
-
css`
|
|
83
|
-
pointer-events: none;
|
|
84
|
-
background-color: ${theme.color.link.disabled};
|
|
85
|
-
color: ${theme.color.text.muted};
|
|
86
|
-
// border-color: ${theme.color.text.muted};
|
|
87
|
-
`,
|
|
92
|
+
baseStyle,
|
|
93
|
+
size === 'small' && sizeSmallStyle,
|
|
94
|
+
size === 'medium' && sizeMediumStyle,
|
|
95
|
+
disabled && disabledStyle,
|
|
88
96
|
className
|
|
89
97
|
);
|
|
90
98
|
|
|
@@ -98,7 +106,7 @@ const Accordion: React.FC<AccordionProps> & {
|
|
|
98
106
|
}}
|
|
99
107
|
>
|
|
100
108
|
<div
|
|
101
|
-
className={
|
|
109
|
+
className={style}
|
|
102
110
|
aria-disabled={disabled}
|
|
103
111
|
data-testid={testId}
|
|
104
112
|
>
|
|
@@ -3,21 +3,22 @@
|
|
|
3
3
|
exports[`Accordion > snapshot: no props 1`] = `
|
|
4
4
|
<div
|
|
5
5
|
aria-disabled="false"
|
|
6
|
-
class="ucl-accordion css-
|
|
7
|
-
data-testid="ucl-accordion"
|
|
6
|
+
class="ucl-uikit-accordion css-1o0gcpe"
|
|
7
|
+
data-testid="ucl-uikit-accordion"
|
|
8
8
|
>
|
|
9
9
|
<div
|
|
10
10
|
aria-expanded="false"
|
|
11
|
-
class="ucl-accordion__heading css-
|
|
12
|
-
data-testid="ucl-accordion__heading"
|
|
11
|
+
class="ucl-uikit-accordion__heading css-18gluve"
|
|
12
|
+
data-testid="ucl-uikit-accordion__heading"
|
|
13
13
|
role="button"
|
|
14
14
|
tabindex="0"
|
|
15
15
|
>
|
|
16
16
|
Heading
|
|
17
17
|
<svg
|
|
18
|
-
class="ucl-uikit-icon css-
|
|
18
|
+
class="ucl-uikit-icon ucl-uikit-accordion__heading__icon css-o97cjm"
|
|
19
19
|
data-testid="ucl-uikit-icon"
|
|
20
20
|
fill="none"
|
|
21
|
+
focusable="false"
|
|
21
22
|
height="32"
|
|
22
23
|
stroke="currentColor"
|
|
23
24
|
stroke-linecap="round"
|
|
@@ -27,8 +28,8 @@ exports[`Accordion > snapshot: no props 1`] = `
|
|
|
27
28
|
width="32"
|
|
28
29
|
xmlns="http://www.w3.org/2000/svg"
|
|
29
30
|
>
|
|
30
|
-
<
|
|
31
|
-
|
|
31
|
+
<path
|
|
32
|
+
d="m6 9 6 6 6-6"
|
|
32
33
|
/>
|
|
33
34
|
</svg>
|
|
34
35
|
</div>
|
|
@@ -38,21 +39,22 @@ exports[`Accordion > snapshot: no props 1`] = `
|
|
|
38
39
|
exports[`Accordion > snapshot: testId prop 1`] = `
|
|
39
40
|
<div
|
|
40
41
|
aria-disabled="false"
|
|
41
|
-
class="ucl-accordion css-
|
|
42
|
+
class="ucl-uikit-accordion css-1o0gcpe"
|
|
42
43
|
data-testid="abc"
|
|
43
44
|
>
|
|
44
45
|
<div
|
|
45
46
|
aria-expanded="false"
|
|
46
|
-
class="ucl-accordion__heading css-
|
|
47
|
-
data-testid="ucl-accordion__heading"
|
|
47
|
+
class="ucl-uikit-accordion__heading css-18gluve"
|
|
48
|
+
data-testid="ucl-uikit-accordion__heading"
|
|
48
49
|
role="button"
|
|
49
50
|
tabindex="0"
|
|
50
51
|
>
|
|
51
52
|
Heading
|
|
52
53
|
<svg
|
|
53
|
-
class="ucl-uikit-icon css-
|
|
54
|
+
class="ucl-uikit-icon ucl-uikit-accordion__heading__icon css-o97cjm"
|
|
54
55
|
data-testid="ucl-uikit-icon"
|
|
55
56
|
fill="none"
|
|
57
|
+
focusable="false"
|
|
56
58
|
height="32"
|
|
57
59
|
stroke="currentColor"
|
|
58
60
|
stroke-linecap="round"
|
|
@@ -62,8 +64,8 @@ exports[`Accordion > snapshot: testId prop 1`] = `
|
|
|
62
64
|
width="32"
|
|
63
65
|
xmlns="http://www.w3.org/2000/svg"
|
|
64
66
|
>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
+
<path
|
|
68
|
+
d="m6 9 6 6 6-6"
|
|
67
69
|
/>
|
|
68
70
|
</svg>
|
|
69
71
|
</div>
|
|
@@ -56,23 +56,23 @@ const Alert = ({
|
|
|
56
56
|
`;
|
|
57
57
|
|
|
58
58
|
const infoStyle = css`
|
|
59
|
-
background-color: ${theme.
|
|
60
|
-
border-color: ${theme.
|
|
59
|
+
background-color: ${theme.colour.surface.brand};
|
|
60
|
+
border-color: ${theme.colour.border.brand};
|
|
61
61
|
`;
|
|
62
62
|
|
|
63
63
|
const successStyle = css`
|
|
64
|
-
background-color: ${theme.
|
|
65
|
-
border-color: ${theme.
|
|
64
|
+
background-color: ${theme.colour.surface.success};
|
|
65
|
+
border-color: ${theme.colour.border.success};
|
|
66
66
|
`;
|
|
67
67
|
|
|
68
68
|
const warningStyle = css`
|
|
69
|
-
background-color: ${theme.
|
|
70
|
-
border-color: ${theme.
|
|
69
|
+
background-color: ${theme.colour.surface.warning};
|
|
70
|
+
border-color: ${theme.colour.border.warning};
|
|
71
71
|
`;
|
|
72
72
|
|
|
73
73
|
const errorStyle = css`
|
|
74
|
-
background-color: ${theme.
|
|
75
|
-
border-color: ${theme.
|
|
74
|
+
background-color: ${theme.colour.surface.critical};
|
|
75
|
+
border-color: ${theme.colour.border.critical};
|
|
76
76
|
`;
|
|
77
77
|
|
|
78
78
|
const style = cx(
|
|
@@ -89,19 +89,19 @@ const Alert = ({
|
|
|
89
89
|
const iconStyle = cx(
|
|
90
90
|
type === 'info' &&
|
|
91
91
|
css`
|
|
92
|
-
color: ${theme.
|
|
92
|
+
color: ${theme.colour.icon.brand};
|
|
93
93
|
`,
|
|
94
94
|
type === 'success' &&
|
|
95
95
|
css`
|
|
96
|
-
color: ${theme.
|
|
96
|
+
color: ${theme.colour.icon.success};
|
|
97
97
|
`,
|
|
98
98
|
type === 'warning' &&
|
|
99
99
|
css`
|
|
100
|
-
color: ${theme.
|
|
100
|
+
color: ${theme.colour.icon.warning};
|
|
101
101
|
`,
|
|
102
102
|
type === 'error' &&
|
|
103
103
|
css`
|
|
104
|
-
color: ${theme.
|
|
104
|
+
color: ${theme.colour.icon.critical};
|
|
105
105
|
`
|
|
106
106
|
);
|
|
107
107
|
|