@uob-web-and-digital/component-library 2.19.2 → 2.20.0

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,7 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ThemeProps } from '../../../themeProps';
3
3
  import './icons.scss';
4
- export type IconType = 'twitter' | 'facebook' | 'wechat' | 'weibo' | 'youtube' | 'rednote' | 'instagram' | 'linkedin' | 'tiktok' | 'chevron-down' | 'chevron-right' | 'arrow-right' | 'arrow-right-large' | 'location' | 'hamburger' | 'cross' | 'slim-cross' | 'arrow-left' | 'search' | 'arrow-down' | 'play' | 'person' | 'people' | 'computer' | 'book' | 'mortar-board' | 'document' | 'briefcase' | 'notepad' | 'external' | 'clearing-tick' | 'phone' | 'email' | 'quote-marks' | 'calendar' | 'clock' | 'internet' | 'slim-location' | 'bathroom' | 'catering' | 'pound' | 'scroll' | 'settings' | 'rocket' | 'staggered-arrow' | 'segmented-pie-chart' | 'home' | 'domain' | 'note-add' | 'flight' | 'one' | 'two' | 'one-two-three' | 'camping' | 'groups' | 'bed' | 'restaurant' | 'success' | 'award_star' | 'warning-light' | 'warning-dark' | 'information' | 'star' | 'menu' | 'co-present' | 'assignment-add' | 'cast-for-education' | 'live-tv' | 'supervisor-account' | 'experiment' | 'footprint' | 'flag' | 'chat' | 'payments' | 'award-star' | 'pause' | 'mute-on' | 'mute-off' | 'plus';
4
+ export type IconType = 'twitter' | 'facebook' | 'wechat' | 'weibo' | 'youtube' | 'rednote' | 'instagram' | 'linkedin' | 'tiktok' | 'chevron-down' | 'chevron-up' | 'chevron-right' | 'arrow-right' | 'arrow-right-large' | 'location' | 'hamburger' | 'cross' | 'slim-cross' | 'arrow-left' | 'search' | 'arrow-down' | 'play' | 'person' | 'people' | 'computer' | 'book' | 'mortar-board' | 'document' | 'briefcase' | 'notepad' | 'external' | 'clearing-tick' | 'phone' | 'email' | 'quote-marks' | 'calendar' | 'clock' | 'internet' | 'slim-location' | 'bathroom' | 'catering' | 'pound' | 'scroll' | 'settings' | 'rocket' | 'staggered-arrow' | 'segmented-pie-chart' | 'home' | 'domain' | 'note-add' | 'flight' | 'one' | 'two' | 'one-two-three' | 'camping' | 'groups' | 'bed' | 'restaurant' | 'success' | 'award_star' | 'warning-light' | 'warning-dark' | 'information' | 'star' | 'menu' | 'co-present' | 'assignment-add' | 'cast-for-education' | 'live-tv' | 'supervisor-account' | 'experiment' | 'footprint' | 'flag' | 'chat' | 'payments' | 'award-star' | 'pause' | 'mute-on' | 'mute-off' | 'plus' | 'minus';
5
5
  export type IconProps = {
6
6
  /**
7
7
  * The theme to use
@@ -0,0 +1,32 @@
1
+ import { ReactElement } from 'react';
2
+ import { IconProps } from '../Icons/Icons';
3
+ import { ThemeProps } from '../../../themeProps';
4
+ import './navigationItem.scss';
5
+ export interface DocumentNavigationSubsectionProps {
6
+ /** The display name of the subsection */
7
+ title: string;
8
+ /** The URI for the subsection */
9
+ anchor: string;
10
+ }
11
+ export interface NavigationItemProps {
12
+ /** Theme for the component */ theme: ThemeProps;
13
+ /** Section title */
14
+ title: string;
15
+ /** Anchor for the section overview page */
16
+ anchor?: string;
17
+ /** Whether to use inverse colors */
18
+ inverse?: boolean;
19
+ /** Whether the section should be expanded on first render */
20
+ openByDefault?: boolean;
21
+ /** Icon name to display in the summary */
22
+ icon?: IconProps['icon'];
23
+ /** Icon position relative to the title */
24
+ iconPosition?: 'left' | 'right';
25
+ /** Subsections to display when expanded */
26
+ subsections?: DocumentNavigationSubsectionProps[];
27
+ /** Title tag for the heading */
28
+ titleTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
29
+ /** Click handler for the section */
30
+ onClick?: () => void;
31
+ }
32
+ export default function NavigationItem({ theme, title, anchor, inverse, openByDefault, icon, iconPosition, subsections, onClick }: NavigationItemProps): ReactElement;
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import NavigationItem from './NavigationItem';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof NavigationItem;
6
+ tags: string[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof NavigationItem>;
10
+ export declare const Default: Story;
11
+ export declare const WithArrowOnRight: Story;
12
+ export declare const OpenByDefault: Story;
13
+ export declare const NoSubsections: Story;
@@ -1,11 +1,15 @@
1
- import { ReactElement } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { ThemeProps } from '../../../themeProps';
3
3
  import './accordionItem.scss';
4
+ import { IconType } from '../../atoms/Icons/Icons';
4
5
  import { CardModuleCardProps } from '../CardModuleCard/CardModuleCard';
5
6
  export interface AccordionItemProps {
6
7
  key?: number;
7
8
  title: string;
9
+ icon?: IconType;
10
+ iconPosition?: 'left' | 'right';
8
11
  text?: string;
12
+ children?: ReactNode;
9
13
  theme: ThemeProps;
10
14
  inverse?: boolean;
11
15
  titleTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | undefined;
@@ -24,4 +28,4 @@ export interface AccordionItemProps {
24
28
  url: string;
25
29
  };
26
30
  }
27
- export default function AccordionItem({ theme, title, text, inverse, titleTag, cards, openByDefault, primaryButton, secondaryButton, link }: AccordionItemProps): ReactElement;
31
+ export default function AccordionItem({ theme, title, icon, iconPosition, text, children, inverse, titleTag, cards, openByDefault, primaryButton, secondaryButton, link }: AccordionItemProps): ReactElement;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { IconType } from '../../atoms/Icons/Icons';
3
+ import { ThemeProps } from '../../../themeProps';
4
+ import './documentSectionItem.scss';
5
+ export interface DocumentSectionSubsection {
6
+ title: string;
7
+ anchor: string;
8
+ }
9
+ export interface DocumentSectionItemProps {
10
+ title: string;
11
+ anchor: string;
12
+ subsections?: DocumentSectionSubsection[];
13
+ icon?: IconType;
14
+ iconPosition?: 'left' | 'right';
15
+ theme?: ThemeProps;
16
+ inverse?: boolean;
17
+ onActivate?: (data: {
18
+ title: string;
19
+ anchor: string;
20
+ subsections: DocumentSectionSubsection[];
21
+ }) => void;
22
+ onFocusActivate?: (data: {
23
+ title: string;
24
+ anchor: string;
25
+ subsections: DocumentSectionSubsection[];
26
+ }) => void;
27
+ isActive?: boolean;
28
+ }
29
+ export default function DocumentSectionItem({ title, anchor, subsections, onActivate, onFocusActivate, icon, iconPosition, theme, inverse, isActive }: DocumentSectionItemProps): React.ReactElement;
@@ -0,0 +1,10 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import DocumentSectionItem from './DocumentSectionItem';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof DocumentSectionItem;
6
+ tags: string[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof DocumentSectionItem>;
10
+ export declare const Desktop: Story;
@@ -0,0 +1,22 @@
1
+ import { ReactElement } from 'react';
2
+ import { DocumentNavigationSubsectionProps } from '../../atoms/NavigationItem/NavigationItem';
3
+ import { ThemeProps } from '../../../themeProps';
4
+ import './documentNavigation.scss';
5
+ export interface DocumentNavigationSectionProps {
6
+ /** Section title shown in the collapsible header */
7
+ title: string;
8
+ /** Anchor for the section overview page */
9
+ anchor: string;
10
+ /** Anchored content within the page */
11
+ subsections?: DocumentNavigationSubsectionProps[];
12
+ /** Whether the section should be expanded on first render */
13
+ openByDefault?: boolean;
14
+ /** Whether this section uses the gold highlight style */
15
+ isGoldSection?: boolean;
16
+ }
17
+ export interface DocumentNavigationProps {
18
+ theme?: ThemeProps;
19
+ inverse?: boolean;
20
+ sections: DocumentNavigationSectionProps[];
21
+ }
22
+ export default function DocumentNavigation({ theme, inverse, sections }: DocumentNavigationProps): ReactElement;
@@ -0,0 +1,12 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import DocumentNavigation from './DocumentNavigation';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof DocumentNavigation;
6
+ tags: string[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
11
+ export declare const Dark: Story;
12
+ export declare const MultipleSections: Story;
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ import ImageBlock, { ImageBlockProps } from './components/organisms/ImageBlock/I
32
32
  import ImageMosaic, { ImageMosaicProps } from './components/organisms/ImageMosaic/ImageMosaic';
33
33
  import ImageCarousel, { ImageCarouselProps } from './components/organisms/ImageCarousel/ImageCarousel';
34
34
  import InPageNavigation, { InPageNavigationProps } from './components/organisms/InPageNavigation/InPageNavigation';
35
+ import DocumentNavigation, { DocumentNavigationProps } from './components/organisms/DocumentNavigation/DocumentNavigation';
35
36
  import IntroText, { IntroTextProps } from './components/organisms/IntroText/IntroText';
36
37
  import LeadNewsArticles, { LeadNewsArticlesProps } from './components/organisms/LeadNewsArticles/LeadNewsArticles';
37
38
  import ListingFilterWrapper, { ListingFilterWrapperProps } from './components/organisms/ListingFilterWrapper/ListingFilterWrapper';
@@ -74,5 +75,5 @@ import LogoWall, { LogoWallProps } from './components/organisms/LogoWall/LogoWal
74
75
  import TextOverMedia, { TextOverMediaProps } from './components/organisms/TextOverMedia/TextOverMedia';
75
76
  import SocialFeed, { SocialFeedProps } from './components/organisms/SocialFeed/SocialFeed';
76
77
  import { HeaderLanding, HeaderLandingProps } from './components/organisms/HeaderLanding/HeaderLanding';
77
- export type { AccordionProps, AccreditationPromotionProps, AlertBannerProps, AnchorTargetProps, BreadcrumbsProps, CarouselProps, CardProfileProps, CardStaffProps, CenterWrapperProps, ClearingBannerProps, CourseDeliveryPillsProps, CTAComponentProps, EmbedWrapperProps, FactBoxesProps, FeaturedContentProps, FeaturedSignpostProps, FeaturedVideoProps, FiveArticlesGridProps, FooterProps, FormSelectProps, GenericDetailSectionProps, GeneralSearchFilterProps, HeaderProps, HeadingProps, HeroProps, HeroArticleProps, HeroCarouselProps, HeroCoursesProps, HeroProfileProps, HeroVideoProps, ImageBlockProps, ImageCarouselProps, ImageMosaicProps, InPageNavigationProps, IntroTextProps, LeadNewsArticlesProps, ListingFilterWrapperProps, ListingResultsProps, ListingResultsCountProps, ListTableProps, LocationSelectorProps, MainWrapperProps, ModuleCardGroupProps, NewsArticlesPromoBlockProps, PaginationProps, PromoBlockProps, QuoteBlockProps, RelatedCoursesProps, ResearchStoryCarouselProps, RichTextProps, ScholarshipCarouselProps, SearchCoursesProps, SelectOptionsProps, StaffListingCarouselProps, SidebarWrapperProps, SignPostProps, SingleButtonProps, SkipToContentProps, TabsBlockProps, TextWithBackgroundProps, TwoColumnWrapperProps, TopicSelectorProps, StandardListingFilterProps, VideoCardComponentProps, VideoEmbedProps, ScrollableTableProps, ScrollableTableCategory, ModalCTAProps, LocationSectionProps, CardPromoProfileProps, CardPromoSignpostProps, CardImageAndTextProps, LogoWallProps, TextOverMediaProps, SocialFeedProps, HeaderLandingProps };
78
- export { Accordion, AcreditationPromotion, AlertBanner, AnchorTarget, Breadcrumbs, Carousel, CardProfile, CardPromoSignpost, CardStaff, CentreWrapper, ClearingBanner, CourseDeliveryPills, CTAComponent, EmbedWrapper, FactBoxes, FeaturedContent, FeaturedSignpost, FeaturedVideo, FiveArticlesGrid, Footer, GeneralSearchFilter, GenericDetailSection, Header, Heading, Hero, HeroArticle, HeroCarousel, HeroCourses, HeroProfile, HeroVideo, ImageBlock, ImageCarousel, ImageMosaic, InPageNavigation, IntroText, LeadNewsArticles, ListingFilterWrapper, ListingResults, ListingResultsCount, ListTable, LocationSelector, MainWrapper, ModuleCardGroup, NewsArticlesPromoBlock, Pagination, PromoBlock, PromoBlockGrid, QuoteBlock, RelatedCourses, ResearchStoryCarousel, RichText, ScholarshipCarousel, SearchCourses, SidebarWrapper, SignPost, SingleButton, SkipToContent, StaffListingCarousel, StandardListingFilter, TabsBlock, TextWithBackground, TopicSelector, TwoColumnWrapper, VideoCardComponent, VideoEmbed, ScrollableTable, ModalCTA, LocationSection, CardPromoProfile, CardImageAndText, LogoWall, TextOverMedia, SocialFeed, HeaderLanding };
78
+ export type { AccordionProps, AccreditationPromotionProps, AlertBannerProps, AnchorTargetProps, BreadcrumbsProps, CarouselProps, CardProfileProps, CardStaffProps, CenterWrapperProps, ClearingBannerProps, CourseDeliveryPillsProps, CTAComponentProps, EmbedWrapperProps, FactBoxesProps, FeaturedContentProps, FeaturedSignpostProps, FeaturedVideoProps, FiveArticlesGridProps, FooterProps, FormSelectProps, GenericDetailSectionProps, GeneralSearchFilterProps, HeaderProps, HeadingProps, HeroProps, HeroArticleProps, HeroCarouselProps, HeroCoursesProps, HeroProfileProps, HeroVideoProps, ImageBlockProps, ImageCarouselProps, ImageMosaicProps, InPageNavigationProps, DocumentNavigationProps, IntroTextProps, LeadNewsArticlesProps, ListingFilterWrapperProps, ListingResultsProps, ListingResultsCountProps, ListTableProps, LocationSelectorProps, MainWrapperProps, ModuleCardGroupProps, NewsArticlesPromoBlockProps, PaginationProps, PromoBlockProps, QuoteBlockProps, RelatedCoursesProps, ResearchStoryCarouselProps, RichTextProps, ScholarshipCarouselProps, SearchCoursesProps, SelectOptionsProps, StaffListingCarouselProps, SidebarWrapperProps, SignPostProps, SingleButtonProps, SkipToContentProps, TabsBlockProps, TextWithBackgroundProps, TwoColumnWrapperProps, TopicSelectorProps, StandardListingFilterProps, VideoCardComponentProps, VideoEmbedProps, ScrollableTableProps, ScrollableTableCategory, ModalCTAProps, LocationSectionProps, CardPromoProfileProps, CardPromoSignpostProps, CardImageAndTextProps, LogoWallProps, TextOverMediaProps, SocialFeedProps, HeaderLandingProps };
79
+ export { Accordion, AcreditationPromotion, AlertBanner, AnchorTarget, Breadcrumbs, Carousel, CardProfile, CardPromoSignpost, CardStaff, CentreWrapper, ClearingBanner, CourseDeliveryPills, CTAComponent, EmbedWrapper, FactBoxes, FeaturedContent, FeaturedSignpost, FeaturedVideo, FiveArticlesGrid, Footer, GeneralSearchFilter, GenericDetailSection, Header, Heading, Hero, HeroArticle, HeroCarousel, HeroCourses, HeroProfile, HeroVideo, ImageBlock, ImageCarousel, ImageMosaic, InPageNavigation, DocumentNavigation, IntroText, LeadNewsArticles, ListingFilterWrapper, ListingResults, ListingResultsCount, ListTable, LocationSelector, MainWrapper, ModuleCardGroup, NewsArticlesPromoBlock, Pagination, PromoBlock, PromoBlockGrid, QuoteBlock, RelatedCourses, ResearchStoryCarousel, RichText, ScholarshipCarousel, SearchCourses, SidebarWrapper, SignPost, SingleButton, SkipToContent, StaffListingCarousel, StandardListingFilter, TabsBlock, TextWithBackground, TopicSelector, TwoColumnWrapper, VideoCardComponent, VideoEmbed, ScrollableTable, ModalCTA, LocationSection, CardPromoProfile, CardImageAndText, LogoWall, TextOverMedia, SocialFeed, HeaderLanding };