@royaloperahouse/harmonic 0.17.0-a → 0.17.0-b

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 (46) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +18 -2
  3. package/dist/components/atoms/Dropdown/Dropdown.d.ts +1 -1
  4. package/dist/components/atoms/ImageAspectRatioWrapper/ImageAspectRatioWrapper.d.ts +1 -1
  5. package/dist/components/atoms/RotatorButtons/RotatorButtons.d.ts +1 -1
  6. package/dist/components/atoms/Tab/Tab.d.ts +1 -1
  7. package/dist/components/index.d.ts +3 -3
  8. package/dist/components/molecules/BodyContent/BodyContent.d.ts +6 -1
  9. package/dist/components/molecules/CastFilter/CastFilters.d.ts +4 -0
  10. package/dist/components/molecules/CastFilter/CastFilters.style.d.ts +16 -0
  11. package/dist/components/molecules/CastFilter/index.d.ts +2 -0
  12. package/dist/components/molecules/ImageWithCaption/ImageWithCaption.d.ts +2 -2
  13. package/dist/components/molecules/ImageWithCaption/ImageWithCaption.style.d.ts +2 -1
  14. package/dist/components/molecules/PageHeading/Highlight/Highlight.d.ts +4 -0
  15. package/dist/components/molecules/PageHeading/Highlight/Highlight.style.d.ts +9 -0
  16. package/dist/components/molecules/PageHeading/Highlight/index.d.ts +2 -0
  17. package/dist/components/molecules/PageHeading/index.d.ts +2 -1
  18. package/dist/components/molecules/Paywall/Paywall.d.ts +4 -0
  19. package/dist/components/molecules/Paywall/Paywall.styles.d.ts +292 -0
  20. package/dist/components/molecules/Paywall/index.d.ts +2 -0
  21. package/dist/components/molecules/PeopleListing/PeopleListing.d.ts +1 -1
  22. package/dist/components/molecules/PeopleListing/PeopleListing.style.d.ts +2 -2
  23. package/dist/components/molecules/SkipToMain/SkipToMain.d.ts +20 -0
  24. package/dist/components/molecules/SkipToMain/SkipToMain.style.d.ts +6 -0
  25. package/dist/components/molecules/SkipToMain/index.d.ts +2 -0
  26. package/dist/components/molecules/UpsellCard/UpsellCard.style.d.ts +276 -11
  27. package/dist/components/molecules/index.d.ts +4 -2
  28. package/dist/components/organisms/AnchorTabBar/AnchorTabBar.style.d.ts +1 -1
  29. package/dist/components/organisms/Navigation/Navigation.d.ts +1 -1
  30. package/dist/components/organisms/UpsellSection/UpsellSection.style.d.ts +272 -1
  31. package/dist/harmonic.cjs.development.css +343 -11
  32. package/dist/harmonic.cjs.development.js +6990 -6789
  33. package/dist/harmonic.cjs.development.js.map +1 -1
  34. package/dist/harmonic.cjs.production.min.js +1 -1
  35. package/dist/harmonic.cjs.production.min.js.map +1 -1
  36. package/dist/harmonic.esm.js +6999 -6797
  37. package/dist/harmonic.esm.js.map +1 -1
  38. package/dist/index.d.ts +2 -2
  39. package/dist/styles/HarmonicThemeProvider/HarmonicThemeProvider.d.ts +1 -0
  40. package/dist/types/anchorBar.d.ts +3 -0
  41. package/dist/types/image.d.ts +15 -11
  42. package/dist/types/impactHeader.d.ts +20 -2
  43. package/dist/types/navigation.d.ts +4 -0
  44. package/dist/types/types.d.ts +105 -4
  45. package/dist/types/upsell.d.ts +7 -15
  46. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Accordion, Accordions, AnchorBar, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, BodyText, Card, Cards, Carousel, CinemaBadge, ContactCard, ContentSummary, ControlledDropdown, CreditListing, Editorial, Footer, GlobalStyles, Grid, GridItem, Header, HighlightsCarousel, HighlightsCarouselCinema, HighlightsCarouselCore, HighlightsCarouselStream, HotFilters, Icon, ImageAspectRatioWrapper, ImageWithCaption, Information, Navigation, MinimalCarousel, Overline, PageHeading, PageHeadingCompact, PageHeadingImpact, PageHeadingPanel, PageHeadingPromo, PageHeadingHighlightCarousel, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Select2, Select2Async, SignUpForm, Sponsorship, StickyBar, Stepper, StreamBadge, Subtitle, TertiaryButton, ThemeProvider, TitleWithCTA, Tab, Table, TabLink, Tabs, TextArea, TextField, TextFieldLegacy, TextLink, Tickbox, Tickbox2, Timer, TypeTags, UpsellCard, UpsellSection, VideoControls, VideoWithControls } from './components';
