@royaloperahouse/chord 0.3.5 → 0.3.9

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 (60) hide show
  1. package/CHANGELOG.md +39 -16
  2. package/README.md +1 -1
  3. package/dist/chord.cjs.development.js +1391 -420
  4. package/dist/chord.cjs.development.js.map +1 -1
  5. package/dist/chord.cjs.production.min.js +1 -1
  6. package/dist/chord.cjs.production.min.js.map +1 -1
  7. package/dist/chord.esm.js +1377 -421
  8. package/dist/chord.esm.js.map +1 -1
  9. package/dist/components/atoms/Badge/Badge.style.d.ts +2 -0
  10. package/dist/components/atoms/Badge/CinemaBadge.d.ts +4 -0
  11. package/dist/components/atoms/Badge/StreamBadge.d.ts +4 -0
  12. package/dist/components/atoms/Badge/index.d.ts +3 -0
  13. package/dist/components/atoms/ControlledDropdown/ControlledDropdown.d.ts +4 -0
  14. package/dist/components/atoms/ControlledDropdown/ControlledDropdown.style.d.ts +4 -0
  15. package/dist/components/atoms/ControlledDropdown/index.d.ts +2 -0
  16. package/dist/components/atoms/SecondaryLogo/SecodaryLogo.style.d.ts +2 -0
  17. package/dist/components/atoms/SecondaryLogo/SecondaryLogo.d.ts +4 -0
  18. package/dist/components/atoms/SecondaryLogo/index.d.ts +2 -0
  19. package/dist/components/atoms/TypeTags/TypeTags.style.d.ts +0 -1
  20. package/dist/components/atoms/Typography/Typography.d.ts +7 -0
  21. package/dist/components/atoms/Typography/Typography.style.d.ts +3 -0
  22. package/dist/components/atoms/Typography/index.d.ts +2 -0
  23. package/dist/components/atoms/index.d.ts +4 -2
  24. package/dist/components/index.d.ts +4 -4
  25. package/dist/components/molecules/Accordion/Accordion.style.d.ts +2 -2
  26. package/dist/components/molecules/Card/Card.style.d.ts +3 -2
  27. package/dist/components/molecules/ImageWithCaption/ImageWithCaption.d.ts +4 -0
  28. package/dist/components/molecules/ImageWithCaption/ImageWithCaption.style.d.ts +2 -0
  29. package/dist/components/molecules/ImageWithCaption/index.d.ts +2 -0
  30. package/dist/components/molecules/PageHeading/Cinema/Cinema.d.ts +4 -0
  31. package/dist/components/molecules/PageHeading/Cinema/index.d.ts +2 -0
  32. package/dist/components/molecules/PageHeading/Core/Core.d.ts +4 -0
  33. package/dist/components/molecules/PageHeading/Core/index.d.ts +2 -0
  34. package/dist/components/molecules/PageHeading/Impact/Impact.d.ts +4 -0
  35. package/dist/components/molecules/PageHeading/Impact/Impact.style.d.ts +8 -0
  36. package/dist/components/molecules/PageHeading/Impact/index.d.ts +2 -0
  37. package/dist/components/molecules/PageHeading/PageHeading.d.ts +4 -0
  38. package/dist/components/molecules/PageHeading/PageHeading.style.d.ts +7 -0
  39. package/dist/components/molecules/PageHeading/Stream/Stream.d.ts +4 -0
  40. package/dist/components/molecules/PageHeading/Stream/index.d.ts +2 -0
  41. package/dist/components/molecules/PageHeading/index.d.ts +5 -0
  42. package/dist/components/molecules/PromoWithTitle/PromoWithTitle.style.d.ts +1 -1
  43. package/dist/components/molecules/index.d.ts +4 -1
  44. package/dist/components/organisms/Carousel/Carousel.d.ts +5 -0
  45. package/dist/components/organisms/Carousel/Carousel.style.d.ts +5 -0
  46. package/dist/components/organisms/Carousel/index.d.ts +2 -0
  47. package/dist/components/organisms/index.d.ts +2 -1
  48. package/dist/index.d.ts +3 -2
  49. package/dist/styles/themes.d.ts +252 -24
  50. package/dist/styles/zIndexes.d.ts +4 -0
  51. package/dist/types/card.d.ts +28 -3
  52. package/dist/types/carousel.d.ts +48 -0
  53. package/dist/types/editorial.d.ts +81 -4
  54. package/dist/types/image.d.ts +15 -0
  55. package/dist/types/types.d.ts +79 -18
  56. package/dist/types/typography.d.ts +73 -0
  57. package/package.json +4 -1
  58. package/dist/components/atoms/Heading/Heading.d.ts +0 -3
  59. package/dist/components/atoms/Heading/Heading.style.d.ts +0 -3
  60. package/dist/components/atoms/Heading/index.d.ts +0 -2
