@uob-web-and-digital/component-library 0.0.29 → 0.0.31

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.
@@ -0,0 +1,15 @@
1
+ import { ReactElement } from 'react';
2
+ import { ImageProps } from '../../atoms/Image/Image';
3
+ import { ThemeProps } from '../../../themeProps';
4
+ import './cardImage.scss';
5
+ export interface CardImageProps {
6
+ theme: ThemeProps;
7
+ inverse?: boolean;
8
+ image: ImageProps;
9
+ imageCaption?: string;
10
+ imageCredit?: string;
11
+ }
12
+ /**
13
+ * Primary UI component for user interaction
14
+ */
15
+ export default function CardImage({ theme, inverse, image, imageCaption, imageCredit }: CardImageProps): ReactElement;
@@ -0,0 +1,18 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import CardImage from './CardImage';
3
+ import './cardImage.scss';
4
+ declare const meta: {
5
+ title: string;
6
+ component: typeof CardImage;
7
+ tags: string[];
8
+ parameters: {
9
+ backgrounds: {
10
+ default: string;
11
+ };
12
+ };
13
+ };
14
+ export default meta;
15
+ type Story = StoryObj<typeof CardImage>;
16
+ export declare const Default: Story;
17
+ export declare const Dark: Story;
18
+ export declare const Light: Story;
@@ -0,0 +1,2 @@
1
+ import { CardImageProps } from './CardImage';
2
+ export declare const cardImageProps: CardImageProps;
@@ -0,0 +1,22 @@
1
+ import { ReactElement } from 'react';
2
+ import { ImageProps } from '../../atoms/Image/Image';
3
+ import { ThemeProps } from '../../../themeProps';
4
+ import './cardPromo.scss';
5
+ export interface CardPromoProps {
6
+ theme: ThemeProps;
7
+ inverse?: boolean;
8
+ image?: ImageProps;
9
+ tag?: string;
10
+ title: string;
11
+ subtitle?: string;
12
+ href: string;
13
+ publishDate?: string;
14
+ authorString?: string;
15
+ location?: string;
16
+ copy?: string;
17
+ isSingle?: boolean;
18
+ }
19
+ /**
20
+ * Primary UI component for user interaction
21
+ */
22
+ export default function CardPromo({ theme, inverse, image, tag, title, subtitle, href, publishDate, authorString, location, copy, isSingle }: CardPromoProps): ReactElement;
@@ -0,0 +1,15 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import CardPromo from './CardPromo';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof CardPromo;
6
+ tags: string[];
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof CardPromo>;
13
+ export declare const SinglePromoCard: Story;
14
+ export declare const CardNoImage: Story;
15
+ export declare const OneOfManyPromoCards: Story;
@@ -10,6 +10,8 @@ interface CarouselNavProps {
10
10
  prevButtonDisabled: boolean;
11
11
  nextButtonDisabled: boolean;
12
12
  carouselId: string;
13
+ showNumbers?: boolean;
14
+ lineColor?: 'black' | 'gold';
13
15
  }
14
- export default function CarouselNav({ theme, totalNumber, currentNumber, onClickNext, onClickPrev, prevButtonDisabled, nextButtonDisabled, carouselId }: CarouselNavProps): ReactElement;
16
+ export default function CarouselNav({ theme, totalNumber, currentNumber, onClickNext, onClickPrev, prevButtonDisabled, nextButtonDisabled, carouselId, showNumbers, lineColor }: CarouselNavProps): ReactElement;
15
17
  export {};
@@ -0,0 +1,20 @@
1
+ import { ReactElement } from 'react';
2
+ import { ThemeProps } from '../../../themeProps';
3
+ import { LinkWithArrowProps } from '../../atoms/LinkWithArrow/LinkWithArrow';
4
+ import './heading.scss';
5
+ type LinkProps = Omit<LinkWithArrowProps, 'theme' | 'inverse'>;
6
+ export interface HeadingProps {
7
+ /**
8
+ * The theme to use
9
+ */
10
+ theme: ThemeProps;
11
+ /**
12
+ * Whether to inverse the colours
13
+ */
14
+ inverse?: boolean;
15
+ title?: string;
16
+ description?: string;
17
+ linkProps?: LinkProps;
18
+ }
19
+ export default function Heading({ title, description, linkProps, theme, inverse }: HeadingProps): ReactElement | null;
20
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import Heading from './Heading';
3
+ import './heading.scss';
4
+ declare const meta: {
5
+ title: string;
6
+ component: typeof Heading;
7
+ tags: string[];
8
+ parameters: {
9
+ backgrounds: {
10
+ default: string;
11
+ };
12
+ };
13
+ };
14
+ export default meta;
15
+ type Story = StoryObj<typeof Heading>;
16
+ export declare const Default: Story;
17
+ export declare const Dark: Story;
18
+ export declare const Light: Story;
@@ -0,0 +1,2 @@
1
+ import { HeadingProps } from './Heading';
2
+ export declare const headingProps: HeadingProps;
@@ -2,13 +2,14 @@ import { ReactElement } from 'react';
2
2
  import { CardNewsProps } from '../../molecules/CardNews/CardNews';