1
+ import { Accordion, Accordions, AnchorBar, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, BodyText, Card, Cards, Carousel, CinemaBadge, ContactCard, ContentSummary, ControlledDropdown, CreditListing, Editorial, Footer, GlobalStyles, Grid, GridItem, Header, HighlightsCarousel, HighlightsCarouselCinema, HighlightsCarouselCore, HighlightsCarouselStream, HotFilters, Icon, ImageAspectRatioWrapper, ImageWithCaption, Information, Navigation, MinimalCarousel, Overline, PageHeading, PageHeadingCompact, PageHeadingImpact, PageHeadingPanel, PageHeadingHighlight, PageHeadingPromo, PageHeadingHighlightCarousel, Pagination, PasswordStrength, Paywall, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Select2, Select2Async, SignUpForm, Sponsorship, StickyBar, Stepper, StreamBadge, Subtitle, TertiaryButton, ThemeProvider, TitleWithCTA, Tab, Table, TabLink, Tabs, TextArea, TextField, TextFieldLegacy, TextLink, Tickbox, Tickbox2, Timer, TypeTags, UpsellCard, UpsellSection, VideoControls, VideoWithControls } from './components';
2
2
  import BodyContent from './components/molecules/BodyContent';
3
3
  import Quote from './components/molecules/Quote';
4
4
  import { devices, breakpoints } from './styles/viewports';
@@ -11,4 +11,4 @@ import HarmonicThemeProvider, { useHarmonicTheme } from './styles/HarmonicThemeP
11
11
  import { HarmonicSize } from './types/typography';
12
12
  import { HarmonicHeader, HarmonicSubtitle, BodyCopyHarmonic, HarmonicOverline, ButtonText, Caption, NavigationText } from './components/Typography';
13
13
  export { useHarmonicTheme };
14
- export { Accordion, Accordions, AnchorBar, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryButton, AuxiliaryNav, AspectRatio, BodyContent, BodyText, breakpoints, ButtonType, Card, Cards, CarouselType, Carousel, CinemaBadge, Colors, ContactCard, ContentSummary, ControlledDropdown, CreditListing, devices, Editorial, EditorialLink, Footer, GlobalStyles, Grid, GridItem, HarmonicSize, HarmonicThemeProvider, Header, HighlightsCarousel, HighlightsCarouselCinema, HighlightsCarouselCore, HighlightsCarouselStream, HotFilters, Icon, IconNameType, ImageAspectRatioWrapper, ImageWithCaption, Information, IInformationCTAProps, IInformationTitleProps, ITimerProps, IntegratedTimerProps, MinimalCarousel, MiniCard, ModalWindow, Navigation, Overline, PageHeading, PageHeadingCompact, PageHeadingImpact, PageHeadingPanel, PageHeadingPromo, PageHeadingHighlightCarousel, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Select2, Select2Async, SignUpForm, Sponsorship, StickyBar, Stepper, StreamBadge, Subtitle, Tab, Table, TabLink, Tabs, TertiaryButton, TextArea, TextField, TextFieldLegacy, TextLink, ThemeColor, ThemeProvider, ThemeType, TitleWithCTA, Tickbox, Tickbox2, TickboxMode, Timer, TypeTags, UpsellCard, UpsellSection, Quote, VideoControls, VideoWithControls, zIndexes, HarmonicHeader, HarmonicSubtitle, BodyCopyHarmonic, HarmonicOverline, ButtonText, Caption, NavigationText, };
14
+ export { Accordion, Accordions, AnchorBar, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryButton, AuxiliaryNav, AspectRatio, BodyContent, BodyText, breakpoints, ButtonType, Card, Cards, CarouselType, Carousel, CinemaBadge, Colors, ContactCard, ContentSummary, ControlledDropdown, CreditListing, devices, Editorial, EditorialLink, Footer, GlobalStyles, Grid, GridItem, HarmonicSize, HarmonicThemeProvider, Header, HighlightsCarousel, HighlightsCarouselCinema, HighlightsCarouselCore, HighlightsCarouselStream, HotFilters, Icon, IconNameType, ImageAspectRatioWrapper, ImageWithCaption, Information, IInformationCTAProps, IInformationTitleProps, ITimerProps, IntegratedTimerProps, MinimalCarousel, MiniCard, ModalWindow, Navigation, Overline, PageHeading, PageHeadingCompact, PageHeadingImpact, PageHeadingPanel, PageHeadingHighlight, PageHeadingPromo, PageHeadingHighlightCarousel, Pagination, PasswordStrength, Paywall, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Select2, Select2Async, SignUpForm, Sponsorship, StickyBar, Stepper, StreamBadge, Subtitle, Tab, Table, TabLink, Tabs, TertiaryButton, TextArea, TextField, TextFieldLegacy, TextLink, ThemeColor, ThemeProvider, ThemeType, TitleWithCTA, Tickbox, Tickbox2, TickboxMode, Timer, TypeTags, UpsellCard, UpsellSection, Quote, VideoControls, VideoWithControls, zIndexes, HarmonicHeader, HarmonicSubtitle, BodyCopyHarmonic, HarmonicOverline, ButtonText, Caption, NavigationText, };
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ThemeType } from '../../types';
3
3
  import './theme/fonts.css';