@@ -0,0 +1,48 @@
1
+ import { ReactElement } from 'react';
2
+ import { ICardProps } from './card';
3
+ import { IImageWithCaptionProps } from './image';
4
+ export declare enum CarouselType {
5
+ Image = "image",
6
+ SmallCard = "SmallCard",
7
+ LargeCard = "LargeCard"
8
+ }
9
+ export interface ICarouselProps {
10
+ /**
11
+ * Carousel title
12
+ */
13
+ title: string;
14
+ /**
15
+ * Carousel type.
16
+ */
17
+ type: CarouselType;
18
+ /**
19
+ * Only for image type. It sets the height in pixels of the slides in devices(default 300)
20
+ */
21
+ imagesHeightDevice?: number;
22
+ /**
23
+ * Only for image type. It sets the height in pixels of the slides in desktop(default 500)
24
+ */
25
+ imagesHeightDesktop?: number;
26
+ /**
27
+ * Carousel children (only Card and ImageAspectRatioWrapper children are allowed).
28
+ */
29
+ children: ReactElement<ICardProps | IImageWithCaptionProps>[];
30
+ }
31
+ export interface ICarouselWrapperProps {
32
+ /**
33
+ * Carousel has been activated or not
34
+ */
35
+ active: boolean;
36
+ /**
37
+ * Carousel type.
38
+ */
39
+ type: CarouselType;
40
+ /**
41
+ * Only for image type. It sets the height in pixels of the slides in devices(default 300)
42
+ */
43
+ imagesHeightDevice?: number;
44
+ /**
45
+ * Only for image type. It sets the height in pixels of the slides in desktop(default 500)
46
+ */
47
+ imagesHeightDesktop?: number;
48
+ }
@@ -1,4 +1,5 @@
1
- import { AnchorHTMLAttributes, MouseEventHandler, ReactElement } from 'react';
1
+ import { AnchorHTMLAttributes, MouseEventHandler, ReactElement, ReactNode } from 'react';
2
+ import { StyledProps } from 'styled-components';
2
3
  import { DirectionType, IconNameType } from './iconTypes';
3
4
  import { Colors } from './types';