3
3
  import { CardFeaturedProps } from '../../molecules/CardFeatured/CardFeatured';
4
4
  import { CardVideoProps } from '../../molecules/CardVideo/CardVideo';
5
+ import { CardPromoProps } from '../../molecules/CardPromo/CardPromo';
5
6
  import { ThemeProps } from '../../../themeProps';
6
7
  import './carousel.scss';
7
8
  export interface CarouselProps {
8
9
  theme: ThemeProps;
9
10
  type: string;
10
11
  title?: string;
11
- cards: Omit<CardNewsProps, 'titleTag'>[] | CardFeaturedProps[] | CardVideoProps[];
12
+ cards: Omit<CardNewsProps, 'titleTag'>[] | CardFeaturedProps[] | CardVideoProps[] | CardPromoProps[];
12
13
  exploreMore?: string;
13
14
  }
14
15
  export default function Carousel({ theme, type, title, cards, exploreMore }: CarouselProps): ReactElement;
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from 'react';
2
+ import './imageBlock.scss';
3
+ import { HeadingProps } from '../../molecules/Heading/Heading';
4
+ import { CardImageProps } from '../../molecules/CardImage/CardImage';
5
+ export interface ImageBlockProps extends HeadingProps {
6
+ fullWidth: boolean;
7
+ images?: Omit<CardImageProps, 'theme' | 'inverse'>[];
8
+ }
9
+ export default function ImageBlock({ theme, inverse, title, description, linkProps, fullWidth, images }: ImageBlockProps): ReactElement | null;
@@ -0,0 +1,23 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import ImageBlock from './ImageBlock';
3
+ import './imageBlock.scss';
4
+ declare const meta: {
5
+ title: string;
6
+ component: typeof ImageBlock;
7
+ tags: string[];
8
+ parameters: {
9
+ backgrounds: {
10
+ default: string;
11
+ };
12
+ };
13
+ };
14
+ export default meta;
15
+ type Story = StoryObj<typeof ImageBlock>;
16
+ export declare const Default: Story;
17
+ export declare const Dark: Story;
18
+ export declare const Light: Story;
19
+ export declare const OneImageFullWidth: Story;
20
+ export declare const TwoImagesFullWidth: Story;
21
+ export declare const OneImage: Story;
22
+ export declare const TwoImages: Story;
23
+ export declare const NoImages: Story;
@@ -0,0 +1,2 @@
1
+ import { ImageBlockProps } from './ImageBlock';
2
+ export declare const imageBlockProps: ImageBlockProps;
@@ -1,5 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ThemeProps } from '../../../themeProps';
3
+ import './introText.scss';
3
4
  export interface IntroTextProps {
4
5
  /**
5
6
  * The theme to use
@@ -0,0 +1,36 @@
1
+ import { ReactElement } from 'react';
2
+ import { LinkWithArrowProps } from '../../atoms/LinkWithArrow/LinkWithArrow';
3
+ import { ThemeProps } from '../../../themeProps';
4
+ import { CardPromoProps } from '../../molecules/CardPromo/CardPromo';
5
+ import './promoBlock.scss';
6
+ export interface PromoBlockProps {
7
+ /**
8
+ * The theme to use
9
+ */
10
+ theme: ThemeProps;
11
+ /**
12
+ * Whether to inverse the colours
13
+ */
14
+ inverse?: boolean;
15
+ /**
16
+ * Optional title of the component
17
+ */
18
+ title?: string;
19
+ /**
20
+ * Optional description of the component
21
+ */
22
+ description?: string;
23
+ /**
24
+ * Optional link elements
25
+ */
26
+ link?: LinkWithArrowProps;
27
+ /**
28
+ * Promo block will work with three card types
29
+ */
30
+ type: 'promo' | 'signpost' | 'video';
31
+ /**
32
+ * A Promo block component can have any number of items
33
+ */
34
+ cards: CardPromoProps[];
35
+ }
36
+ export default function PromoBlock({ theme, inverse, type, title, description, link, cards }: PromoBlockProps): ReactElement | null;
@@ -0,0 +1,19 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import PromoBlock from './PromoBlock';
3
+ import './promoBlock.scss';
4
+ declare const meta: {
5
+ title: string;
6
+ component: typeof PromoBlock;
7
+ tags: string[];
8
+ parameters: {
9
+ backgrounds: {
10
+ default: string;
11
+ };
12
+ };
13
+ };
14
+ export default meta;
15
+ type Story = StoryObj<typeof PromoBlock>;
16
+ export declare const PromoBlockOneCardOnly: Story;
17
+ export declare const PromoBlockTwoCardsOnly: Story;
18
+ export declare const PromoBlockThreeCardsOnly: Story;
19
+ export declare const PromoBlockFourCardsPlus: Story;
@@ -0,0 +1,2 @@
1
+ import { PromoBlockProps } from './PromoBlock';
2
+ export declare const promoBlockProps: PromoBlockProps;
package/dist/index.d.ts CHANGED
@@ -58,11 +58,26 @@ interface CardVideoProps {
58
58
  buttonLabel: string;
59
59
  }
