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
|
@@ -1,107 +1,55 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`Button >
|
|
4
|
-
<
|
|
3
|
+
exports[`Button > maps legacy destructive prop to destructive variants 1`] = `
|
|
4
|
+
<button
|
|
5
5
|
aria-disabled="false"
|
|
6
|
-
class="ucl-uikit-button css-
|
|
6
|
+
class="ucl-uikit-button css-yunmm0"
|
|
7
7
|
data-testid="ucl-uikit-button"
|
|
8
|
-
href="https://ucl.ac.uk"
|
|
9
8
|
>
|
|
10
|
-
|
|
11
|
-
</
|
|
9
|
+
Delete
|
|
10
|
+
</button>
|
|
12
11
|
`;
|
|
13
12
|
|
|
14
|
-
exports[`Button >
|
|
13
|
+
exports[`Button > maps legacy size default to medium 1`] = `
|
|
15
14
|
<button
|
|
16
15
|
aria-disabled="false"
|
|
17
|
-
class="ucl-uikit-button css-
|
|
16
|
+
class="ucl-uikit-button css-oqr4zz"
|
|
18
17
|
data-testid="ucl-uikit-button"
|
|
19
18
|
>
|
|
20
|
-
|
|
21
|
-
<svg
|
|
22
|
-
class="ucl-uikit-icon css-148hpxb"
|
|
23
|
-
data-testid="ucl-uikit-icon"
|
|
24
|
-
fill="none"
|
|
25
|
-
height="24"
|
|
26
|
-
stroke="currentColor"
|
|
27
|
-
stroke-linecap="round"
|
|
28
|
-
stroke-linejoin="round"
|
|
29
|
-
stroke-width="2"
|
|
30
|
-
viewBox="0 0 24 24"
|
|
31
|
-
width="24"
|
|
32
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
33
|
-
>
|
|
34
|
-
<polyline
|
|
35
|
-
points="8 17 12 21 16 17"
|
|
36
|
-
/>
|
|
37
|
-
<line
|
|
38
|
-
x1="12"
|
|
39
|
-
x2="12"
|
|
40
|
-
y1="12"
|
|
41
|
-
y2="21"
|
|
42
|
-
/>
|
|
43
|
-
<path
|
|
44
|
-
d="M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"
|
|
45
|
-
/>
|
|
46
|
-
</svg>
|
|
19
|
+
Legacy default size
|
|
47
20
|
</button>
|
|
48
21
|
`;
|
|
49
22
|
|
|
50
|
-
exports[`Button >
|
|
51
|
-
<
|
|
23
|
+
exports[`Button > snapshot: 'as' prop with 'a' 1`] = `
|
|
24
|
+
<a
|
|
52
25
|
aria-disabled="false"
|
|
53
|
-
class="ucl-uikit-button css-
|
|
26
|
+
class="ucl-uikit-button css-oqr4zz"
|
|
54
27
|
data-testid="ucl-uikit-button"
|
|
28
|
+
href="https://ucl.ac.uk"
|
|
55
29
|
>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
data-testid="ucl-uikit-icon"
|
|
59
|
-
fill="none"
|
|
60
|
-
height="24"
|
|
61
|
-
stroke="currentColor"
|
|
62
|
-
stroke-linecap="round"
|
|
63
|
-
stroke-linejoin="round"
|
|
64
|
-
stroke-width="2"
|
|
65
|
-
viewBox="0 0 24 24"
|
|
66
|
-
width="24"
|
|
67
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
68
|
-
>
|
|
69
|
-
<path
|
|
70
|
-
d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
|
|
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"
|
|
80
|
-
/>
|
|
81
|
-
</svg>
|
|
82
|
-
Upload
|
|
83
|
-
</button>
|
|
30
|
+
UCL's website
|
|
31
|
+
</a>
|
|
84
32
|
`;
|
|
85
33
|
|
|
86
34
|
exports[`Button > snapshot: loading 1`] = `
|
|
87
35
|
<button
|
|
88
36
|
aria-disabled="false"
|
|
89
|
-
class="ucl-uikit-button css-
|
|
37
|
+
class="ucl-uikit-button css-1sgvpd0"
|
|
90
38
|
data-testid="ucl-uikit-button"
|
|
91
39
|
disabled=""
|
|
92
40
|
>
|
|
93
41
|
<svg
|
|
94
|
-
class="ucl-uikit-spinner"
|
|
42
|
+
class="ucl-uikit-spinner css-1izyex6"
|
|
95
43
|
data-testid="ucl-uikit-spinner"
|
|
96
44
|
height="24"
|
|
97
45
|
viewBox="0 0 50 50"
|
|
98
46
|
width="24"
|
|
99
47
|
>
|
|
100
48
|
<g
|
|
101
|
-
class="css-
|
|
49
|
+
class="css-ypv7tf"
|
|
102
50
|
>
|
|
103
51
|
<circle
|
|
104
|
-
class="css-
|
|
52
|
+
class="css-1w5ipzg"
|
|
105
53
|
cx="25"
|
|
106
54
|
cy="25"
|
|
107
55
|
fill="none"
|
|
@@ -117,7 +65,7 @@ exports[`Button > snapshot: loading 1`] = `
|
|
|
117
65
|
exports[`Button > snapshot: no props 1`] = `
|
|
118
66
|
<button
|
|
119
67
|
aria-disabled="false"
|
|
120
|
-
class="ucl-uikit-button css-
|
|
68
|
+
class="ucl-uikit-button css-12at99t"
|
|
121
69
|
data-testid="ucl-uikit-button"
|
|
122
70
|
/>
|
|
123
71
|
`;
|
|
@@ -125,7 +73,7 @@ exports[`Button > snapshot: no props 1`] = `
|
|
|
125
73
|
exports[`Button > snapshot: testId prop 1`] = `
|
|
126
74
|
<button
|
|
127
75
|
aria-disabled="false"
|
|
128
|
-
class="ucl-uikit-button css-
|
|
76
|
+
class="ucl-uikit-button css-12at99t"
|
|
129
77
|
data-testid="test123"
|
|
130
78
|
/>
|
|
131
79
|
`;
|
|
@@ -133,7 +81,66 @@ exports[`Button > snapshot: testId prop 1`] = `
|
|
|
133
81
|
exports[`Button > snapshot: variant prop 1`] = `
|
|
134
82
|
<button
|
|
135
83
|
aria-disabled="false"
|
|
136
|
-
class="ucl-uikit-button css-
|
|
84
|
+
class="ucl-uikit-button css-9dplwk"
|
|
137
85
|
data-testid="ucl-uikit-button"
|
|
138
86
|
/>
|
|
139
87
|
`;
|
|
88
|
+
|
|
89
|
+
exports[`Button > snapshot: with icon 1`] = `
|
|
90
|
+
<button
|
|
91
|
+
aria-disabled="false"
|
|
92
|
+
class="ucl-uikit-button css-oqr4zz"
|
|
93
|
+
data-testid="ucl-uikit-button"
|
|
94
|
+
>
|
|
95
|
+
<svg
|
|
96
|
+
class="ucl-uikit-icon css-148hpxb"
|
|
97
|
+
data-testid="ucl-uikit-icon"
|
|
98
|
+
fill="none"
|
|
99
|
+
focusable="false"
|
|
100
|
+
height="24"
|
|
101
|
+
stroke="currentColor"
|
|
102
|
+
stroke-linecap="round"
|
|
103
|
+
stroke-linejoin="round"
|
|
104
|
+
stroke-width="2"
|
|
105
|
+
viewBox="0 0 24 24"
|
|
106
|
+
width="24"
|
|
107
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
108
|
+
>
|
|
109
|
+
<path
|
|
110
|
+
d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4m14-7-5-5-5 5m5-5v12"
|
|
111
|
+
/>
|
|
112
|
+
</svg>
|
|
113
|
+
Upload
|
|
114
|
+
</button>
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
exports[`Button > snapshot: with icon and iconPosition right 1`] = `
|
|
118
|
+
<button
|
|
119
|
+
aria-disabled="false"
|
|
120
|
+
class="ucl-uikit-button css-oqr4zz"
|
|
121
|
+
data-testid="ucl-uikit-button"
|
|
122
|
+
>
|
|
123
|
+
Download
|
|
124
|
+
<svg
|
|
125
|
+
class="ucl-uikit-icon css-148hpxb"
|
|
126
|
+
data-testid="ucl-uikit-icon"
|
|
127
|
+
fill="none"
|
|
128
|
+
focusable="false"
|
|
129
|
+
height="24"
|
|
130
|
+
stroke="currentColor"
|
|
131
|
+
stroke-linecap="round"
|
|
132
|
+
stroke-linejoin="round"
|
|
133
|
+
stroke-width="2"
|
|
134
|
+
viewBox="0 0 24 24"
|
|
135
|
+
width="24"
|
|
136
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
137
|
+
>
|
|
138
|
+
<path
|
|
139
|
+
d="m8 17 4 4 4-4m-4-5v9"
|
|
140
|
+
/>
|
|
141
|
+
<path
|
|
142
|
+
d="M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"
|
|
143
|
+
/>
|
|
144
|
+
</svg>
|
|
145
|
+
</button>
|
|
146
|
+
`;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { css, cx } from '@emotion/css';
|
|
2
|
+
import { ThemeType } from '../../../theme';
|
|
3
|
+
import { ButtonBaseProps } from '../Button';
|
|
4
|
+
|
|
5
|
+
const buttonAccentStyle = (
|
|
6
|
+
theme: ThemeType,
|
|
7
|
+
selected: ButtonBaseProps['selected'],
|
|
8
|
+
disabled: ButtonBaseProps['disabled'],
|
|
9
|
+
loading: ButtonBaseProps['loading']
|
|
10
|
+
) => {
|
|
11
|
+
const {
|
|
12
|
+
colour: { fill },
|
|
13
|
+
} = theme;
|
|
14
|
+
|
|
15
|
+
const bgColour = fill.brand;
|
|
16
|
+
const bgHoverColour = fill.brandHover;
|
|
17
|
+
const bgActiveColour = fill.brandPressed;
|
|
18
|
+
|
|
19
|
+
const baseStyle = css`
|
|
20
|
+
background-color: ${bgColour};
|
|
21
|
+
color: ${theme.colour.text.brandInverse};
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const selectedStyle = css`
|
|
25
|
+
background-color: ${bgHoverColour};
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const interactiveStyle = css`
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
background-color: ${bgHoverColour};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:active {
|
|
36
|
+
background-color: ${bgActiveColour};
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const disabledStyle = css`
|
|
41
|
+
background-color: ${theme.colour.fill.disabled};
|
|
42
|
+
color: ${theme.colour.text.onBgFillDisabled};
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
return cx(
|
|
46
|
+
baseStyle,
|
|
47
|
+
selected && selectedStyle,
|
|
48
|
+
!disabled && !loading && interactiveStyle,
|
|
49
|
+
disabled && disabledStyle
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default buttonAccentStyle;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { css, cx } from '@emotion/css';
|
|
2
|
+
import { ThemeType } from '../../../theme';
|
|
3
|
+
import { ButtonBaseProps } from '../Button';
|
|
4
|
+
|
|
5
|
+
const buttonPrimaryDestructiveStyle = (
|
|
6
|
+
theme: ThemeType,
|
|
7
|
+
selected: ButtonBaseProps['selected'],
|
|
8
|
+
disabled: ButtonBaseProps['disabled'],
|
|
9
|
+
loading: ButtonBaseProps['loading']
|
|
10
|
+
) => {
|
|
11
|
+
const {
|
|
12
|
+
colour: { fill },
|
|
13
|
+
} = theme;
|
|
14
|
+
|
|
15
|
+
const bgColour = fill.critical;
|
|
16
|
+
const bgHoverColour = fill.criticalHover;
|
|
17
|
+
const bgActiveColour = fill.criticalPressed;
|
|
18
|
+
const bgSelectedColour = fill.criticalHover;
|
|
19
|
+
|
|
20
|
+
const baseStyle = css`
|
|
21
|
+
background-color: ${bgColour};
|
|
22
|
+
color: ${theme.colour.text.brandInverse};
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const selectedStyle = css`
|
|
26
|
+
background-color: ${bgSelectedColour};
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
const interactiveStyle = css`
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
|
|
32
|
+
&:hover {
|
|
33
|
+
background-color: ${bgHoverColour};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:active {
|
|
37
|
+
background-color: ${bgActiveColour};
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
const disabledStyle = css`
|
|
42
|
+
border-color: ${theme.colour.fill.disabled};
|
|
43
|
+
background-color: ${theme.colour.fill.disabled};
|
|
44
|
+
color: ${theme.colour.text.onBgFillDisabled};
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
return cx(
|
|
48
|
+
baseStyle,
|
|
49
|
+
selected && selectedStyle,
|
|
50
|
+
!disabled && !loading && interactiveStyle,
|
|
51
|
+
disabled && disabledStyle
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default buttonPrimaryDestructiveStyle;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { css, cx } from '@emotion/css';
|
|
2
|
+
import { ThemeType } from '../../../theme';
|
|
3
|
+
import { ButtonBaseProps } from '../Button';
|
|
4
|
+
|
|
5
|
+
const buttonPrimaryStyle = (
|
|
6
|
+
theme: ThemeType,
|
|
7
|
+
selected: ButtonBaseProps['selected'],
|
|
8
|
+
disabled: ButtonBaseProps['disabled'],
|
|
9
|
+
loading: ButtonBaseProps['loading']
|
|
10
|
+
) => {
|
|
11
|
+
const {
|
|
12
|
+
colour: { fill },
|
|
13
|
+
} = theme;
|
|
14
|
+
|
|
15
|
+
const bgColour = fill.brandPrimary;
|
|
16
|
+
const bgHoverColour = fill.brandHover;
|
|
17
|
+
const bgActiveColour = fill.brandPressed;
|
|
18
|
+
|
|
19
|
+
const baseStyle = css`
|
|
20
|
+
background-color: ${bgColour};
|
|
21
|
+
color: ${theme.colour.text.brandInverse};
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const selectedStyle = css`
|
|
25
|
+
background-color: ${bgHoverColour};
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const interactiveStyle = css`
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
background-color: ${bgHoverColour};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:active {
|
|
36
|
+
background-color: ${bgActiveColour};
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const disabledStyle = css`
|
|
41
|
+
background-color: ${theme.colour.fill.disabled};
|
|
42
|
+
color: ${theme.colour.text.onBgFillDisabled};
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
return cx(
|
|
46
|
+
baseStyle,
|
|
47
|
+
selected && selectedStyle,
|
|
48
|
+
!disabled && !loading && interactiveStyle,
|
|
49
|
+
disabled && disabledStyle
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default buttonPrimaryStyle;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { css, cx } from '@emotion/css';
|
|
2
|
+
import { ThemeType } from '../../../theme';
|
|
3
|
+
import { ButtonBaseProps } from '../Button';
|
|
4
|
+
|
|
5
|
+
const buttonPrimarySubtleStyle = (
|
|
6
|
+
theme: ThemeType,
|
|
7
|
+
selected: ButtonBaseProps['selected'],
|
|
8
|
+
disabled: ButtonBaseProps['disabled'],
|
|
9
|
+
loading: ButtonBaseProps['loading'],
|
|
10
|
+
paddingPx: number
|
|
11
|
+
) => {
|
|
12
|
+
const {
|
|
13
|
+
colour: { border, fill, text },
|
|
14
|
+
} = theme;
|
|
15
|
+
|
|
16
|
+
const bgColour = fill.inverse;
|
|
17
|
+
const borderColour = border.subtle;
|
|
18
|
+
const bgHoverColour = fill.hover;
|
|
19
|
+
const bgActiveColour = fill.hover;
|
|
20
|
+
const selectedFillColour = fill.brandSubtleHover;
|
|
21
|
+
const selectedBorderColour = border.brand;
|
|
22
|
+
const selectedTextColour = text.brandHover;
|
|
23
|
+
|
|
24
|
+
const adjustedPaddingPx = paddingPx + 1;
|
|
25
|
+
|
|
26
|
+
const baseStyle = css`
|
|
27
|
+
background-color: ${bgColour};
|
|
28
|
+
border: 1px solid ${borderColour};
|
|
29
|
+
color: ${theme.colour.text.default};
|
|
30
|
+
padding: 0 ${adjustedPaddingPx}px;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const selectedStyle = css`
|
|
34
|
+
background-color: ${selectedFillColour};
|
|
35
|
+
border-color: ${selectedBorderColour};
|
|
36
|
+
color: ${selectedTextColour};
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
const interactiveStyle = css`
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
background-color: ${bgHoverColour};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:active {
|
|
47
|
+
background-color: ${bgActiveColour};
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const disabledStyle = css`
|
|
52
|
+
border-color: ${border.disabled};
|
|
53
|
+
color: ${text.disabled};
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
return cx(
|
|
57
|
+
baseStyle,
|
|
58
|
+
selected && selectedStyle,
|
|
59
|
+
!selected && !disabled && !loading && interactiveStyle,
|
|
60
|
+
disabled && disabledStyle
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default buttonPrimarySubtleStyle;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { css, cx } from '@emotion/css';
|
|
2
|
+
import { ThemeType } from '../../../theme';
|
|
3
|
+
import { ButtonBaseProps } from '../Button';
|
|
4
|
+
|
|
5
|
+
const buttonPrimaryWarningStyle = (
|
|
6
|
+
theme: ThemeType,
|
|
7
|
+
selected: ButtonBaseProps['selected'],
|
|
8
|
+
disabled: ButtonBaseProps['disabled'],
|
|
9
|
+
loading: ButtonBaseProps['loading']
|
|
10
|
+
) => {
|
|
11
|
+
const {
|
|
12
|
+
colour: { fill, text },
|
|
13
|
+
} = theme;
|
|
14
|
+
|
|
15
|
+
const textColour = text.default;
|
|
16
|
+
const bgColour = fill.warning;
|
|
17
|
+
const bgHoverColour = fill.warningHover;
|
|
18
|
+
const bgActiveColour = fill.warningPressed;
|
|
19
|
+
const selectedBgColour = fill.warningSelected;
|
|
20
|
+
|
|
21
|
+
const baseStyle = css`
|
|
22
|
+
background-color: ${bgColour};
|
|
23
|
+
color: ${textColour};
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
const selectedStyle = css`
|
|
27
|
+
background-color: ${selectedBgColour};
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const interactiveStyle = css`
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
|
|
33
|
+
&:hover {
|
|
34
|
+
background-color: ${bgHoverColour};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:active {
|
|
38
|
+
background-color: ${bgActiveColour};
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
const disabledStyle = css`
|
|
43
|
+
border-color: ${theme.colour.fill.disabled};
|
|
44
|
+
background-color: ${theme.colour.fill.disabled};
|
|
45
|
+
color: ${theme.colour.text.onBgFillDisabled};
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
return cx(
|
|
49
|
+
baseStyle,
|
|
50
|
+
selected && selectedStyle,
|
|
51
|
+
!disabled && !loading && interactiveStyle,
|
|
52
|
+
disabled && disabledStyle
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default buttonPrimaryWarningStyle;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { css, cx } from '@emotion/css';
|
|
2
|
+
import { ThemeType } from '../../../theme';
|
|
3
|
+
import { ButtonBaseProps } from '../Button';
|
|
4
|
+
|
|
5
|
+
const buttonSecondaryDestructiveStyle = (
|
|
6
|
+
theme: ThemeType,
|
|
7
|
+
selected: ButtonBaseProps['selected'],
|
|
8
|
+
disabled: ButtonBaseProps['disabled'],
|
|
9
|
+
loading: ButtonBaseProps['loading']
|
|
10
|
+
) => {
|
|
11
|
+
const {
|
|
12
|
+
colour: { border, fill, text },
|
|
13
|
+
} = theme;
|
|
14
|
+
|
|
15
|
+
const textColour = text.critical;
|
|
16
|
+
const borderColour = border.critical;
|
|
17
|
+
const hoverTextColour = text.inverse;
|
|
18
|
+
const hoverFillColour = fill.criticalHover;
|
|
19
|
+
const activeTextColour = text.inverse;
|
|
20
|
+
const activeFillColour = fill.criticalPressed;
|
|
21
|
+
|
|
22
|
+
const baseStyle = css`
|
|
23
|
+
background-color: ${theme.colour.fill.inverse};
|
|
24
|
+
color: ${textColour};
|
|
25
|
+
border-color: ${borderColour};
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const selectedStyle = css`
|
|
29
|
+
background-color: ${fill.criticalSelected};
|
|
30
|
+
color: ${text.inverse};
|
|
31
|
+
border-color: transparent;
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
const interactiveStyle = css`
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
background-color: ${hoverFillColour};
|
|
39
|
+
border-color: ${hoverFillColour};
|
|
40
|
+
color: ${hoverTextColour};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:active {
|
|
44
|
+
background-color: ${activeFillColour};
|
|
45
|
+
color: ${activeTextColour};
|
|
46
|
+
border-color: ${activeFillColour};
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
const disabledStyle = css`
|
|
51
|
+
border-color: ${theme.colour.border.disabled};
|
|
52
|
+
color: ${theme.colour.text.disabled};
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
return cx(
|
|
56
|
+
baseStyle,
|
|
57
|
+
selected && selectedStyle,
|
|
58
|
+
!disabled && !loading && interactiveStyle,
|
|
59
|
+
disabled && disabledStyle
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default buttonSecondaryDestructiveStyle;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { css, cx } from '@emotion/css';
|
|
2
|
+
import { ThemeType } from '../../../theme';
|
|
3
|
+
import { ButtonBaseProps } from '../Button';
|
|
4
|
+
|
|
5
|
+
const buttonSecondaryStyle = (
|
|
6
|
+
theme: ThemeType,
|
|
7
|
+
selected: ButtonBaseProps['selected'],
|
|
8
|
+
disabled: ButtonBaseProps['disabled'],
|
|
9
|
+
loading: ButtonBaseProps['loading']
|
|
10
|
+
) => {
|
|
11
|
+
const {
|
|
12
|
+
colour: { border, fill, text },
|
|
13
|
+
} = theme;
|
|
14
|
+
|
|
15
|
+
const textColour = text.brand;
|
|
16
|
+
const borderColour = border.brand;
|
|
17
|
+
const hoverTextColour = text.inverse;
|
|
18
|
+
const hoverFillColour = fill.brandHover;
|
|
19
|
+
const activeTextColour = text.inverse;
|
|
20
|
+
const activeFillColour = fill.brandPressed;
|
|
21
|
+
|
|
22
|
+
const baseStyle = css`
|
|
23
|
+
background-color: ${theme.colour.fill.inverse};
|
|
24
|
+
color: ${textColour};
|
|
25
|
+
border-color: ${borderColour};
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const selectedStyle = css`
|
|
29
|
+
background-color: ${theme.colour.fill.brandSubtleSelected};
|
|
30
|
+
border-color: ${borderColour};
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const interactiveStyle = css`
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
|
|
36
|
+
&:hover {
|
|
37
|
+
background-color: ${hoverFillColour};
|
|
38
|
+
border-color: ${hoverFillColour};
|
|
39
|
+
color: ${hoverTextColour};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:active {
|
|
43
|
+
background-color: ${activeFillColour};
|
|
44
|
+
color: ${activeTextColour};
|
|
45
|
+
border-color: ${activeFillColour};
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
const disabledStyle = css`
|
|
50
|
+
border-color: ${theme.colour.border.disabled};
|
|
51
|
+
color: ${theme.colour.text.disabled};
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
return cx(
|
|
55
|
+
baseStyle,
|
|
56
|
+
selected && selectedStyle,
|
|
57
|
+
!disabled && !loading && interactiveStyle,
|
|
58
|
+
disabled && disabledStyle
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default buttonSecondaryStyle;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { css, cx } from '@emotion/css';
|
|
2
|
+
import { ThemeType } from '../../../theme';
|
|
3
|
+
import { ButtonBaseProps } from '../Button';
|
|
4
|
+
|
|
5
|
+
const buttonSecondarySubtleStyle = (
|
|
6
|
+
theme: ThemeType,
|
|
7
|
+
selected: ButtonBaseProps['selected'],
|
|
8
|
+
disabled: ButtonBaseProps['disabled'],
|
|
9
|
+
loading: ButtonBaseProps['loading'],
|
|
10
|
+
paddingPx: number
|
|
11
|
+
) => {
|
|
12
|
+
const {
|
|
13
|
+
colour: { border, fill, text },
|
|
14
|
+
} = theme;
|
|
15
|
+
|
|
16
|
+
const textColour = text.brand;
|
|
17
|
+
const borderColour = border.subtle;
|
|
18
|
+
const hoverTextColour = text.brandHover;
|
|
19
|
+
const hoverFillColour = fill.brandSubtleHover;
|
|
20
|
+
const hoverBorderColour = border.brandSubtle;
|
|
21
|
+
const activeTextColour = text.brandHover;
|
|
22
|
+
const activeFillColour = fill.brandSubtleHover;
|
|
23
|
+
const activeBorderColour = border.brandSubtle;
|
|
24
|
+
const selectedFillColour = fill.brandSubtleHover;
|
|
25
|
+
const selectedBorderColour = border.brand;
|
|
26
|
+
const selectedTextColour = text.brandHover;
|
|
27
|
+
|
|
28
|
+
const adjustedPaddingPx = paddingPx + 1;
|
|
29
|
+
|
|
30
|
+
const baseStyle = css`
|
|
31
|
+
background-color: ${theme.color.neutral.white};
|
|
32
|
+
color: ${textColour};
|
|
33
|
+
border: ${theme.border.b1} solid ${borderColour};
|
|
34
|
+
padding: 0 ${adjustedPaddingPx}px;
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const selectedStyle = css`
|
|
38
|
+
background-color: ${selectedFillColour};
|
|
39
|
+
border-color: ${selectedBorderColour};
|
|
40
|
+
color: ${selectedTextColour};
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
const interactiveStyle = css`
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
background-color: ${hoverFillColour};
|
|
48
|
+
border-color: ${hoverBorderColour};
|
|
49
|
+
color: ${hoverTextColour};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:active {
|
|
53
|
+
background-color: ${activeFillColour};
|
|
54
|
+
color: ${activeTextColour};
|
|
55
|
+
border-color: ${activeBorderColour};
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
const disabledStyle = css`
|
|
60
|
+
border-color: ${border.disabled};
|
|
61
|
+
color: ${text.disabled};
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
return cx(
|
|
65
|
+
baseStyle,
|
|
66
|
+
selected && selectedStyle,
|
|
67
|
+
!selected && !disabled && !loading && interactiveStyle,
|
|
68
|
+
disabled && disabledStyle
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default buttonSecondarySubtleStyle;
|