@royaloperahouse/chord 2.2.8 → 2.2.9-a-chord-development

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,4 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { IAuxiliaryButtonProps } from '../../../../types';
3
+ declare const AuxiliaryButton: FunctionComponent<IAuxiliaryButtonProps>;
4
+ export default AuxiliaryButton;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IAuxiliaryButtonProps } from '../../../../types';
3
+ declare const AuxiliaryButtonWrapper: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../../../../types/buttonTypes").IButtonProps>, any, IAuxiliaryButtonProps, never>;
4
+ export default AuxiliaryButtonWrapper;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { IconSVGProps } from '../../../../../types/iconTypes';
3
+ declare const _default: ({ color }: IconSVGProps) => React.ReactElement;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { IconSVGProps } from '../../../../../types/iconTypes';
3
+ declare const _default: ({ color }: IconSVGProps) => React.ReactElement;
4
+ export default _default;
@@ -22,6 +22,7 @@ export declare const IconLibrary: {
22
22
  EditMyList: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
23
23
  Email: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
24
24
  Expand: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
25
+ Expand12px: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
25
26
  ExternalLink: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
26
27
  Facebook: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
27
28
  Favourite: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
@@ -51,6 +52,7 @@ export declare const IconLibrary: {
51
52
  Refresh: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
52
53
  Reminder: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
53
54
  Remove: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
55
+ Remove12px: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
54
56
  Restart: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
55
57
  Search: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
56
58
  Seat: ({ color }: import("../../../../types/iconTypes").IconSVGProps) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
@@ -12,11 +12,13 @@ export declare const ContentContainer: import("styled-components").StyledCompone
12
12
  export declare const TitleContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
13
13
  export declare const TitleContainerMobile: import("styled-components").StyledComponent<"div", any, {}, never>;
14
14
  export declare const TextContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
15
+ export declare const HighlightTextContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
15
16
  export declare const SubtitleContainer: import("styled-components").StyledComponent<"span", any, {}, never>;
16
17
  export declare const LabelContainer: import("styled-components").StyledComponent<"div", any, {
17
18
  isVisible: boolean;
18
19
  isGridCard: boolean;
19
20
  }, never>;
21
+ export declare const ExtraActionsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
20
22
  export declare const LabelElements: import("styled-components").StyledComponent<"div", any, {
21
23
  bgColor?: Colors | undefined;
22
24
  }, never>;
@@ -4,4 +4,4 @@ import PageHeadingImpact from './Impact';
4
4
  import PageHeadingPanel from './Panel';
5
5
  import PageHeadingStream from './Stream';
6
6
  import PageHeadingCompact from './Compact/Compact';
7
- export { PageHeadingCinema, PageHeadingCore, PageHeadingImpact, PageHeadingStream, PageHeadingCompact, PageHeadingPanel, };
7
+ export { PageHeadingCinema, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, PageHeadingCompact, };
@@ -3,3 +3,4 @@ export declare const CreditListingWrapper: import("styled-components").StyledCom
3
3
  export declare const DescriptionWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
4
  export declare const RoleWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
5
5
  export declare const CreditWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const CreditBodyWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -25,6 +25,6 @@ import ImageWithCaption from './ImageWithCaption';
25
25
  import Quote from './Quote';
26
26
  import MiniCard from './MiniCard';
27
27
  import ReadMore from './ReadMore';
28
- import AuxiliaryNav from './AuxiliaryNav';
29
28
  import PasswordStrength from './PasswordStrength';
29
+ import AuxiliaryNav from './AuxiliaryNav';
30
30
  export { Accordion, Accordions, AnnouncementBanner, AuxiliaryNav, Card, Cards, ContactCard, ContentSummary, CreditListing, Editorial, ImageWithCaption, Information, MiniCard, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, PasswordStrength, Pagination, PeopleListing, PromoWithTags, PromoWithTitle, RadioGroup, RadioGroup2, ReadMore, Quote, StatusBanner, SectionTitle, SearchBar, Select, Tabs, TextOnly, UpsellCard, };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, BodyText, Card, Cards, CinemaBadge, ContactCard, ContentSummary, ControlledDropdown, CreditListing, Editorial, Footer, GlobalStyles, Grid, GridItem, Header, Icon, ImageAspectRatioWrapper, ImageWithCaption, Information, LiveChat, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Sponsorship, StickyBar, Stepper, StreamBadge, Subtitle, TertiaryButton, TextOnly, ThemeProvider, TitleWithCTA, Tab, TabLink, Tabs, TextArea, TextField, TextLink, Tickbox, Tickbox2, Timer, TypeTags, UpsellCard, UpsellSection, Quote } from './components';
1
+ import { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, BodyText, Card, Cards, CinemaBadge, ContactCard, ContentSummary, ControlledDropdown, CreditListing, Editorial, Footer, GlobalStyles, Grid, GridItem, Header, Icon, ImageAspectRatioWrapper, ImageWithCaption, Information, LiveChat, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Sponsorship, Stepper, StickyBar, StreamBadge, Subtitle, TertiaryButton, TextOnly, ThemeProvider, TitleWithCTA, Tab, TabLink, Tabs, TextArea, TextField, TextLink, Tickbox, Tickbox2, Timer, TypeTags, UpsellCard, UpsellSection, Quote } from './components';
2
2
  import { devices, breakpoints } from './styles/viewports';
3
3
  import zIndexes from './styles/zIndexes';
4
4
  import { AspectRatio, ButtonType, CarouselType, Colors, IconNameType, IntegratedTimerProps, ITimerProps, TickboxMode, ThemeType, EditorialLink } from './types';
5
5
  import { MiniCard } from './components/molecules';
6
+ import { BrandingStyle } from './types/impactHeader';
6
7
  import { ModalWindow } from './components/organisms';
7
- export { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, AspectRatio, BodyText, breakpoints, ButtonType, Card, Cards, CarouselType, CinemaBadge, Colors, ContactCard, ContentSummary, ControlledDropdown, CreditListing, devices, Editorial, EditorialLink, Footer, GlobalStyles, Grid, GridItem, Header, Icon, IconNameType, ImageAspectRatioWrapper, ImageWithCaption, Information, ITimerProps, IntegratedTimerProps, LiveChat, MiniCard, ModalWindow, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Sponsorship, StickyBar, Stepper, StreamBadge, Subtitle, Tab, TabLink, Tabs, TertiaryButton, TextArea, TextField, TextLink, TextOnly, ThemeProvider, ThemeType, TitleWithCTA, Tickbox, Tickbox2, TickboxMode, Timer, TypeTags, UpsellCard, UpsellSection, Quote, zIndexes, };
8
+ import AuxiliaryButton from './components/atoms/Buttons/Auxiliary/AuxiliaryButton';
9
+ export { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryButton, AuxiliaryNav, AspectRatio, BodyText, BrandingStyle, breakpoints, ButtonType, Card, Cards, CarouselType, CinemaBadge, Colors, ContactCard, ContentSummary, ControlledDropdown, CreditListing, devices, Editorial, EditorialLink, Footer, GlobalStyles, Grid, GridItem, Header, Icon, IconNameType, ImageAspectRatioWrapper, ImageWithCaption, Information, ITimerProps, IntegratedTimerProps, LiveChat, MiniCard, ModalWindow, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Sponsorship, Stepper, StickyBar, StreamBadge, Subtitle, Tab, TabLink, Tabs, TertiaryButton, TextArea, TextField, TextLink, TextOnly, ThemeProvider, ThemeType, TitleWithCTA, Tickbox, Tickbox2, TickboxMode, Timer, TypeTags, UpsellCard, UpsellSection, Quote, zIndexes, };
@@ -13,6 +13,7 @@ export declare const core: {
13
13
  primaryButton: string;
14
14
  secondaryButton: string;
15
15
  tertiaryButton: string;
16
+ auxiliaryButton: string;
16
17
  primaryButtonReverseBg: string;
17
18
  primaryButtonReverse: string;
18
19
  core: string;
@@ -477,10 +478,11 @@ export declare const stream: {
477
478
  colors: {
478
479
  primary: string;
479
480
  primaryButton: string;
480
- secondaryButton: string;
481
- tertiaryButton: string;
482
481
  primaryButtonReverseBg: string;
483
482
  primaryButtonReverse: string;
483
+ secondaryButton: string;
484
+ tertiaryButton: string;
485
+ auxiliaryButton: string;
484
486
  core: string;
485
487
  stream: string;
486
488
  cinema: string;
@@ -943,10 +945,11 @@ export declare const cinema: {
943
945
  colors: {
944
946
  primary: string;
945
947
  primaryButton: string;
946
- secondaryButton: string;
947
- tertiaryButton: string;
948
948
  primaryButtonReverseBg: string;
949
949
  primaryButtonReverse: string;
950
+ secondaryButton: string;
951
+ tertiaryButton: string;
952
+ auxiliaryButton: string;
950
953
  core: string;
951
954
  stream: string;
952
955
  cinema: string;
@@ -1409,10 +1412,11 @@ export declare const schools: {
1409
1412
  colors: {
1410
1413
  primary: string;
1411
1414
  primaryButton: string;
1412
- secondaryButton: string;
1413
- tertiaryButton: string;
1414
1415
  primaryButtonReverseBg: string;
1415
1416
  primaryButtonReverse: string;
1417
+ secondaryButton: string;
1418
+ tertiaryButton: string;
1419
+ auxiliaryButton: string;
1416
1420
  core: string;
1417
1421
  stream: string;
1418
1422
  cinema: string;
@@ -1878,6 +1882,7 @@ export declare const themes: {
1878
1882
  primaryButton: string;
1879
1883
  secondaryButton: string;
1880
1884
  tertiaryButton: string;
1885
+ auxiliaryButton: string;
1881
1886
  primaryButtonReverseBg: string;
1882
1887
  primaryButtonReverse: string;
1883
1888
  core: string;
@@ -2342,10 +2347,11 @@ export declare const themes: {
2342
2347
  colors: {
2343
2348
  primary: string;
2344
2349
  primaryButton: string;
2345
- secondaryButton: string;
2346
- tertiaryButton: string;
2347
2350
  primaryButtonReverseBg: string;
2348
2351
  primaryButtonReverse: string;
2352
+ secondaryButton: string;
2353
+ tertiaryButton: string;
2354
+ auxiliaryButton: string;
2349
2355
  core: string;
2350
2356
  stream: string;
2351
2357
  cinema: string;
@@ -2808,10 +2814,11 @@ export declare const themes: {
2808
2814
  colors: {
2809
2815
  primary: string;
2810
2816
  primaryButton: string;
2811
- secondaryButton: string;
2812
- tertiaryButton: string;
2813
2817
  primaryButtonReverseBg: string;
2814
2818
  primaryButtonReverse: string;
2819
+ secondaryButton: string;
2820
+ tertiaryButton: string;
2821
+ auxiliaryButton: string;
2815
2822
  core: string;
2816
2823
  stream: string;
2817
2824
  cinema: string;
@@ -3283,10 +3290,11 @@ export declare const themes: {
3283
3290
  colors: {
3284
3291
  primary: string;
3285
3292
  primaryButton: string;
3286
- secondaryButton: string;
3287
- tertiaryButton: string;
3288
3293
  primaryButtonReverseBg: string;
3289
3294
  primaryButtonReverse: string;
3295
+ secondaryButton: string;
3296
+ tertiaryButton: string;
3297
+ auxiliaryButton: string;
3290
3298
  core: string;
3291
3299
  stream: string;
3292
3300
  cinema: string;
@@ -20,6 +20,10 @@ export interface IButtonProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
20
20
  * Direction of the icon used in the button
21
21
  */
22
22
  iconDirection?: DirectionType;
23
+ /**
24
+ * ClassName for the icon to be used in the button
25
+ */
26
+ iconClassName?: string;
23
27
  /**
24
28
  * Color of text and icon
25
29
  */
@@ -31,6 +35,16 @@ export interface IPrimaryButtonProps extends IButtonProps {
31
35
  */
32
36
  bgColor?: Colors;
33
37
  }
38
+ export interface IAuxiliaryButtonProps extends IButtonProps {
39
+ /**
40
+ * Button background color
41
+ */
42
+ bgColor?: Colors;
43
+ /**
44
+ * Function to be called when a button is clicked
45
+ */
46
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
47
+ }
34
48
  export interface ITertiaryButtonProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
35
49
  /**
36
50
  * Color of text and icon
@@ -1,5 +1,5 @@
1
1
  import { StyledProps } from 'styled-components';
2
- import { Colors, IconNameType } from '.';
2
+ import { Colors, EditorialLink, IconNameType } from '.';
3
3
  import { PromoLinks } from './editorial';
4
4
  import { DirectionType } from './iconTypes';
5
5
  export interface CardLabelProps {
@@ -33,6 +33,10 @@ export interface ICardProps {
33
33
  * Text placed in the Card component
34
34
  */
35
35
  text?: string;
36
+ /**
37
+ * Highlighted small text
38
+ */
39
+ highlightText?: string;
36
40
  /**
37
41
  * List of Type Tags to display.
38
42
  */
@@ -89,6 +93,10 @@ export interface ICardProps {
89
93
  * Defines if it is Card in the Grid or in the Carousel
90
94
  */
91
95
  isGridCard?: boolean;
96
+ /**
97
+ * Renders an auxiliary button when passed
98
+ */
99
+ auxiliaryCTA?: EditorialLink;
92
100
  }
93
101
  export interface ICardContentContainerProps extends StyledProps<any> {
94
102
  /**
@@ -53,7 +53,7 @@ export interface ITextFieldProps extends InputHTMLAttributes<HTMLInputElement> {
53
53
  * `password` type adds `Show/Hide` button over the input element.
54
54
  * Any other types don't change the view of the element, just change
55
55
  * accessibility stuff
56
- */
56
+ */
57
57
  type?: ITextFieldType;
58
58
  /**
59
59
  * A style prop that allows us to change what colours to
@@ -235,17 +235,8 @@ export interface IStepperProps {
235
235
  step?: number;
236
236
  /** An error message to be shown below the stepper.
237
237
  *
238
- * Default: `undefined`
239
238
  */
240
239
  error?: string;
241
- /**
242
- * A style prop that allows us to change what colours to
243
- * use for light or dark mode (e.g. text color, border color, etc...)
244
- * based on the background color.
245
- *
246
- * Defaults to `false`.
247
- */
248
- darkMode?: boolean;
249
240
  /**
250
241
  * Set disapled state
251
242
  */
@@ -254,6 +245,18 @@ export interface IStepperProps {
254
245
  * Minimum value allowed in the stepper
255
246
  */
256
247
  min?: number;
248
+ /**
249
+ * A style prop that allows us to change what colours to
250
+ * use for light or dark mode (e.g. text color, border color, etc...)
251
+ * based on the background color.
252
+ *
253
+ * Defaults to `false`.
254
+ * Specify whether or not the containing element has a dark background.
255
+ * This property affects the border colours for focused and error states.
256
+ *
257
+ * Default: `false`
258
+ */
259
+ darkMode?: boolean;
257
260
  /**
258
261
  * Maximum value allowed in the stepper
259
262
  */
@@ -5,10 +5,10 @@ import { CarouselType } from './carousel';
5
5
  import { IconNameType } from './iconTypes';
6
6
  import { AspectRatio } from './image';
7
7
  import { TickboxMode } from './tickbox';
8
- import { ButtonType } from './buttonTypes';
8
+ import { ButtonType, IAuxiliaryButtonProps } from './buttonTypes';
9
9
  import { EditorialLink } from './editorial';
10
10
  import { IPageHeadingCompactProps } from './impactHeader';
11
11
  import { IntegratedTimerProps, ITimerProps } from './timer';
12
12
  import { ICreditListing } from './creditListing';
13
13
  import { ModalWindowProps } from './modalWindow';
14
- export { AspectRatio, ButtonType, CarouselType, Colors, ICreditListing, EditorialLink, FooterData, IconNameType, IPageHeadingCompactProps, INavigationProps, INavTopProps, IntegratedTimerProps, ITimerProps, ModalWindowProps, TickboxMode, ThemeType, };
14
+ export { AspectRatio, ButtonType, CarouselType, Colors, EditorialLink, FooterData, IconNameType, IAuxiliaryButtonProps, ICreditListing, IPageHeadingCompactProps, INavigationProps, INavTopProps, IntegratedTimerProps, ITimerProps, ModalWindowProps, TickboxMode, ThemeType, };
@@ -19,10 +19,10 @@ export interface IPasswordStrengthProps {
19
19
  */
20
20
  sectionsColor?: Colors;
21
21
  /**
22
- * Color of active sections
23
- *
24
- * Default: Colors.Black
25
- */
22
+ * Color of active sections
23
+ *
24
+ * Default: Colors.Black
25
+ */
26
26
  activeSectionsColor?: Colors;
27
27
  /**
28
28
  * Text
@@ -40,12 +40,12 @@ export interface IPasswordStrengthProps {
40
40
  * Strength label text
41
41
  *
42
42
  * Default: ""
43
- */
43
+ */
44
44
  strengthLabel?: string;
45
45
  /**
46
46
  * Strength label text
47
47
  *
48
48
  * Default: Colors.Black
49
- */
49
+ */
50
50
  strengthLabelColor?: Colors;
51
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@royaloperahouse/chord",
3
- "version": "2.2.8",
3
+ "version": "2.2.9-a-chord-development",
4
4
  "author": "Royal Opera House",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -115,4 +115,4 @@
115
115
  "react-modal": "^3.16.1",
116
116
  "react-scrolllock": "^5.0.1"
117
117
  }
118
- }
118
+ }
package/README.GIT DELETED
@@ -1,277 +0,0 @@
1
- # Royal Opera House Chord - Front End Design System
2
-
3
- Welcome to The Royal Opera House Front End Design System, `@royaloperahouse/chord`
4
-
5
- This package is a library of UI components intended to be used in the ROH website.
6
-
7
- It uses React, TypeScript, TSDX and Storybook.
8
-
9
- The NPM packages are published at [https://www.npmjs.com/package/@royaloperahouse/chord](https://www.npmjs.com/package/@royaloperahouse/chord)
10
-
11
- The Storybook for the latest version of the library is hosted at [chord.roh.org.uk](chord.roh.org.uk)
12
-
13
-
14
- ## Prerequisites
15
- ---
16
-
17
- * Make sure the required package dependencies are installed using `yarn install`
18
-
19
- * If this is the first time you are working on Chord, make sure to run `yarn build` to build all the modules.
20
-
21
- * **To deploy the storybook publicly** you will need credentials for the **parent** 'Royal Opera House' AWS account in your `~/.aws/credentials` file.
22
- * The deploy script expects these to be called `[parent]`.
23
-
24
- * You can find these values at:
25
-
26
- *AWS 'Your Applications' page -> 'Royal Opera House' -> 'Developer Access' -> 'Command line or programmatic access'*
27
-
28
- * **To deploy a preview** for demo / QA you will need the `CHROMATIC_PROJECT_TOKEN` -- find this in 1Password
29
-
30
-
31
- * **To publish the NPM package** you will need the ROH `NPM_TOKEN` -- find this in 1Password
32
-
33
-
34
- ## Versioning
35
- ---
36
-
37
- We use [Semantic Versioning](https://semver.org/) for Chord.
38
-
39
- Given a version number MAJOR.MINOR.PATCH, increment the:
40
-
41
- * MAJOR version when you make incompatible library changes
42
- * MINOR version when you add functionality in a backwards compatible manner
43
- * PATCH version when you make backwards compatible bug fixes
44
-
45
- When you create a new release always update the `CHANGELOG` and `package.json`
46
-
47
- Increment your version from the latest stable version on `chord-releases`
48
-
49
-
50
- ## Deploying the Storybook
51
- ---
52
-
53
- ### **1. To build and deploy locally**
54
-
55
- You can quickly build and serve the contents of `/storybook-static` from your local machine, for development and manual testing. To do this run:
56
-
57
- ```bash
58
- yarn storybook
59
- ```
60
-
61
- By default the storybook will be accessible at
62
- [http://localhost:6006/]()
63
-
64
- The server will hot-reload on most changes.
65
-
66
- ### **2. To deploy a preview version remotely**
67
-
68
- You can deploy a release candidate, or work-in-progress to [Chromatic](https://www.chromatic.com/) for showcase or QA.
69
-
70
- **NOTE:** you will need the `CHROMATIC_PROJECT_TOKEN` as described in *Prerequisites* above.
71
-
72
- Either set the token as a shell variable or use a `.env` file in the chord root directory containing the token, as so:
73
-
74
- ```
75
- CHROMATIC_PROJECT_TOKEN=tokengoeshere
76
- ```
77
-
78
- Run:
79
-
80
- ```
81
- yarn deploy-storybook-dev
82
- ```
83
-
84
- to build and deploy the storybook from your repo to Chromatic.
85
-
86
- You will find the address of your deployed storybook in the console output, looking something like this:
87
-
88
- `→ View your Storybook at https://randomHexString-randomAlphabeticalString.chromatic.com`
89
-
90
- ### **3. To deploy a release version**
91
-
92
- You can deploy the contents of `./storybook-static` to S3 as a static site, which is permanently accessible at [chord.roh.org.uk](chord.roh.org.uk)
93
-
94
- **NOTE:** To do this you will need the correct `AWS` credentials set up, as described in *Prerequisites* above.
95
-
96
- First build the storybook using:
97
-
98
- ```
99
- yarn build-storybook
100
- ```
101
-
102
- then run:
103
-
104
- ```bash
105
- yarn deploy-storybook
106
- ```
107
-
108
- > **IMPORTANT:** This URL is intended to showcase the latest stable version of Chord, it should be kept up to date with the main `chord-releases` branch and should **only** be used for release versions. If you want to deploy a development version follow the steps above under *To deploy a preview version remotely*.
109
-
110
-
111
- ## Releasing a New Package Version
112
- ---
113
-
114
- This is the procedure for releasing a new Chord NPM package.
115
-
116
- There are two types of package:
117
-
118
- A **snapshot** can be published to use a development version of the Chord library in our frontend staging environments, to perform integrated, manual testing.
119
-
120
- A **stable** package is published for use in production.
121
-
122
- **NOTE:** You will need the `NPM_TOKEN`, as described in 'Prerequisites' above.
123
-
124
- ### **1. To release a snapshot version**
125
-
126
- > **IMPORTANT:** Make sure you always publish your **snapshots** from `chord-development` after merging in your feature branch.
127
-
128
- For snapshots, `RELEASE_VERSION` should be the same as the latest **stable** version of the Chord Library, as found in `chord-releases`, followed by an **unused** lowercase letter.
129
-
130
- For example, if the latest stable release was 1.42.0, and the last snapshot published to NPM was 1.42.0-w, you would use RELEASE_VERSION `1.42.0-x`
131
-
132
- To publish a snapshot use:
133
-
134
- ```bash
135
- NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-snapshot
136
- ```
137
-
138
- The version published to NPM will be named, e.g. `1.42.0-a-chord-development`, use this to install the snapshot package in the frontend repos.
139
-
140
- ### **2. To release a stable version**
141
-
142
- > **IMPORTANT:** Make sure you always publish your **stable** packages from `chord-releases` after merging in your feature branch.
143
-
144
- For stable releases, increment your version from the latest **stable** version found on `chord-releases`, following the rules described in *Versioning* above, and use this as `RELEASE_VERSION`. (Make sure it matches the version in your `package.json` and `CHANGELOG.md`!)
145
-
146
- To publish a stable package use:
147
-
148
- ```bash
149
- NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
150
- ```
151
-
152
-
153
- ## Using the Package
154
- ---
155
-
156
- The package is deployed to NPM, and can be installed using yarn or npm:
157
-
158
- ```bash
159
- npm i --save @royaloperahouse/chord
160
- ```
161
- ```bash
162
- yarn add @royaloperahouse/chord
163
- ```
164
-
165
-
166
- ## Testing
167
- ---
168
-
169
- To **Lint** the package use:
170
-
171
- ```bash
172
- yarn lint
173
- # Use the --fix option to perform automatic fixes
174
- ```
175
-
176
- To run the **unit tests** (using Jest) use:
177
-
178
- ```bash
179
- yarn test
180
-
181
- # Use the -u option to update snapshots if needed
182
- # Run `yarn test:watch` to re-run tests on changes
183
- ```
184
-
185
- To **run and and store the unit tests** for display in storybook use:
186
-
187
- ```bash
188
- yarn test-storybook
189
- # Use the -u option to update snapshots if needed
190
- ```
191
-
192
-
193
- ## Development Process
194
- ---
195
-
196
- ### **1. Branching Model**
197
- * The Chord project lives in the `roh-components` *monorepo*
198
- * When working on Chord, treat the `roh-components/packages/chord` directory as your root
199
- * The Chord **development** branch is currently `chord-development`
200
- * The Chord **main** branch is currently `chord-releases`
201
- * All work should be done on a correctly named **feature branch** of the format: `issueType/ticketNumber-short-description-of-feature`, e.g. `feature/RD-1234-update-chord-documentation`
202
- * Always create your feature branch FROM, and submit pull requests TO, the **main** branch
203
- * For **QA / UAT** of a Chord component in isolation: following review you should deploy a preview version to Chromatic straight from your **feature branch** _without_ merging to development
204
- * For releasing an **NPM snapshot**: merge your feature branch into the **development** branch and publish the NPM snapshot from there
205
-
206
- ### **2. Detailed Workflow**
207
-
208
- #### **Before review:**
209
-
210
- * Git pull the latest version of `chord-releases`
211
- * Checkout a new, correctly-named feature branch from `chord releases`
212
- * Do your work on this feature branch
213
- * Run: `yarn lint`
214
- * Run: `yarn test`
215
- * Commit your changes
216
- * Create a pull request from your feature branch to `chord-releases`
217
- * Add the appropriate reviewers
218
-
219
- #### **Before QA / UAT:**
220
-
221
- After your PR is approved, you have two options:
222
-
223
- **i.** For QA of a component in isolation:
224
-
225
- * Follow the steps above in *Deploying the Storybook -> 2. Deploying a preview version remotely*
226
- * Share the generated Chromatic URL with the appropriate people for QA / UAT
227
-
228
- **ii.** For integrated testing of a component in the frontend staging environments:
229
-
230
- * Check out the `chord-development` branch
231
- * Merge your work in to `chord-development`
232
- * Follow the steps above under *Publishing a New Package Version -> 1. To release a snapshot version*
233
- * Git push the updated `chord-development` branch to remote
234
- * Finally, in the frontend repo:
235
-
236
- 1. Update the `package.json` to reference the new snapshot version
237
- 2. Run: `yarn install`
238
- 3. Deploy the frontend to a staging environment
239
-
240
- #### **When ready for production:**
241
-
242
- * Return to your chord **feature branch**
243
- * Update the chord version in `package.json`, incrementing from the last **stable** release, found in `chord-releases`, and following the rules described in the *Versioning* section
244
- * Update `CHANGELOG.md`, adding the new version number and a short description of your changes
245
- * Run: `yarn lint`
246
- * Run: `yarn test`
247
- * Run: `yarn test-storybook -u`
248
- * Run: `yarn build-storybook`
249
- * Git commit, push, and update your PR for final approval
250
- * Merge your approved PR to `chord-releases`
251
- * Follow the steps in *Publishing a New Package Version -> 2. To release a stable version* to publish the NPM package
252
- * Finally, follow the steps in *Deploying The Storybook -> 3. To deploy a release version*, to update the public Chord Storybook page
253
-
254
- Once you have successfully published a new release version, you can open a ticket to update to this version in any of the frontend repos.
255
-
256
-
257
- ## Notes
258
- ---
259
- ### The `storybook-static` folder
260
-
261
- This folder contains all the HTML / JS required to deploy the Storybook as a static site. It's autogenerated whenever the Storybook is built and therefore will show up a lot of merge conflicts when you merge other branches into your feature branch. It is best to leave generating the storybook until the later part of your workflow, but in case you run into conflicts earlier, it's ok to just delete the folder and regenerate using:
262
-
263
- ```bash
264
- yarn build-storybook
265
- ```
266
-
267
- For the same reason changes to this folder will cause a lot of big diffs, when looking at a PR, but can mostly be skimmed over unless something looks unusual.
268
-
269
- ---
270
- ### Examples
271
-
272
- There is an example implementation in the example folder. Alternatively there are also integration examples in storybook. Make sure to keep these updated so as to showcase the current components available.
273
-
274
- ---
275
- ### Bundle analysis
276
-
277
- Calculate the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `yarn size` and visualize it with `yarn analyze`.