@uob-web-and-digital/component-library 0.0.42 → 0.0.44

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.
Files changed (27) hide show
  1. package/dist/components/atoms/IconButton/IconButton.stories.d.ts +2 -0
  2. package/dist/components/atoms/IconButton/defaultProps.d.ts +1 -0
  3. package/dist/components/molecules/CardPromoVideo/CardPromoVideo.d.ts +2 -3
  4. package/dist/components/molecules/CardPromoVideo/CardPromoVideo.stories.d.ts +4 -2
  5. package/dist/components/molecules/ShareButtons/ShareButtons.d.ts +11 -0
  6. package/dist/components/molecules/ShareButtons/ShareButtons.stories.d.ts +11 -0
  7. package/dist/components/molecules/ShareButtons/defaultProps.d.ts +2 -0
  8. package/dist/components/molecules/Tab/Tab.d.ts +4 -4
  9. package/dist/components/organisms/Carousel/Carousel.d.ts +2 -1
  10. package/dist/components/organisms/HeroArticle/HeroArticle.d.ts +20 -0
  11. package/dist/components/organisms/HeroArticle/HeroArticle.stories.d.ts +10 -0
  12. package/dist/components/organisms/HeroArticle/defaultProps.d.ts +2 -0
  13. package/dist/components/organisms/LeadNewsArticles/LeadNewsArticles.d.ts +3 -1
  14. package/dist/components/organisms/NewsArticlesPromoBlock/NewsArticlesPromoBlock.d.ts +4 -2
  15. package/dist/components/organisms/NewsArticlesPromoBlock/NewsArticlesPromoBlock.stories.d.ts +2 -1
  16. package/dist/components/organisms/NewsArticlesPromoBlock/defaultProps.d.ts +1 -0
  17. package/dist/components/organisms/RelatedCourses/RelatedCourses.d.ts +2 -1
  18. package/dist/components/organisms/RichText/defaultProps.d.ts +2 -0
  19. package/dist/components/organisms/SingleButton/SingleButton.d.ts +12 -0
  20. package/dist/components/organisms/SingleButton/SingleButton.stories.d.ts +13 -0
  21. package/dist/components/organisms/SingleButton/defaultProps.d.ts +2 -0
  22. package/dist/components/organisms/StaffListingCarousel/defaultProps.d.ts +1 -0
  23. package/dist/index.d.ts +87 -22
  24. package/dist/main.css +1 -1
  25. package/dist/main.js +5 -5
  26. package/dist/module.js +5 -5
  27. package/package.json +1 -1
@@ -25,3 +25,5 @@ export declare const ArrowRightDark: Story;
25
25
  export declare const ArrowRightLight: Story;
26
26
  export declare const ArrowLeftDark: Story;
27
27
  export declare const ArrowLeftLight: Story;
28
+ export declare const EmailDark: Story;
29
+ export declare const EmailLight: Story;
@@ -9,3 +9,4 @@ export declare const LinkedInProps: IconButtonProps;
9
9
  export declare const ArrowLeftProps: IconButtonProps;
10
10
  export declare const ArrowRightProps: IconButtonProps;
11
11
  export declare const HamburgerProps: IconButtonProps;
12
+ export declare const EmailProps: IconButtonProps;
@@ -1,21 +1,20 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ImageProps } from '../../atoms/Image/Image';
3
3
  import { ThemeProps } from '../../../themeProps';
4
- import { ParagraphLinkProps } from '../../atoms/ParagraphLink/ParagraphLink';
5
4
  import './cardPromoVideo.scss';
6
5
  export interface CardPromoVideoProps {
7
6
  theme: ThemeProps;
8
7
  inverse?: boolean;
9
8
  image?: ImageProps;
10
9
  title: string;
10
+ href: string;
11
11
  publishDate?: string;
12
12
  videoLength?: string;
13
13
  copy?: string;
14
14
  isSingle?: boolean;
15
- link?: ParagraphLinkProps;
16
15
  titleTag: 'h2' | 'h3';
17
16
  }
18
17
  /**
19
18
  * Primary UI component for user interaction
20
19
  */