4
+ import './theme/typography.css';
4
5
  export declare const DEFAULT_THEME = ThemeType.Core;
5
6
  interface HarmonicThemeProviderProps {
6
7
  theme: ThemeType;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { EditorialLink } from './editorial';
3
+ import { IGridItemProps } from './types';
3
4
  export interface IAnchorBarProps {
4
5
  /** CTA for anchor bar */
5
6
  cta: EditorialLink;
@@ -13,4 +14,6 @@ export interface IAnchorBarProps {
13
14
  className?: string;
14
15
  /** Flag indicating whether the anchor bar should have a shadow */
15
16
  withShadow?: boolean;
17
+ /** Optional grid item props to allow for different page alignments */
18
+ grid?: IGridItemProps;
16
19
  }
@@ -1,5 +1,4 @@
1
- import { ReactElement, ReactNode } from 'react';
2
- import { StyledProps } from 'styled-components';
1
+ import React from 'react';
3
2
  export declare enum AspectRatio {
4
3
  '1:1' = "1 / 1",
5
4
  '3:4' = "3 / 4",
@@ -44,13 +43,18 @@ export interface IImageWithCaptionProps {
44
43
  caption: string;
45
44
  /** Alternative text describing the image content for accessibility purposes. */
46
45
  altText?: string;
47
- /** Image element */
48
- children: ReactElement<HTMLImageElement>;
46
+ /** Image source */
47
+ src: string;
48
+ /** Optional srcSet for responsive images */
49
+ srcSet?: string;
50
+ /** Optional sizes for responsive images */
51
+ sizes?: string;
52
+ /** Optional loading strategy */
53
+ loading?: 'lazy' | 'eager';
54
+ /** Custom CSS classes */
55
+ className?: string;
49
56
  }
50
- export interface IImageWithCaptionWrapperProps extends StyledProps<{
51
- aspectRatio?: AspectRatio;
52
- height: number;
53
- }> {
57
+ export interface IImageWithCaptionWrapperProps {
54
58
  /**
55
59
  * Aspect ratio of the contained image
56
60
  */
@@ -58,11 +62,11 @@ export interface IImageWithCaptionWrapperProps extends StyledProps<{
58
62
  /**
59
63
  * Height of the wrapper
60
64
  */
61
- height: number;
65
+ height?: number;
62
66
  }
63
- export interface ImageAspectRatioWrapperProps extends IImageAspectRatioWrapperProps {
67
+ export interface ImageAspectRatioWrapperProps extends IImageAspectRatioWrapperProps, React.HTMLAttributes<HTMLDivElement> {
64
68
  /**
65
69
  * Image elements
66
70
  */
67
- children: ReactNode;
71
+ children: React.ReactNode;
68
72
  }
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { EditorialLink } from '../types';
1
+ import { ImgHTMLAttributes, ReactNode } from 'react';
2
+ import { EditorialLink, ThemeColor } from '../types';
3
3
  import { HeaderHierarchy, TypographyLevel } from './typography';
4
4
  export interface CustomSponsorImageData {
5
5
  /**
@@ -190,3 +190,21 @@ export interface IPageHeadingPromoProps {
190
190
  /** Custom CSS classes */
191
191
  className?: string;
192
192
  }
193
+ export interface IPageHeadingHighlightProps {
194
+ /**
195
+ * Image to display in the right hand panel, aspect ratio 4:3
196
+ */
197
+ image: ImgHTMLAttributes<HTMLImageElement>;
198
+ /**
199
+ * Optional change to background color
200
+ */
201
+ background?: ThemeColor;
202
+ /**
203
+ * The component(s) to be wrapped in the page header
204
+ */
205
+ children: ReactNode;
206
+ /**
207
+ * Custom CSS classes
208
+ */
209
+ className?: string;
210
+ }
@@ -203,6 +203,10 @@ export interface INavigationProps {
203
203
  * Additional CSS class names to apply to the navigation component.
204
204
  */
205
205
  className?: string;
206
+ /**
207
+ * Defines which tag the button should skip to. Default: 'main-content'.
208
+ */
209
+ skipToId?: string;
206
210
  }
207
211
  export interface ISearchBarProps {
208
212
  /**
@@ -147,6 +147,10 @@ export interface ITabProps {
147
147
  * Additional CSS class names to apply to the navigation component.
148
148
  */
149
149
  className?: string;
150
+ /**
151
+ * The unique ID to assign to the link element.
152
+ */
153
+ tabLinkId?: string;
150
154
  /**
151
155
  * Defines the ARIA role of the element for accessibility purposes.
152
156
  */
@@ -163,6 +167,10 @@ export interface ITabProps {
163
167
  * Defines if it is needed to trim the text of the Tab and add 3 dots in the end
164
168
  */
165
169
  trimText?: boolean;
170
+ /**
171
+ * data-testid string for easier testing
172
+ */
173
+ dataTestId?: string;
166
174
  /**
167
175
  * Boolean indicating if the Tab is open.
168
176
  */
@@ -218,7 +226,11 @@ export interface IDropdownProps {
218
226
  */
219
227
  ariaLabel?: string;
220
228
  /**
221
- * Defines if it is needed to trim the text of the Tab and add 3 dots in the end
229
+ * The unique ID to assign to the link element inside the tab.
230
+ */
231
+ tabLinkId?: string;
232
+ /**
233
+ * Defines if it is needed to trim the text of the Tab and add 3 dots in the end
222
234
  */
223
235
  trimTabText?: boolean;
224
236
  }
@@ -342,10 +354,10 @@ export declare type ListingRole = {
342
354
  dataROH?: string;
343
355
  };
344
356
  export interface IPeopleListing {
345
- /**
346
- * List of roles to be displayed
347
- */
357
+ /** List of roles to be displayed */
348
358
  roles: ListingRole[];
359
+ /** Custom CSS classes */
360
+ className?: string;
349
361
  }
350
362
  export interface IPagination {
351
363
  /**
@@ -421,6 +433,67 @@ export declare type IHotFilterProps = {
421
433
  selectedIndex?: number;
422
434
  onSelect?: (index: number) => void;
423
435
  };
436
+ export declare type ICastFilterItem = Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'aria-label' | 'role'> & {
437
+ /**
438
+ * Name of the cast member shown below the image circle. Required.
439
+ */
440
+ name: string;
441
+ /**
442
+ * Image source for the image to be shown. Optional but if not included an unaesthetic placeholder will show.
443
+ */
444
+ image?: string;
445
+ onClick?: () => void;
446
+ };
447
+ export declare type ICastFiltersProps = {
448
+ className?: string;
449
+ /**
450
+ * Array of cast to filter by.
451
+ */
452
+ cast: ICastFilterItem[];
453
+ /**
454
+ * Indices of currently selected cast in the `cast` array.
455
+ */
456
+ selectedIndices?: number[];
457
+ /**
458
+ * Text shown at the top of the component, e.g. 'Filter by cast'. If this is not provided
459
+ * the component will render without any.
460
+ */
461
+ headingText?: string;
462
+ /**
463
+ * Override the text of the primary CTA. Default is 'Apply'.
464
+ */
465
+ ctaText?: string;
466
+ /**
467
+ * Override the text of the text link. Default is 'Clear'.
468
+ */
469
+ textLinkText?: string;
470
+ /**
471
+ * Text to show if no selection is made.
472
+ */
473
+ emptySelectionText?: string;
474
+ /**
475
+ * Default image to show in cases where a cast member image prop is missing.
476
+ * If this is undefined then a light grey background will be displayed instead.
477
+ */
478
+ placeholderImage?: string;
479
+ /**
480
+ * Description to be used as aria-roledescription of the cast filter listbox.
481
+ * Read out by screen readers to describe the contents of the list.
482
+ */
483
+ listRoleDescription?: string;
484
+ /**
485
+ * Handle selecting individual cast filters.
486
+ */
487
+ onSelect?: (index: number) => void;
488
+ /**
489
+ * Handle clicking the primary CTA.
490
+ */
491
+ onApply?: (indices: number[]) => void;
492
+ /**
493
+ * Handle clicking the text link.
494
+ */
495
+ onClear?: () => void;
496
+ };
424
497
  export interface ISponsorshipProps {
425
498
  /**
426
499
  * Source URL for Sponsorship IFRAME.
@@ -479,6 +552,10 @@ export interface IBodyContentProps {
479
552
  columnSpanDevice?: number;
480
553
  /** Custom CSS classes */
481
554
  className?: string;
555
+ /** Set to true to wrap the content in a Grid component */
556
+ renderGrid?: boolean;
557
+ /** Set to true to render the GridItem component */
558
+ renderGridItem?: boolean;
482
559
  }
483
560
  export declare type SectionTitleSize = 'small' | 'large';
484
561
  export interface ISectionTitleProps {
@@ -662,3 +739,27 @@ export declare enum LinkTarget {
662
739
  */
663
740
  Blank = "_blank"
664
741
  }
742
+ export interface ISkipToMainProps {
743
+ /**
744
+ * Defines which tag the button should skip to.
745
+ */
746
+ skipToId?: string;
747
+ }
748
+ export declare type PaywallProps = {
749
+ /** Custom CSS classes */
750
+ className?: string;
751
+ /** Heading text */
752
+ title: string;
753
+ /** Introduction text */
754
+ intro?: string;
755
+ /** Body HTML */
756
+ description: string;
757
+ /** CTA text */
758
+ buttonText: string;
759
+ /** CTA URL */
760
+ buttonUrl: string;
761
+ /** Text before sign-in link (required to show sign-in link) */
762
+ signInPromptText?: string;
763
+ /** Sign-in link URL (required to show sign-in link) */
764
+ signInLinkUrl?: string;
765
+ };
@@ -68,24 +68,16 @@ export interface IUpsellCardsProps {
68
68
  theme?: ThemeType;
69
69
  }
70
70
  export interface IUpsellSectionProps {
71
- /**
72
- * Upsell Section title
73
- */
71
+ /** Upsell Section title */
74
72
  title?: string;
75
- /**
76
- * Richtext section
77
- */
73
+ /** Richtext section */
78
74
  richText?: string;
79
- /**
80
- * CTA link. Eg. for sign in.
81
- */
75
+ /** CTA link. Eg. for sign in. */
82
76
  link?: EditorialLink;
83
- /**
84
- * Array of upsellCards
85
- */
77
+ /** Array of upsellCards */
86
78
  upsellCards?: IUpsellCardProps[];
87
- /**
88
- * Theme options
89
- */
79
+ /** Theme options */
90
80
  theme?: ThemeType;
81
+ /** Custom CSS classes */
82
+ className?: string;
91
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@royaloperahouse/harmonic",
3
- "version": "0.17.0-a",
3
+ "version": "0.17.0-b",
4
4
  "author": "Royal Opera House",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",