4
5
  export interface IEditorialProps {
@@ -23,9 +24,17 @@ export interface IEditorialGridProps {
23
24
  /**
24
25
  * Sets if the image will be placed in the right (false) or the left (true)
25
26
  */
26
- imageToLeft: boolean;
27
+ imageToLeft?: boolean;
28
+ /**
29
+ * Set the length of primary button text
30
+ */
31
+ primaryButtonTextLength?: number;
32
+ /**
33
+ * Set the length of tertiary button text
34
+ */
35
+ tertiaryButtonTextLength?: number;
27
36
  }
28
- export declare type PromoWithTitleLink = AnchorHTMLAttributes<HTMLAnchorElement> & {
37
+ export declare type EditorialLink = AnchorHTMLAttributes<HTMLAnchorElement> & {
29
38
  /**
30
39
  * Text inside the link
31
40
  */
@@ -46,8 +55,12 @@ export declare type PromoWithTitleLink = AnchorHTMLAttributes<HTMLAnchorElement>
46
55
  * Color of text and icon
47
56
  */
48
57
  color?: Colors;
58
+ /**
59
+ * background color
60
+ */
61
+ bgColor?: Colors;
49
62
  };
50
- export declare type PromoLinks = [PromoWithTitleLink, PromoWithTitleLink?];
63
+ export declare type PromoLinks = [EditorialLink, EditorialLink?];
51
64
  export interface IPromoWithTitleProps {
52
65
  /**
53
66
  * Text placed in the editorial component
@@ -78,3 +91,67 @@ export interface IPromoWithTitleProps {
78
91
  */
79
92
  links?: PromoLinks;
80
93
  }
94
+ export interface IThemePageHeadingProps {
95
+ /**
96
+ * Title placed in the page heading component
97
+ */
98
+ title: string;
99
+ /**
100
+ * Text placed in the page heading component
101
+ */
102
+ text?: string;
103
+ /**
104
+ * Link placed in the page heading component
105
+ */
106
+ link?: EditorialLink;
107
+ /**
108
+ * Boolean to show/hide sponsorship logo (default true)
109
+ */
110
+ sponsor?: boolean;
111
+ }
112
+ export interface IPageHeadingProps extends IThemePageHeadingProps {
113
+ /**
114
+ * Logo to be placed in page heading component
115
+ */
116
+ children?: ReactNode;
117
+ }
118
+ export interface IPageHeadingImpactProps {
119
+ /**
120
+ * Text placed in the impact component
121
+ */
122
+ text?: string;
123
+ /**
124
+ * Link placed in the impact component
125
+ */
126
+ link?: EditorialLink;
127
+ /**
128
+ * Boolean to show/hide sponsorship logo (default true)
129
+ */
130
+ sponsor?: boolean;
131
+ /**
132
+ * Background url for desktops
133
+ */
134
+ bgUrlDesktop: string;
135
+ /**
136
+ * Background url for devices
137
+ */
138
+ bgUrlDevice?: string;
139
+ /**
140
+ * Logo to be placed in page heading component
141
+ */
142
+ children?: ReactNode;
143
+ /**
144
+ * Internal anchor ref
145
+ */
146
+ scrollHref?: string;
147
+ }
148
+ export interface IImpactWrappersStyledProps extends StyledProps<any> {
149
+ /**
150
+ * Background url for desktops
151
+ */
152
+ bgUrlDesktop: string;
153
+ /**
154
+ * Background url for devices
155
+ */
156
+ bgUrlDevice?: string;
157
+ }
@@ -1,3 +1,4 @@
1
+ import { ReactElement } from 'react';
1
2
  export declare enum AspectRatio {
2
3
  '1:1' = "1 / 1",
3
4
  '3:4' = "3 / 4",
@@ -10,3 +11,17 @@ export interface IImageAspectRatioWrapperProps {
10
11
  */
11
12
  aspectRatio?: AspectRatio;
12
13
  }
14
+ export interface IImageWithCaptionProps {
15
+ /**
16
+ * Aspect ratio of the contained image
17
+ */
18
+ aspectRatio?: AspectRatio;
19
+ /**
20
+ * Image caption or credit
21
+ */
22
+ caption: string;
23
+ /**
24
+ * Image element
25
+ */
26
+ children: ReactElement<HTMLImageElement>;
27
+ }
@@ -1,14 +1,6 @@
1
1
  import { ReactNode, AnchorHTMLAttributes, MouseEventHandler } from 'react';
2
2
  import { StyledProps } from 'styled-components';
3
3
  import { IconNameType, DirectionType } from './iconTypes';
4
- export declare enum HeadingLevel {
5
- H1 = 1,
6
- H2 = 2,
7
- H3 = 3,
8
- H4 = 4,
9
- H5 = 5,
10
- H6 = 6
11
- }
12
4
  export declare enum Colors {
13
5
  White = "white",
14
6
  Black = "black",
@@ -24,13 +16,6 @@ export declare enum Colors {
24
16
  Stream = "stream",
25
17
  Cinema = "cinema"
26
18
  }
27
- export interface IHeadingProps {
28
- level: HeadingLevel;
29
- children: ReactNode;
30
- }
31
- export interface IHeadingWrapperProps extends StyledProps<any> {
32
- level: HeadingLevel;
33
- }
34
19
  export declare enum ThemeType {
35
20
  Core = "core",
36
21
  Stream = "stream",
@@ -170,6 +155,54 @@ export interface IDropdownProps {
170
155
  */
171
156
  colorPrimary?: string;
172
157
  }
158
+ export interface IControlledDropdownProps {
159
+ /**
160
+ * Text displayed as heading in the dropdown
161
+ */
162
+ text: string;
163
+ /**
164
+ * options to display
165
+ */
166
+ options?: IOptionItem[];
167
+ /**
168
+ * Color for active status (default primary)
169
+ */
170
+ activeColor?: string;
171
+ /**
172
+ * Set if the dropdown is active or not
173
+ */
174
+ active?: boolean;
175
+ /**
176
+ * Callback called when header is clicked
177
+ */
178
+ onClick: () => void;
179
+ /**
180
+ * Callback called when an option is clicked
181
+ */
182
+ onOptionClick?: (s: string) => void;
183
+ /**
184
+ * Mouse enter event handler
185
+ */
186
+ onMouseEnter?: () => void;
187
+ /**
188
+ * Mouse leave event handler
189
+ */
190
+ onMouseLeave?: () => void;
191
+ /**
192
+ * Callback called to reset dropdown behaviour
193
+ */
194
+ onReset?: () => void;
195
+ }
196
+ export interface IControlledDropdownHeaderProps extends StyledProps<any> {
197
+ /**
198
+ * Color for active status (default primary)
199
+ */
200
+ activeColor: string;
201
+ /**
202
+ * Set if the dropdown is active or not
203
+ */
204
+ active: boolean;
205
+ }
173
206
  export interface IIndividualListing {
174
207
  role: string;
175
208
  name: string;
@@ -263,6 +296,22 @@ export interface ITextOnlyProps {
263
296
  * Text placed in the TextOnly component
264
297
  */
265
298
  text: string;
299
+ /**
300
+ * Set columnstart in Desktop
301
+ */
302
+ columnStartDesktop?: number;
303
+ /**
304
+ * Set columnSpan in Desktop
305
+ */
306
+ columnSpanDesktop?: number;
307
+ /**
308
+ * Set columnstart in Device
309
+ */
310
+ columnStartDevice?: number;
311
+ /**
312
+ * Set columnSpam in Device
313
+ */
314
+ columnSpanDevice?: number;
266
315
  }
267
316
  export declare type SectionTitleSize = 'small' | 'large';
268
317
  export interface ISectionTitleProps {
@@ -279,15 +328,27 @@ export interface ISectionTitleProps {
279
328
  */
280
329
  description?: string;
281
330
  }
331
+ export interface ILogosProps {
332
+ /**
333
+ * Color used to fill logos.
334
+ */
335
+ fillColor?: Colors.White | Colors.Black;
336
+ }
337
+ export interface ILogosStyledProps extends StyledProps<any> {
338
+ /**
339
+ * Color used to fill logos.
340
+ */
341
+ fillColor?: Colors.White | Colors.Black;
342
+ }
282
343
  export interface IAccordionProps {
283
344
  /**
284
345
  * Title to display.
285
346
  */
286
- title: string;
347
+ title?: string;
287
348
  /**
288
- * Text to render when accordion is opened
349
+ * The component to be wrapped into the accordion
289
350
  */
290
- text: string;
351
+ children?: ReactNode;
291
352
  /**
292
353
  * Set if accordions are stacked
293
354
  */
@@ -0,0 +1,73 @@
1
+ import { ReactNode } from 'react';
2
+ import { StyledProps } from 'styled-components';
3
+ export declare type TypographyLevel = 1 | 2 | 3 | 4 | 5 | 6;
4
+ export declare type AltHeaderLevel = 3 | 4 | 5 | 6;
5
+ export declare type BodyLevel = 1 | 2 | 3;
6
+ export declare type SubtitleLevel = 1 | 2;
7
+ export declare type OverlineLevel = 1 | 2;
8
+ export declare type TypographyType = 'header' | 'altHeader' | 'body' | 'subtitle' | 'overline';
9
+ export interface ITypographyWrapperProps extends StyledProps<any> {
10
+ /**
11
+ * Typography level to use for generic Typography subcomponent.
12
+ */
13
+ level: TypographyLevel;
14
+ /**
15
+ * Typography type to use for generic Typography subcomponent.
16
+ */
17
+ typography: TypographyType;
18
+ }
19
+ interface IGenericTypography {
20
+ /**
21
+ * text or html block to wrap in styled tag.
22
+ */
23
+ children: ReactNode;
24
+ }
25
+ export interface IStyledTag extends ITypographyWrapperProps, IGenericTypography {
26
+ /**
27
+ * HTML tag to use to render component, by default div.
28
+ */
29
+ tag?: React.ElementType;
30
+ }
31
+ export interface IHeaderProps extends IGenericTypography {
32
+ /**
33
+ * Header level, 1, 2, 3, 4, 5 or 6.
34
+ */
35
+ level: TypographyLevel;
36
+ }
37
+ export interface IAltHeaderProps extends IGenericTypography {
38
+ /**
39
+ * AltHeader level, 3, 4, 5 or 6.
40
+ */
41
+ level: AltHeaderLevel;
42
+ }
43
+ export interface IBodyTextProps extends IGenericTypography {
44
+ /**
45
+ * BodyText level, 1, 2 or 3.
46
+ */
47
+ level: BodyLevel;
48
+ /**
49
+ * HTML tag to use to render BodyText, by default div.
50
+ */
51
+ tag?: React.ElementType;
52
+ }
53
+ export interface ISubtitleProps extends IGenericTypography {
54
+ /**
55
+ * Subtitle level, 1 or 2.
56
+ */
57
+ level: SubtitleLevel;
58
+ /**
59
+ * HTML tag to use to render Subtitle, by default div.
60
+ */
61
+ tag?: React.ElementType;
62
+ }
63
+ export interface IOverlineProps extends IGenericTypography {
64
+ /**
65
+ * Overline level, 1 or 2.
66
+ */
67
+ level: OverlineLevel;
68
+ /**
69
+ * HTML tag to use to render Overline, by default div.
70
+ */
71
+ tag?: React.ElementType;
72
+ }
73
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@royaloperahouse/chord",
3
- "version": "0.3.5",
3
+ "version": "0.3.9",
4
4
  "author": "Royal Opera House",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -70,6 +70,7 @@
70
70
  },
71
71
  "devDependencies": {
72
72
  "@babel/core": "^7.16.0",
73
+ "@babel/plugin-transform-modules-commonjs": "^7.16.0",
73
74
  "@size-limit/preset-small-lib": "^6.0.4",
74
75
  "@storybook/addon-a11y": "^6.3.12",
75
76
  "@storybook/addon-essentials": "^6.3.12",
@@ -86,6 +87,7 @@
86
87
  "@types/react-dom": "^17.0.11",
87
88
  "@types/react-test-renderer": "^17.0.1",
88
89
  "@types/styled-components": "^5.1.15",
90
+ "@types/swiper": "^5.4.3",
89
91
  "@types/testing-library__jest-dom": "^5.14.1",
90
92
  "babel-loader": "^8.2.3",
91
93
  "husky": "^7.0.4",
@@ -95,6 +97,7 @@
95
97
  "size-limit": "^6.0.4",
96
98
  "storybook-addon-designs": "^6.2.0",
97
99
  "storybook-addon-pseudo-states": "^1.0.0",
100
+ "swiper": "^7.3.1",
98
101
  "ts-jest": "^27.0.7",
99
102
  "tsdx": "^0.14.1",
100
103
  "tslib": "^2.3.1",
@@ -1,3 +0,0 @@
1
- import { IHeadingProps } from '../../../types/types';
2
- declare const Heading: ({ level, children }: IHeadingProps) => JSX.Element;
3
- export default Heading;
@@ -1,3 +0,0 @@
1
- import { IHeadingWrapperProps } from '../../../types/types';
2
- declare const HeaderWrapper: import("styled-components").StyledComponent<"h1", any, IHeadingWrapperProps, never>;
3
- export default HeaderWrapper;
@@ -1,2 +0,0 @@
1
- import Heading from './Heading';
2
- export default Heading;