21
- export default function CardPromoVideo({ theme, inverse, image, title, publishDate, videoLength, copy, isSingle, link, titleTag }: CardPromoVideoProps): ReactElement;
20
+ export default function CardPromoVideo({ theme, inverse, image, title, publishDate, videoLength, copy, isSingle, href, titleTag }: CardPromoVideoProps): ReactElement;
@@ -10,5 +10,7 @@ declare const meta: {
10
10
  };
11
11
  export default meta;
12
12
  type Story = StoryObj<typeof CardPromoVideo>;
13
- export declare const SinglePromoVideoCard: Story;
14
- export declare const OneOfManyPromoVideoCards: Story;
13
+ export declare const SinglePromoVideoCardDark: Story;
14
+ export declare const SinglePromoVideoCardLight: Story;
15
+ export declare const OneOfManyPromoVideoCardsDark: Story;
16
+ export declare const OneOfManyPromoVideoCardsLight: Story;
@@ -0,0 +1,11 @@
1
+ import { ReactElement } from 'react';
2
+ import { ThemeProps } from '../../../themeProps';
3
+ import { IconButtonProps } from '../../atoms/IconButton/IconButton';
4
+ import './shareButtons.scss';
5
+ export interface ShareButtonsProps {
6
+ theme: ThemeProps;
7
+ inverse?: boolean;
8
+ label?: string;
9
+ icons: IconButtonProps[];
10
+ }
11
+ export default function ShareButtons({ theme, inverse, label, icons }: ShareButtonsProps): ReactElement;
@@ -0,0 +1,11 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import ShareButtons from './ShareButtons';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof ShareButtons;
6
+ tags: string[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const ExampleLight: Story;
11
+ export declare const ExampleDark: Story;
@@ -0,0 +1,2 @@
1
+ import { ShareButtonsProps } from './ShareButtons';
2
+ export declare const shareButtonsProps: ShareButtonsProps;
@@ -31,12 +31,12 @@ export interface TabProps {
31
31
  */
32
32
  tabListTopRef: React.MutableRefObject<HTMLDivElement | null>;
33
33
  /**
34
- * The method to set the active tab
34
+ * The method to handle a mouse click on the tab
35
35
  */
36
- setActiveTab: (id: number) => void;
36
+ handleClick: (event: React.MouseEvent, activeTabId: number) => void;
37
37
  /**
38
38
  * The method to handle keyboard navigation events
39
39
  */
40
- onKeyboardNavigation: (e: KeyboardEvent) => void;
40
+ handleKeyboardNavigation: (e: KeyboardEvent) => void;
41
41
  }
42
- export default function Tab({ id, theme, inverse, tabItem, isActive, hasFocus, setActiveTab, onKeyboardNavigation: onKeyboardNavigation }: TabProps): ReactElement | null;
42
+ export default function Tab({ id, theme, inverse, tabItem, isActive, hasFocus, handleClick, handleKeyboardNavigation: handleKeyboardNavigation }: TabProps): ReactElement | null;
@@ -17,7 +17,8 @@ export interface CarouselProps {
17
17
  type: string;
18
18
  title?: string;
19
19
  useH3ForCards?: boolean;
20
+ setCardInverse?: 'dark' | 'light';
20
21
  cards: Omit<CardNewsProps, 'titleTag'>[] | CardFeaturedProps[] | CardVideoProps[] | CardPromoProps[] | CardPromoSignpostProps[] | CardPromoVideoProps[] | CardStaffProps[] | CardRelatedProps[] | CardImageProps[] | CardFeaturedNewsProps[];
21
22
  exploreMore?: string;
22
23
  }
23
- export default function Carousel({ theme, inverse, type, title, cards, useH3ForCards, exploreMore }: CarouselProps): ReactElement;
24
+ export default function Carousel({ theme, inverse, type, title, cards, useH3ForCards, setCardInverse, exploreMore }: CarouselProps): ReactElement;
@@ -0,0 +1,20 @@
1
+ import { ReactElement } from 'react';
2
+ import { ThemeProps } from '../../../themeProps';
3
+ import { ImageProps } from '../../atoms/Image/Image';
4
+ import { ShareButtonsProps } from '../../molecules/ShareButtons/ShareButtons';
5
+ import './heroArticle.scss';
6
+ export interface HeroArticleProps {
7
+ /**
8
+ * The theme to use
9
+ */
10
+ theme: ThemeProps;
11
+ inverse?: boolean;
12
+ title: string;
13
+ titleTag?: 'h1' | 'h2' | 'h3' | 'h4';
14
+ description: string;
15
+ image: ImageProps;
16
+ publishDate: string;
17
+ readTime?: string;
18
+ shareButtons: ShareButtonsProps;
19
+ }
20
+ export default function HeroArticle({ theme, inverse, title, titleTag, description, image, publishDate, readTime, shareButtons }: HeroArticleProps): ReactElement | null;
@@ -0,0 +1,10 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import HeroArticle from './HeroArticle';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof HeroArticle;
6
+ tags: string[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof HeroArticle>;
10
+ export declare const Example: Story;
@@ -0,0 +1,2 @@
1
+ import { HeroArticleProps } from './HeroArticle';
2
+ export declare const heroArticleProps: HeroArticleProps;
@@ -1,10 +1,12 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ThemeProps } from '../../../themeProps';
3
3
  import { CardFeaturedNewsProps } from '../../molecules/CardFeaturedNews/CardFeaturedNews';
4
+ import { MostReadNewsProps } from '../../molecules/MostReadNews/MostReadNews';
4
5
  import './leadNewsArticles.scss';
5
6
  export interface LeadNewsArticlesProps {
6
7
  theme: ThemeProps;
7
8
  featuredArticle: CardFeaturedNewsProps;
8
9
  otherLeadArticles: Omit<CardFeaturedNewsProps, 'theme'>[];
10
+ mostReadNews: MostReadNewsProps;
9
11
  }
10
- export default function LeadNewsArticles({ theme, featuredArticle, otherLeadArticles }: LeadNewsArticlesProps): ReactElement;
12
+ export default function LeadNewsArticles({ theme, featuredArticle, otherLeadArticles, mostReadNews }: LeadNewsArticlesProps): ReactElement;
@@ -1,10 +1,12 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ThemeProps } from '../../../themeProps';
3
3
  import { CardFeaturedNewsProps } from '../../molecules/CardFeaturedNews/CardFeaturedNews';
