@uob-web-and-digital/component-library 0.0.64 → 0.0.65

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.
@@ -1,6 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ThemeProps } from '../../../themeProps';
3
3
  import { LinkWithArrowProps } from '../../atoms/LinkWithArrow/LinkWithArrow';
4
+ import { HeadingProps as HeadingElementProps } from '../../atoms/Heading/Heading';
4
5
  import './heading.scss';
5
6
  type LinkProps = Omit<LinkWithArrowProps, 'theme' | 'inverse'>;
6
7
  export interface HeadingProps {
@@ -12,10 +13,11 @@ export interface HeadingProps {
12
13
  * Whether to inverse the colours
13
14
  */
14
15
  inverse?: boolean;
16
+ htmlTag?: HeadingElementProps['htmlTag'];
15
17
  title?: string;
16
18
  description?: string;
17
19
  linkProps?: LinkProps;
18
20
  fullWidth?: boolean;
19
21
  }
20
- export default function Heading({ title, description, linkProps, theme, inverse, fullWidth }: HeadingProps): ReactElement | null;
22
+ export default function Heading({ title, description, linkProps, theme, inverse, fullWidth, htmlTag }: HeadingProps): ReactElement | null;
21
23
  export {};
@@ -1,6 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ThemeProps } from '../../../themeProps';
3
3
  import { ImageProps } from '../../atoms/Image/Image';
4
+ import { HeadingProps } from '../../atoms/Heading/Heading';
4
5
  import './accreditationPromotion.scss';