60
60
 
61
+ interface CardPromoProps {
62
+ theme: ThemeProps;
63
+ inverse?: boolean;
64
+ image?: ImageProps;
65
+ tag?: string;
66
+ title: string;
67
+ subtitle?: string;
68
+ href: string;
69
+ publishDate?: string;
70
+ authorString?: string;
71
+ location?: string;
72
+ copy?: string;
73
+ isSingle?: boolean;
74
+ }
75
+
61
76
  interface CarouselProps {
62
77
  theme: ThemeProps;
63
78
  type: string;
64
79
  title?: string;
65
- cards: Omit<CardNewsProps, 'titleTag'>[] | CardFeaturedProps[] | CardVideoProps[];
80
+ cards: Omit<CardNewsProps, 'titleTag'>[] | CardFeaturedProps[] | CardVideoProps[] | CardPromoProps[];
66
81
  exploreMore?: string;
67
82
  }
68
83
  declare function Carousel({ theme, type, title, cards, exploreMore }: CarouselProps): ReactElement;
@@ -418,4 +433,48 @@ interface TextWithBackgroundProps {
418
433
  }
419
434
  declare function TextWithBackground({ text, theme, inverse, headingLevel, headingText, url, linkTitle, externalLink, linkStyle }: TextWithBackgroundProps): ReactElement;
420
435
 
421
- export { Breadcrumbs, Carousel, FeaturedContent, FeaturedSignpost, FeaturedVideo, Footer, Header, HeroCarousel, IntroText, MainWrapper, RichText, SearchCourses, SignPost, SkipToContent, TextWithBackground, VideoCardComponent };
436
+ interface LinkWithArrowProps {
437
+ /**
438
+ * The theme to use
439
+ */
440
+ theme: ThemeProps;
441
+ /**
442
+ * Whether to inverse the colours
443
+ */
444
+ inverse?: boolean;
445
+ url: string;
446
+ title: string;
447
+ externalLink?: boolean;
448
+ onKeyDown?: (e: KeyboardEvent) => void;
449
+ }
450
+
451
+ type LinkProps = Omit<LinkWithArrowProps, 'theme' | 'inverse'>;
452
+ interface HeadingProps {
453
+ /**
454
+ * The theme to use
455
+ */
456
+ theme: ThemeProps;
457
+ /**
458
+ * Whether to inverse the colours
459
+ */
460
+ inverse?: boolean;
461
+ title?: string;
462
+ description?: string;
463
+ linkProps?: LinkProps;
464
+ }
465
+
466
+ interface CardImageProps {
467
+ theme: ThemeProps;
468
+ inverse?: boolean;
469
+ image: ImageProps;
470
+ imageCaption?: string;
471
+ imageCredit?: string;
472
+ }
473
+
474
+ interface ImageBlockProps extends HeadingProps {
475
+ fullWidth: boolean;
476
+ images?: Omit<CardImageProps, 'theme' | 'inverse'>[];
477
+ }
478
+ declare function ImageBlock({ theme, inverse, title, description, linkProps, fullWidth, images }: ImageBlockProps): ReactElement | null;
479
+
480
+ export { Breadcrumbs, Carousel, FeaturedContent, FeaturedSignpost, FeaturedVideo, Footer, Header, HeroCarousel, ImageBlock, IntroText, MainWrapper, RichText, SearchCourses, SignPost, SkipToContent, TextWithBackground, VideoCardComponent };