4
+ import { CardPromoVideoProps } from '../../molecules/CardPromoVideo/CardPromoVideo';
4
5
  import './newsArticlesPromoBlock.scss';
5
6
  export interface NewsArticlesPromoBlockProps {
6
7
  theme: ThemeProps;
7
8
  heading: string;
8
- cards: CardFeaturedNewsProps[];
9
+ cards: CardFeaturedNewsProps[] | CardPromoVideoProps[];
10
+ cardType?: 'featured-news' | 'promo-video';
9
11
  }
10
- export default function NewsArticlesPromoBlock({ theme, heading, cards }: NewsArticlesPromoBlockProps): ReactElement;
12
+ export default function NewsArticlesPromoBlock({ theme, heading, cards, cardType }: NewsArticlesPromoBlockProps): ReactElement;
@@ -7,4 +7,5 @@ declare const meta: {
7
7
  };
8
8
  export default meta;
9
9
  type Story = StoryObj<typeof meta>;
10
- export declare const Example: Story;
10
+ export declare const FeaturedNewsExample: Story;
11
+ export declare const VideoCardExample: Story;
@@ -1,2 +1,3 @@
1
1
  import { NewsArticlesPromoBlockProps } from './NewsArticlesPromoBlock';
2
2
  export declare const newsArticlesPromoBlockProps: NewsArticlesPromoBlockProps;
3
+ export declare const videoNewsArticlesPromoBlockProps: NewsArticlesPromoBlockProps;
@@ -6,6 +6,7 @@ export interface RelatedCoursesProps {
6
6
  theme: ThemeProps;
7
7
  inverse?: boolean;
8
8
  heading: string;
9
+ fullWidth?: boolean;
9
10
  cards: CardRelatedProps[];
10
11
  }