5
6
  interface Accreditation {
6
7
  text: string;
@@ -8,13 +9,14 @@ interface Accreditation {
8
9
  }
9
10
  export interface AccreditationPromotionProps {
10
11
  theme: ThemeProps;
11
- heading: string;
12
- intro: string;
12
+ heading?: string;
13
+ htmlTag: HeadingProps['htmlTag'];
14
+ intro?: string;
13
15
  accreditations: Accreditation[];
14
16
  /**
15
17
  * The fullWidth version of this component is used for in study pages
16
18
  */
17
19
  fullWidth?: boolean;
18
20
  }
19
- export default function AcreditationPromotion({ theme, heading, intro, accreditations, fullWidth }: AccreditationPromotionProps): ReactElement;
21
+ export default function AcreditationPromotion({ theme, heading, intro, accreditations, htmlTag, fullWidth }: AccreditationPromotionProps): ReactElement;
20
22
  export {};
@@ -8,3 +8,4 @@ declare const meta: {
8
8
  export default meta;
9
9
  type Story = StoryObj<typeof meta>;
10
10
  export declare const Example: Story;
11
+ export declare const ExampleNoHeading: Story;
@@ -6,4 +6,4 @@ export interface FactBoxesProps extends HeadingProps {
6
6
  fullWidth?: boolean;
7
7
  cards: CardFactProps[];
8
8
  }
9
- export default function FactBoxes({ theme, inverse, title, description, linkProps, cards, fullWidth }: FactBoxesProps): ReactElement;
9
+ export default function FactBoxes({ theme, inverse, title, description, linkProps, cards, fullWidth, htmlTag }: FactBoxesProps): ReactElement;
@@ -7,4 +7,4 @@ export interface ImageBlockProps extends HeadingProps {
7
7
  makeHeadingFullWidth?: boolean;
8
8
  images?: Omit<CardImageProps, 'theme' | 'inverse'>[];
9
9
  }
10
- export default function ImageBlock({ theme, inverse, title, description, linkProps, fullWidth, makeHeadingFullWidth, images }: ImageBlockProps): ReactElement | null;
10
+ export default function ImageBlock({ theme, inverse, title, description, linkProps, fullWidth, makeHeadingFullWidth, images, htmlTag }: ImageBlockProps): ReactElement | null;
@@ -7,4 +7,4 @@ export interface ImageCarouselProps extends HeadingProps {
7
7
  widerImage: boolean;
8
8
  images: CardImageProps[];
9
9
  }
10
- export default function ImageCarousel({ theme, inverse, title, description, linkProps, fullWidth, widerImage, images }: ImageCarouselProps): ReactElement;
10
+ export default function ImageCarousel({ theme, inverse, title, description, linkProps, fullWidth, widerImage, images, htmlTag }: ImageCarouselProps): ReactElement;
@@ -12,5 +12,6 @@ export interface IntroTextProps {
12
12
  inverse?: boolean;
13
13
  fullWidth?: boolean;
14
14
  text: string;
15
+ removeBottomPadding?: boolean;
15
16
  }
16
- export default function IntroText({ text, theme, inverse, fullWidth }: IntroTextProps): ReactElement;
17
+ export default function IntroText({ text, theme, inverse, fullWidth, removeBottomPadding }: IntroTextProps): ReactElement;
@@ -16,5 +16,5 @@ export interface QuoteBlockProps extends HeadingProps {
16
16
  cta?: LinkProps;
17
17
  fullWidth?: boolean;
18
18
  }
19
- export default function QuoteBlock({ theme, inverse, title, description, cite, role, quote, quoteeProfileImage, quoteeProfileImageAltText, cta, fullWidth }: QuoteBlockProps): ReactElement;
19
+ export default function QuoteBlock({ theme, inverse, title, description, cite, role, quote, quoteeProfileImage, quoteeProfileImageAltText, cta, fullWidth, htmlTag }: QuoteBlockProps): ReactElement;
20
20
  export {};
@@ -1,6 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ThemeProps } from '../../../themeProps';
3
3
  import { TabItemProps } from '../../molecules/Tab/TabItemProps';
4
+ import { HeadingProps } from '../../molecules/Heading/Heading';
4
5
  import './tabsBlock.scss';
5
6
  export interface TabsBlockProps {
6
7
  /**
@@ -27,5 +28,9 @@ export interface TabsBlockProps {
27
28
  * The fullWidth version of this component is used for in study pages
28
29
  */
29
30
  fullWidth?: boolean;
31
+ /**
32
+ * heading tag options
33
+ */
34
+ htmlTag?: HeadingProps['htmlTag'];
30
35
  }
31
- export default function TabsBlock({ theme, inverse, title, description, tabItems, fullWidth }: TabsBlockProps): ReactElement | null;
36
+ export default function TabsBlock({ theme, inverse, title, description, tabItems, fullWidth, htmlTag }: TabsBlockProps): ReactElement | null;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React, { KeyboardEvent, ReactElement, ReactNode, MouseEventHandler, ChangeEvent, PropsWithChildren } from 'react';
1
+ import React, { KeyboardEvent, ReactNode, ReactElement, MouseEventHandler, ChangeEvent, PropsWithChildren } from 'react';
2
2
 
3
3
  type ThemeProps = 'uobmain' | 'redexample';
4
4
 
@@ -36,8 +36,14 @@ interface LinkWithArrowProps {
36
36
  onKeyDown?: (e: KeyboardEvent) => void;
37
37
  }
38
38
 
39
- type LinkProps$1 = Omit<LinkWithArrowProps, 'theme' | 'inverse'>;
40
39
  interface HeadingProps$1 {
40
+ htmlTag: 'h2' | 'h3' | 'h4';
41
+ classNames?: string;
42
+ children?: ReactNode;
43
+ }
44
+
45
+ type LinkProps$1 = Omit<LinkWithArrowProps, 'theme' | 'inverse'>;
46
+ interface HeadingProps {
41
47
  /**
42
48
  * The theme to use
43
49
  */
@@ -46,6 +52,7 @@ interface HeadingProps$1 {
46
52
  * Whether to inverse the colours
47
53
  */
48
54
  inverse?: boolean;
55
+ htmlTag?: HeadingProps$1['htmlTag'];
49
56
  title?: string;
50
57
  description?: string;
51
58
  linkProps?: LinkProps$1;
@@ -55,7 +62,7 @@ interface HeadingProps$1 {
55
62
  interface AccordionProps {
56
63
  theme: ThemeProps;
57
64
  inverse?: boolean;
58
- heading?: Omit<HeadingProps$1, 'theme' | 'inverse'>;
65
+ heading?: Omit<HeadingProps, 'theme' | 'inverse'>;
59
66
  accordionItems: AccordionItemProps[];
60
67
  fullWidth?: boolean;
61
68
  }
@@ -80,15 +87,16 @@ interface Accreditation {
80
87
  }
81
88
  interface AccreditationPromotionProps {
82
89
  theme: ThemeProps;
83
- heading: string;
84
- intro: string;
90
+ heading?: string;
91
+ htmlTag: HeadingProps$1['htmlTag'];
92
+ intro?: string;
85
93
  accreditations: Accreditation[];
86
94
  /**
87
95
  * The fullWidth version of this component is used for in study pages
88
96
  */
89
97
  fullWidth?: boolean;
90
98
  }
91
- declare function AcreditationPromotion({ theme, heading, intro, accreditations, fullWidth }: AccreditationPromotionProps): ReactElement;
99
+ declare function AcreditationPromotion({ theme, heading, intro, accreditations, htmlTag, fullWidth }: AccreditationPromotionProps): ReactElement;
92
100
 
93
101
  interface RichTextProps {
94
102
  /**
@@ -139,12 +147,6 @@ interface BreadcrumbsProps {
139
147
  }
140
148
  declare function Breadcrumbs({ theme, inverse, links }: BreadcrumbsProps): ReactElement;
141
149
 
142
- interface HeadingProps {
143
- htmlTag: 'h2' | 'h3' | 'h4';
144
- classNames?: string;
145
- children?: ReactNode;
146
- }
147
-
148
150
  interface CardNewsProps {
149
151
  theme: ThemeProps;
150
152
  inverse?: boolean;
@@ -153,7 +155,7 @@ interface CardNewsProps {
153
155
  title: string;
154
156
  href: string;
155
157
  publishDate: string;
156
- titleTag: HeadingProps['htmlTag'];
158
+ titleTag: HeadingProps$1['htmlTag'];
157
159
  }
158
160
 
159
161
  interface CardFeaturedProps {
@@ -186,7 +188,7 @@ interface CardVideoProps {
186
188
  title: string;
187
189
  youtubeId: string;
188
190
  buttonLabel: string;
189
- titleTag: HeadingProps['htmlTag'];
191
+ titleTag: HeadingProps$1['htmlTag'];
190
192
  }
191
193
 
192
194
  interface CardPromoProps {
@@ -202,7 +204,7 @@ interface CardPromoProps {
202
204
  location?: string;
203
205
  copy?: string;
204
206
  isSingle?: boolean;
205
- titleTag: HeadingProps['htmlTag'];
207
+ titleTag: HeadingProps$1['htmlTag'];
206
208
  cardCopyIsRichText?: boolean;
207
209
  }
208
210
 
@@ -249,7 +251,7 @@ interface CardPromoSignpostProps {
249
251
  buttonPrimary?: TextButtonProps;
250
252
  buttonSecondary?: TextButtonProps;
251
253
  link?: LinkWithArrowProps;
252
- titleTag: HeadingProps['htmlTag'];
254
+ titleTag: HeadingProps$1['htmlTag'];
253
255
  }
254
256
 
255
257
  interface CardPromoVideoProps {
@@ -318,7 +320,7 @@ interface CarouselProps {
318
320
  inverse?: boolean;
319
321
  type: string;
320
322
  title?: string;
321
- cardTitleTag?: HeadingProps['htmlTag'];
323
+ cardTitleTag?: HeadingProps$1['htmlTag'];
322
324
  setCardInverse?: 'dark' | 'light';
323
325
  cards: Omit<CardNewsProps, 'titleTag'>[] | CardFeaturedProps[] | CardVideoProps[] | CardPromoProps[] | CardPromoSignpostProps[] | CardPromoVideoProps[] | CardStaffProps[] | CardRelatedProps[] | CardImageProps[] | CardFeaturedNewsProps[];
324
326
  exploreMore?: string;
@@ -462,11 +464,11 @@ interface CardFactProps {
462
464
  link?: LinkWithArrowProps;
463
465
  }
464
466
 
465
- interface FactBoxesProps extends HeadingProps$1 {
467
+ interface FactBoxesProps extends HeadingProps {
466
468
  fullWidth?: boolean;
467
469
  cards: CardFactProps[];
468
470
  }
469
- declare function FactBoxes({ theme, inverse, title, description, linkProps, cards, fullWidth }: FactBoxesProps): ReactElement;
471
+ declare function FactBoxes({ theme, inverse, title, description, linkProps, cards, fullWidth, htmlTag }: FactBoxesProps): ReactElement;
470
472
 
471
473
  interface FeaturedContentProps {
472
474
  /**
@@ -823,7 +825,7 @@ interface HeroCoursesProps {
823
825
  theme: ThemeProps;
824
826
  inverse?: boolean;
825
827
  title: string;
826
- titleTag?: HeadingProps['htmlTag'];
828
+ titleTag?: HeadingProps$1['htmlTag'];
827
829
  awardShort: string;
828
830
  links?: Omit<TextButtonProps, 'theme'>[];
829
831
  heroType: 'UG' | 'UG Dubai' | 'PGT Dubai' | 'Other';
@@ -866,19 +868,19 @@ interface HeroCarouselProps {
866
868
  }
867
869
  declare function HeroCarousel({ theme, cards }: HeroCarouselProps): ReactElement | null;
868
870
 
869
- interface ImageBlockProps extends HeadingProps$1 {
871
+ interface ImageBlockProps extends HeadingProps {
870
872
  fullWidth: boolean;
871
873
  makeHeadingFullWidth?: boolean;
872
874
  images?: Omit<CardImageProps, 'theme' | 'inverse'>[];
873
875
  }
874
- declare function ImageBlock({ theme, inverse, title, description, linkProps, fullWidth, makeHeadingFullWidth, images }: ImageBlockProps): ReactElement | null;
876
+ declare function ImageBlock({ theme, inverse, title, description, linkProps, fullWidth, makeHeadingFullWidth, images, htmlTag }: ImageBlockProps): ReactElement | null;
875
877
 
876
- interface ImageCarouselProps extends HeadingProps$1 {
878
+ interface ImageCarouselProps extends HeadingProps {
877
879
  fullWidth?: boolean;
878
880
  widerImage: boolean;
879
881
  images: CardImageProps[];
880
882
  }
881
- declare function ImageCarousel({ theme, inverse, title, description, linkProps, fullWidth, widerImage, images }: ImageCarouselProps): ReactElement;
883
+ declare function ImageCarousel({ theme, inverse, title, description, linkProps, fullWidth, widerImage, images, htmlTag }: ImageCarouselProps): ReactElement;
882
884
 
883
885
  interface InPageNavLinkProps {
884
886
  url: string;
@@ -912,8 +914,9 @@ interface IntroTextProps {
912
914
  inverse?: boolean;
913
915
  fullWidth?: boolean;
914
916
  text: string;
917
+ removeBottomPadding?: boolean;
915
918
  }
916
- declare function IntroText({ text, theme, inverse, fullWidth }: IntroTextProps): ReactElement;
919
+ declare function IntroText({ text, theme, inverse, fullWidth, removeBottomPadding }: IntroTextProps): ReactElement;
917
920
 
918
921
  interface MostReadNewsProps {
919
922
  theme: ThemeProps;
@@ -1020,7 +1023,7 @@ interface ListingResultsProps {
1020
1023
  theme: ThemeProps;
1021
1024
  showCategory?: boolean;
1022
1025
  cards: CardProps[];
1023
- headingInfo?: HeadingProps$1;
1026
+ headingInfo?: HeadingProps;
1024
1027
  }
1025
1028
  declare function ListingResults({ theme, showCategory, cards, headingInfo }: ListingResultsProps): ReactElement;
1026
1029
 
@@ -1139,7 +1142,7 @@ interface PromoBlockProps {
1139
1142
  declare function PromoBlockGrid({ theme, inverse, type, title, description, link, cards, imageOrientation, fullWidth }: PromoBlockProps): ReactElement | null;
1140
1143
 
1141
1144
  type LinkProps = Omit<LinkWithArrowProps, 'theme' | 'inverse'>;
1142
- interface QuoteBlockProps extends HeadingProps$1 {
1145
+ interface QuoteBlockProps extends HeadingProps {
1143
1146
  theme: ThemeProps;
1144
1147
  inverse?: boolean;
1145
1148
  title?: string;
@@ -1151,7 +1154,7 @@ interface QuoteBlockProps extends HeadingProps$1 {
1151
1154
  cta?: LinkProps;
1152
1155
  fullWidth?: boolean;
1153
1156
  }
1154
- declare function QuoteBlock({ theme, inverse, title, description, cite, role, quote, quoteeProfileImage, quoteeProfileImageAltText, cta, fullWidth }: QuoteBlockProps): ReactElement;
1157
+ declare function QuoteBlock({ theme, inverse, title, description, cite, role, quote, quoteeProfileImage, quoteeProfileImageAltText, cta, fullWidth, htmlTag }: QuoteBlockProps): ReactElement;
1155
1158
 
1156
1159
  interface RelatedCoursesProps {
1157
1160
  theme: ThemeProps;
@@ -1342,8 +1345,12 @@ interface TabsBlockProps {
1342
1345
  * The fullWidth version of this component is used for in study pages
1343
1346
  */
1344
1347
  fullWidth?: boolean;
1348
+ /**
1349
+ * heading tag options
1350
+ */
1351
+ htmlTag?: HeadingProps['htmlTag'];
1345
1352
  }
1346
- declare function TabsBlock({ theme, inverse, title, description, tabItems, fullWidth }: TabsBlockProps): ReactElement | null;
1353
+ declare function TabsBlock({ theme, inverse, title, description, tabItems, fullWidth, htmlTag }: TabsBlockProps): ReactElement | null;
1347
1354
 
1348
1355
  interface TextWithBackgroundProps {
1349
1356
  /**
@@ -1474,7 +1481,7 @@ interface VideoEmbedProps {
1474
1481
  medium?: string;
1475
1482
  default: string;
1476
1483
  };
1477
- heading?: Omit<HeadingProps$1, 'theme' | 'inverse'>;
1484
+ heading?: Omit<HeadingProps, 'theme' | 'inverse'>;
1478
1485
  transcript?: string;
1479
1486
  fullWidth?: boolean;
1480
1487
  videoCaption?: string;