11
- export default function RelatedCourses({ theme, inverse, heading, cards }: RelatedCoursesProps): ReactElement;
12
+ export default function RelatedCourses({ theme, inverse, heading, fullWidth, cards }: RelatedCoursesProps): ReactElement;
@@ -1,2 +1,4 @@
1
1
  import { RichTextProps } from './RichText';
2
2
  export declare const richTextProps: RichTextProps;
3
+ export declare const newsArticleRichText: RichTextProps;
4
+ export declare const newsArticleRichTextBullets: RichTextProps;
@@ -0,0 +1,12 @@
1
+ import { ReactElement } from 'react';
2
+ import { ThemeProps } from '../../../themeProps';
3
+ import { TextButtonWithIconProps } from '../../atoms/TextButtonWithIcon/TextButtonWithIcon';
4
+ import { TextButtonProps } from '../../atoms/TextButton/TextButton';
5
+ import './singleButton.scss';
6
+ export interface SingleButtonProps {
7
+ theme: ThemeProps;
8
+ inverse?: boolean;
9
+ includeIcon: boolean;
10
+ link: TextButtonWithIconProps | TextButtonProps;
11
+ }
12
+ export default function SingleButton({ theme, inverse, includeIcon, link }: SingleButtonProps): ReactElement;
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import SingleButton from './SingleButton';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof SingleButton;
6
+ tags: string[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const DarkWithIcon: Story;
11
+ export declare const LightWithIcon: Story;
12
+ export declare const DarkNoIcon: Story;
13
+ export declare const LightNoIcon: Story;
@@ -0,0 +1,2 @@
1
+ import { SingleButtonProps } from './SingleButton';
2
+ export declare const singleButtonProps: SingleButtonProps;
@@ -1,2 +1,3 @@
1
1
  import { StaffListingCarouselProps } from './StaffListingCarousel';
2
2
  export declare const staffListingCarouselProps: StaffListingCarouselProps;
3
+ export declare const newsStaffListingCarouselProps: StaffListingCarouselProps;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React, { KeyboardEvent, ReactElement, PropsWithChildren, MouseEventHandler, ChangeEvent } from 'react';
1
+ import React, { KeyboardEvent, ReactElement, PropsWithChildren, MouseEventHandler, ChangeEvent, ReactNode } from 'react';
2
2
 
3
3
  type ImageProps = {
4
4
  src: {
@@ -136,30 +136,16 @@ interface CardPromoSignpostProps {
136
136
  titleTag: 'h2' | 'h3';
137
137
  }
138
138
 
139
- interface ParagraphLinkProps {
140
- /**
141
- * The theme to use
142
- */
143
- theme: ThemeProps;
144
- /**
145
- * Whether to inverse the colours
146
- */
147
- inverse?: boolean;
148
- label: string;
149
- url: string;
150
- externalLink?: boolean;
151
- }
152
-
153
139
  interface CardPromoVideoProps {
154
140
  theme: ThemeProps;
155
141
  inverse?: boolean;
156
142
  image?: ImageProps;
157
143
  title: string;
144
+ href: string;
158
145
  publishDate?: string;
159
146
  videoLength?: string;
160
147
  copy?: string;
161
148
  isSingle?: boolean;
162
- link?: ParagraphLinkProps;
163
149
  titleTag: 'h2' | 'h3';
164
150
  }
165
151
 
@@ -217,10 +203,11 @@ interface CarouselProps {
217
203
  type: string;
218
204
  title?: string;
219
205
  useH3ForCards?: boolean;
206
+ setCardInverse?: 'dark' | 'light';
220
207
  cards: Omit<CardNewsProps, 'titleTag'>[] | CardFeaturedProps[] | CardVideoProps[] | CardPromoProps[] | CardPromoSignpostProps[] | CardPromoVideoProps[] | CardStaffProps[] | CardRelatedProps[] | CardImageProps[] | CardFeaturedNewsProps[];
221
208
  exploreMore?: string;
222
209
  }
223
- declare function Carousel({ theme, inverse, type, title, cards, useH3ForCards, exploreMore }: CarouselProps): ReactElement;
210
+ declare function Carousel({ theme, inverse, type, title, cards, useH3ForCards, setCardInverse, exploreMore }: CarouselProps): ReactElement;
224
211
 
225
212
  interface FeaturedContentProps {
226
213
  /**
@@ -673,6 +660,20 @@ interface CTAComponentProps {
673
660
  }
674
661
  declare function CTAComponent({ theme, inverse, highlight, image, heading, copy, primaryCTA, secondaryCTA, link, fullWidth }: CTAComponentProps): ReactElement;
675
662
 
663
+ interface ParagraphLinkProps {
664
+ /**
665
+ * The theme to use
666
+ */
667
+ theme: ThemeProps;
668
+ /**
669
+ * Whether to inverse the colours
670
+ */
671
+ inverse?: boolean;
672
+ label: string;
673
+ url: string;
674
+ externalLink?: boolean;
675
+ }
676
+
676
677
  interface TextButtonWithIconProps {
677
678
  /**
678
679
  * The theme to use
@@ -857,9 +858,10 @@ interface RelatedCoursesProps {
857
858
  theme: ThemeProps;
858
859
  inverse?: boolean;
859
860
  heading: string;
861
+ fullWidth?: boolean;
860
862
  cards: CardRelatedProps[];
861
863
  }
862
- declare function RelatedCourses({ theme, inverse, heading, cards }: RelatedCoursesProps): ReactElement;
864
+ declare function RelatedCourses({ theme, inverse, heading, fullWidth, cards }: RelatedCoursesProps): ReactElement;
863
865
 
864
866
  interface AccomodationCardProps {
865
867
  theme: ThemeProps;
@@ -1048,12 +1050,20 @@ interface TopicSelectorProps {
1048
1050
  }
1049
1051
  declare function TopicSelector({ topics, theme, titleTag, heading }: TopicSelectorProps): ReactElement | null;
1050
1052
 
1053
+ interface MostReadNewsProps {
1054
+ theme: ThemeProps;
1055
+ heading: string;
1056
+ cards: Omit<CardFeaturedNewsProps, 'theme'>[];
1057
+ link?: LinkWithArrowProps;
1058
+ }
1059
+
1051
1060
  interface LeadNewsArticlesProps {
1052
1061
  theme: ThemeProps;
1053
1062
  featuredArticle: CardFeaturedNewsProps;
1054
1063
  otherLeadArticles: Omit<CardFeaturedNewsProps, 'theme'>[];
1064
+ mostReadNews: MostReadNewsProps;
1055
1065
  }
1056
- declare function LeadNewsArticles({ theme, featuredArticle, otherLeadArticles }: LeadNewsArticlesProps): ReactElement;
1066
+ declare function LeadNewsArticles({ theme, featuredArticle, otherLeadArticles, mostReadNews }: LeadNewsArticlesProps): ReactElement;
1057
1067
 
1058
1068
  interface TabItemProps {
1059
1069
  title: string;
@@ -1106,9 +1116,18 @@ declare function ImageCarousel({ theme, inverse, title, description, linkProps,
1106
1116
  interface NewsArticlesPromoBlockProps {
1107
1117
  theme: ThemeProps;
1108
1118
  heading: string;
1109
- cards: CardFeaturedNewsProps[];
1119
+ cards: CardFeaturedNewsProps[] | CardPromoVideoProps[];
1120
+ cardType?: 'featured-news' | 'promo-video';
1121
+ }
1122
+ declare function NewsArticlesPromoBlock({ theme, heading, cards, cardType }: NewsArticlesPromoBlockProps): ReactElement;
1123
+
1124
+ interface SingleButtonProps {
1125
+ theme: ThemeProps;
1126
+ inverse?: boolean;
1127
+ includeIcon: boolean;
1128
+ link: TextButtonWithIconProps | TextButtonProps;
1110
1129
  }
1111
- declare function NewsArticlesPromoBlock({ theme, heading, cards }: NewsArticlesPromoBlockProps): ReactElement;
1130
+ declare function SingleButton({ theme, inverse, includeIcon, link }: SingleButtonProps): ReactElement;
1112
1131
 
1113
1132
  interface FiveArticlesGridProps {
1114
1133
  theme: ThemeProps;
@@ -1118,4 +1137,50 @@ interface FiveArticlesGridProps {
1118
1137
  }
1119
1138
  declare function FiveArticlesGrid({ theme, heading, featuredArticle, otherLeadArticles }: FiveArticlesGridProps): ReactElement;
1120
1139
 
1121
- export { Accordion, AcreditationPromotion, Breadcrumbs, CTAComponent, Carousel, ClearingBanner, CourseDeliveryPills, FeaturedContent, FeaturedSignpost, FeaturedVideo, FiveArticlesGrid, Footer, GeneralSearchFilter, Header, Hero, HeroCarousel, ImageBlock, ImageCarousel, IntroText, LeadNewsArticles, ListingFilterWrapper, ListingResults, ListingResultsCount, MainWrapper, NewsArticlesPromoBlock, Pagination, PromoBlock, QuoteBlock, RelatedCourses, RichText, SearchCourses, SignPost, SkipToContent, StaffListingCarousel, StandardListingFilter, TabsBlock, TextWithBackground, TopicSelector, VideoCardComponent, VideoEmbed };
1140
+ interface IconButtonProps {
1141
+ theme: ThemeProps;
1142
+ inverse?: boolean;
1143
+ url?: string;
1144
+ title: string;
1145
+ icon: IconType$1;
1146
+ externalLink?: boolean;
1147
+ onClick?: () => void;
1148
+ ariaControls?: string;
1149
+ isSubmit?: boolean;
1150
+ disabled?: boolean;
1151
+ }
1152
+
1153
+ interface ShareButtonsProps {
1154
+ theme: ThemeProps;
1155
+ inverse?: boolean;
1156
+ label?: string;
1157
+ icons: IconButtonProps[];
1158
+ }
1159
+
1160
+ interface HeroArticleProps {
1161
+ /**
1162
+ * The theme to use
1163
+ */
1164
+ theme: ThemeProps;
1165
+ inverse?: boolean;
1166
+ title: string;
1167
+ titleTag?: 'h1' | 'h2' | 'h3' | 'h4';
1168
+ description: string;
1169
+ image: ImageProps;
1170
+ publishDate: string;
1171
+ readTime?: string;
1172
+ shareButtons: ShareButtonsProps;
1173
+ }
1174
+ declare function HeroArticle({ theme, inverse, title, titleTag, description, image, publishDate, readTime, shareButtons }: HeroArticleProps): ReactElement | null;
1175
+
1176
+ interface SidebarWrapperProps {
1177
+ /**
1178
+ * The theme to use
1179
+ */
1180
+ theme: ThemeProps;
1181
+ sidebarElement: ReactNode;
1182
+ children: ReactNode;
1183
+ }
1184
+ declare function SidebarWrapper({ theme, sidebarElement, children }: SidebarWrapperProps): ReactElement;
1185
+
1186
+ export { Accordion, AcreditationPromotion, Breadcrumbs, CTAComponent, Carousel, ClearingBanner, CourseDeliveryPills, FeaturedContent, FeaturedSignpost, FeaturedVideo, FiveArticlesGrid, Footer, GeneralSearchFilter, Header, Hero, HeroArticle, HeroCarousel, ImageBlock, ImageCarousel, IntroText, LeadNewsArticles, ListingFilterWrapper, ListingResults, ListingResultsCount, MainWrapper, NewsArticlesPromoBlock, Pagination, PromoBlock, QuoteBlock, RelatedCourses, RichText, SearchCourses, SidebarWrapper, SignPost, SingleButton, SkipToContent, StaffListingCarousel, StandardListingFilter, TabsBlock, TextWithBackground, TopicSelector, VideoCardComponent, VideoEmbed };