@royaloperahouse/harmonic 0.19.0 → 0.19.1-a

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 (48) hide show
  1. package/CHANGELOG.md +907 -0
  2. package/README.md +267 -43
  3. package/dist/components/atoms/Buttons/Auxiliary/AuxiliaryButton.style.d.ts +1 -9
  4. package/dist/components/atoms/Buttons/Button.d.ts +3 -10
  5. package/dist/components/atoms/Buttons/Primary/PrimaryButton.d.ts +3 -17
  6. package/dist/components/atoms/Buttons/Primary/PrimaryButton.style.d.ts +1 -9
  7. package/dist/components/atoms/Buttons/Secondary/SecondaryButton.style.d.ts +1 -9
  8. package/dist/components/atoms/index.d.ts +1 -2
  9. package/dist/components/index.d.ts +3 -3
  10. package/dist/components/molecules/CastFilter/CastFilters.style.d.ts +0 -1
  11. package/dist/components/molecules/HotFilters/HotFilters.style.d.ts +1 -16
  12. package/dist/components/molecules/PageHeading/Compact/Compact.style.d.ts +1 -16
  13. package/dist/components/molecules/PageHeading/Impact/Impact.style.d.ts +9 -302
  14. package/dist/components/molecules/PeopleListing/CreditListing/CreditListing.style.d.ts +0 -2
  15. package/dist/components/molecules/PeopleListing/PeopleListing.d.ts +1 -1
  16. package/dist/components/molecules/PeopleListing/PeopleListing.style.d.ts +1 -3
  17. package/dist/components/molecules/PersonCard/PersonCard.style.d.ts +1 -3
  18. package/dist/components/molecules/Select2/Select2.d.ts +1 -1
  19. package/dist/components/molecules/index.d.ts +1 -3
  20. package/dist/components/organisms/Carousels/Carousel/Carousel.d.ts +1 -3
  21. package/dist/components/organisms/Carousels/HighlightsCarousel/HighlightsCarousel.d.ts +1 -3
  22. package/dist/components/organisms/TitleWithCTA/TitleWithCTA.style.d.ts +1 -16
  23. package/dist/harmonic.cjs.development.js +552 -1335
  24. package/dist/harmonic.cjs.development.js.map +1 -1
  25. package/dist/harmonic.cjs.production.min.js +1 -1
  26. package/dist/harmonic.cjs.production.min.js.map +1 -1
  27. package/dist/harmonic.esm.js +551 -1331
  28. package/dist/harmonic.esm.js.map +1 -1
  29. package/dist/index.d.ts +2 -2
  30. package/dist/types/card.d.ts +0 -2
  31. package/dist/types/impactHeader.d.ts +32 -14
  32. package/dist/types/signUpForm.d.ts +0 -1
  33. package/dist/types/types.d.ts +0 -14
  34. package/dist/types/upsell.d.ts +0 -2
  35. package/package.json +6 -24
  36. package/README.GIT +0 -293
  37. package/dist/components/atoms/Radio/Radio.d.ts +0 -7
  38. package/dist/components/atoms/Radio/Radio.style.d.ts +0 -4
  39. package/dist/components/atoms/Radio/index.d.ts +0 -2
  40. package/dist/components/atoms/VideoControlsImpact/VideoControlsImpact.d.ts +0 -4
  41. package/dist/components/atoms/VideoControlsImpact/VideoControlsImpact.style.d.ts +0 -5
  42. package/dist/components/atoms/VideoControlsImpact/index.d.ts +0 -2
  43. package/dist/components/molecules/RadioGroup/RadioGroup.d.ts +0 -7
  44. package/dist/components/molecules/RadioGroup/RadioGroup.style.d.ts +0 -1
  45. package/dist/components/molecules/RadioGroup/index.d.ts +0 -2
  46. package/dist/components/molecules/Select/Select.d.ts +0 -101
  47. package/dist/components/molecules/Select/Select.style.d.ts +0 -13
  48. package/dist/components/molecules/Select/index.d.ts +0 -2
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Accordion, Accordions, AnchorBar, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, BodyText, Card, Cards, Carousel, CastFilter, 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';
1
+ import { Accordion, Accordions, AnchorBar, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, BodyText, Card, Cards, Carousel, CastFilter, 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, Radio2, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, 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';
@@ -12,4 +12,4 @@ import HarmonicThemeProvider, { useHarmonicTheme } from './styles/HarmonicThemeP
12
12
  import { HarmonicSize } from './types/typography';
13
13
  import { HarmonicHeader, HarmonicSubtitle, BodyCopyHarmonic, HarmonicOverline, ButtonText, Caption, NavigationText } from './components/Typography';
14
14
  export { useHarmonicTheme };
15
- export { Accordion, Accordions, AnchorBar, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryButton, AuxiliaryNav, AspectRatio, BodyContent, BodyText, breakpoints, ButtonType, Card, Cards, CarouselType, Carousel, CastFilter, 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, PersonCard, 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, };
15
+ export { Accordion, Accordions, AnchorBar, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryButton, AuxiliaryNav, AspectRatio, BodyContent, BodyText, breakpoints, ButtonType, Card, Cards, CarouselType, Carousel, CastFilter, 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, PersonCard, Paywall, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio2, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, 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, };
@@ -144,6 +144,4 @@ export interface RoleComponentProps {
144
144
  role: ListingRole;
145
145
  /** Custom CSS classes */
146
146
  className?: string;
147
- /** Render person headshot in greyscale */
148
- greyscale?: boolean;
149
147
  }
@@ -20,28 +20,46 @@ export interface CustomSponsorImageData {
20
20
  title: string;
21
21
  }
22
22
  export interface IPageHeadingImpactProps {
23
- /** Text placed in the impact component */
23
+ /**
24
+ * Text placed in the impact component
25
+ */
24
26
  text?: string;
25
- /** Link placed in the impact component */
27
+ /**
28
+ * Link placed in the impact component
29
+ */
26
30
  link?: EditorialLink;
27
- /** Boolean to show/hide sponsorship logo (default true) */
31
+ /**
32
+ * Boolean to show/hide sponsorship logo (default true)
33
+ */
28
34
  sponsor?: boolean;
29
- /** Data for custom sponsor */
35
+ /**
36
+ * Data for custom sponsor
37
+ */
30
38
  customSponsorImage?: CustomSponsorImageData;
31
- /** Background url for desktops */
39
+ /**
40
+ * Background url for desktops
41
+ */
32
42
  bgUrlDesktop: string;
33
- /** Background url for devices */
43
+ /**
44
+ * Background url for devices
45
+ */
34
46
  bgUrlDevice?: string;
35
- /** Alt text for the main image */
47
+ /**
48
+ * Alt text for the main image
49
+ */
36
50
  bgImageAltText?: string;
37
- /** Desktop video url */
38
- videoUrlDesktop?: string;
39
- /** Mobile video url */
40
- videoUrlMobile?: string;
41
- /** Logo to be placed in page heading component */
51
+ /**
52
+ * Logo to be placed in page heading component
53
+ */
42
54
  children?: ReactNode;
43
- /** Custom CSS classes */
44
- className?: string;
55
+ /**
56
+ * Internal anchor ref
57
+ */
58
+ scrollHref?: string;
59
+ /**
60
+ * Semantic level of the header
61
+ */
62
+ semanticLevel?: TypographyLevel;
45
63
  }
46
64
  export declare type BrandingStyle = 'BlockText' | 'BodyText' | 'StreamLogo' | 'CinemaLogo' | 'TextLink';
47
65
  export interface IPageHeadingCompactProps {
@@ -68,7 +68,6 @@ export interface ISignUpFormProps {
68
68
  export declare type SignUpFormComponentTitleProps = {
69
69
  title: string;
70
70
  isMobile?: boolean;
71
- titleFontFamily?: 'Grey' | 'Victor' | undefined;
72
71
  };
73
72
  export declare type SignUpFormComponentMessageProps = {
74
73
  message: string;
@@ -350,10 +350,6 @@ export interface IPeopleListing {
350
350
  roles: ListingRole[];
351
351
  /** Custom CSS classes */
352
352
  className?: string;
353
- /** Render person headshots in greyscale */
354
- greyscale?: boolean;
355
- /** Optional number of people per row on large desktop */
356
- largeDesktopColumns?: 3 | 4;
357
353
  }
358
354
  export interface IPagination {
359
355
  /**
@@ -489,10 +485,6 @@ export declare type ICastFiltersProps = {
489
485
  * Handle clicking the text link.
490
486
  */
491
487
  onClear?: () => void;
492
- /**
493
- * Render person images in greyscale
494
- */
495
- greyscale?: boolean;
496
488
  };
497
489
  export interface ISponsorshipProps {
498
490
  /**
@@ -725,12 +717,6 @@ export interface IVideoControlsProps {
725
717
  */
726
718
  loop?: boolean;
727
719
  }
728
- export interface IVideoControlsImpactProps {
729
- /** Video element id */
730
- videoElementId: string;
731
- /** Loops */
732
- loop?: boolean;
733
- }
734
720
  export declare type IVideoWithControlsSettings = Omit<IVideoControlsProps, 'videoElementId' | 'videoContainerId'>;
735
721
  export interface IVideoWithControlsProps {
736
722
  /**
@@ -80,6 +80,4 @@ export interface IUpsellSectionProps {
80
80
  theme?: ThemeType;
81
81
  /** Custom CSS classes */
82
82
  className?: string;
83
- /** Sets Font Family by default Grey */
84
- titleFontFamily?: 'Victor' | 'Grey' | undefined;
85
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@royaloperahouse/harmonic",
3
- "version": "0.19.0",
3
+ "version": "0.19.1-a",
4
4
  "author": "Royal Opera House",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -9,16 +9,12 @@
9
9
  "dist"
10
10
  ],
11
11
  "engines": {
12
- "node": ">=10"
12
+ "node": ">=18"
13
13
  },
14
14
  "repository": {
15
15
  "type": "git",
16
16
  "url": "https://bitbucket.org/rohorguk/harmonic-library.git"
17
17
  },
18
- "publishConfig": {
19
- "access": "public",
20
- "registry": "https://registry.npmjs.org/"
21
- },
22
18
  "scripts": {
23
19
  "start": "tsdx watch",
24
20
  "build": "tsdx build",
@@ -26,7 +22,6 @@
26
22
  "test:watch": "jest --watch --verbose --passWithNoTests",
27
23
  "lint": "eslint src",
28
24
  "format": "prettier --write src",
29
- "prepare": "tsdx build",
30
25
  "size": "size-limit",
31
26
  "analyze": "size-limit --why",
32
27
  "storybook": "storybook dev -p 6006",
@@ -34,9 +29,10 @@
34
29
  "build-storybook": "rm -rf ./storybook-static; storybook build -o ./storybook-static; cp -r ./external/ ./storybook-static/",
35
30
  "deploy-storybook-dev": "chromatic --build-script-name build-storybook-dev",
36
31
  "deploy-storybook": "storybook-to-aws-s3 --bucket-path=harmonic.roh.org.uk --aws-profile=parent --existing-output-dir=storybook-static --s3-sync-options=--acl=public-read",
32
+ "test:save-results": "jest --json --passWithNoTests --outputFile=./test/jest-test-results.json",
37
33
  "test-storybook": "jest --json --passWithNoTests --outputFile=./test/jest-test-results.json",
38
- "publish-release": "make prepare-release-candidate; make publish-release",
39
- "publish-snapshot": "make prepare-release-candidate; make publish-npm-snapshot"
34
+ "publish-release": "make prepare-release-candidate && make publish-release",
35
+ "publish-snapshot": "make prepare-release-candidate && make publish-npm-snapshot"
40
36
  },
41
37
  "keywords": [
42
38
  "React",
@@ -47,11 +43,6 @@
47
43
  "peerDependencies": {
48
44
  "react": ">=16"
49
45
  },
50
- "husky": {
51
- "hooks": {
52
- "pre-commit": "lint-staged"
53
- }
54
- },
55
46
  "module": "dist/harmonic.esm.js",
56
47
  "size-limit": [
57
48
  {
@@ -95,7 +86,6 @@
95
86
  "@types/react-test-renderer": "^17.0.1",
96
87
  "@types/resize-observer-browser": "^0.1.11",
97
88
  "@types/styled-components": "5.1.26",
98
- "@types/testing-library__jest-dom": "^5.9.1",
99
89
  "@typescript-eslint/eslint-plugin": "^5.0.0",
100
90
  "@typescript-eslint/parser": "^5.0.0",
101
91
  "autoprefixer": "^10.4.20",
@@ -112,11 +102,9 @@
112
102
  "eslint-plugin-react": "^7.28.0",
113
103
  "eslint-plugin-react-hooks": "^4.3.0",
114
104
  "eslint-plugin-storybook": "^0.12.0",
115
- "husky": "^7.0.4",
116
105
  "identity-obj-proxy": "^3.0.0",
117
106
  "jest": "^29.0.0",
118
107
  "jest-environment-jsdom": "^29.7.0",
119
- "lint-staged": "^15.2.10",
120
108
  "prettier": "^3.3.3",
121
109
  "react": "^17.0.2",
122
110
  "react-dom": "^17.0.2",
@@ -133,7 +121,7 @@
133
121
  "typescript": "^4.4.4"
134
122
  },
135
123
  "dependencies": {
136
- "moment": "^2.29.4",
124
+ "date-fns": "^4.1.0",
137
125
  "react-modal": "^3.16.1",
138
126
  "react-scrolllock": "^5.0.1",
139
127
  "react-select": "^5.8.0"
@@ -142,11 +130,5 @@
142
130
  "@types/react": "^17.0.34",
143
131
  "@types/react-dom": "^17.0.11"
144
132
  },
145
- "lint-staged": {
146
- "*.{js,jsx,json,css,md,ts,tsx,html}": [
147
- "npx eslint src --fix ",
148
- "npx prettier src --write --uncommitted"
149
- ]
150
- },
151
133
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
152
134
  }
package/README.GIT DELETED
@@ -1,293 +0,0 @@
1
- # Royal Opera House Harmonic - Front End Design System
2
-
3
- Welcome to The Royal Opera House Front End Design System, `@royaloperahouse/harmonic`
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 [Royal Opera House - Harmonic](https://www.npmjs.com/package/@royaloperahouse/harmonic)
10
-
11
- The Storybook for the latest version of the library is hosted at [Storybook - Harmonic] TODO: S3 deployment
12
-
13
-
14
- ## Prerequisites
15
- ---
16
-
17
- * Make sure the required package dependencies are installed using `yarn install`
18
- * If this is the first time you are working on Harmonic, make sure to run `yarn build` to build all the modules.
19
-
20
- * **To deploy the storybook publicly** you will need credentials for the **parent** 'Royal Opera House' AWS account in your `~/.aws/credentials` file.
21
- * The deploy script expects these to be called `[parent]`.
22
-
23
- * You can find these values at:
24
-
25
- *AWS access portal/ Accounts tab -> 'Royal Opera House' -> 'Access keys' -> 'Option 2: Add a profile to your AWS credentials file'*
26
-
27
- * **To deploy a preview** for demo / QA you will need:
28
-
29
- * A Chromatic account with a **Developer** role in the `roh-ml` project in Chromatic
30
- * [Mari Lovell](mari.lovell@roh.org.uk) is the current owner of this project, you can contact her to invite you
31
- * The `CHROMATIC_PROJECT_TOKEN` -- find this in 1Password or ask the project owner.
32
-
33
-
34
- * **To enable publishing to the NPM package**:
35
- * Create account / log in to NPM
36
- * Ask a colleague with admin rights to be added as a contributer
37
- * Generate your own ROH `NPM_TOKEN` (store this token in 1Password)
38
- * Set up Two-Factor Authentication for NPM, as you will be prompted by the publishing script
39
-
40
-
41
- ## Versioning
42
- ---
43
- > NOTE: The following applies while the Harmonic project is in Alpha (before a version 1.0.0 release)
44
-
45
- We are **not** yet using semantic versioning.
46
-
47
- When proposing changes to the Harmonic library, increment the patch version (the last number) by one, **only** in the changelog (alternatively, leave the version in the changelog as TBC) along with a note about your changes.
48
-
49
- Only increment the version in the package.json for releasing snapshots.
50
-
51
- Once your changes are merged to the main branch and released in a new version, the release manager will be responsible for incrementing that release version.
52
-
53
- > NOTE: The following **may** apply once the Harmonic project is out of Alpha, but is subject to change before then.
54
-
55
- We use [Semantic Versioning](https://semver.org/) for Harmonic.
56
-
57
- Given a version number MAJOR.MINOR.PATCH, increment the:
58
-
59
- * MAJOR version when you make incompatible library changes
60
- * MINOR version when you add functionality in a backwards compatible manner
61
- * PATCH version when you make backwards compatible bug fixes
62
-
63
- When you create a new release always update the `CHANGELOG` and `package.json`
64
-
65
- Increment your version from the latest stable version on [Royal Opera House - Harmonic](https://www.npmjs.com/package/@royaloperahouse/harmonic?activeTab=versions)
66
-
67
-
68
- ## Deploying the Storybook
69
- ---
70
-
71
- ### **1. To build and deploy locally**
72
-
73
- You can quickly build and serve the contents of `/storybook-static` from your local machine, for development and manual testing. To do this run:
74
-
75
- ```bash
76
- yarn storybook
77
- ```
78
-
79
- By default the storybook will be accessible at
80
- [http://localhost:6006/]()
81
-
82
- The server will hot-reload on most changes.
83
-
84
- ### **2. To deploy a preview version remotely**
85
-
86
- You can deploy a release candidate, or work-in-progress to [Chromatic](https://www.chromatic.com/) for showcase or QA.
87
-
88
- **NOTE:** you will need the `CHROMATIC_PROJECT_TOKEN` and to be invited as a contributor to the Harmonic project in Chromatic, as described in *Prerequisites* above.
89
-
90
- Either set the token as a shell variable or use a `.env` file in the `harmonic` root directory containing the token, as so:
91
-
92
- ```
93
- CHROMATIC_PROJECT_TOKEN=tokengoeshere
94
- ```
95
-
96
- Run:
97
- ```
98
- CHROMATIC_PROJECT_TOKEN=tokengoeshere yarn deploy-storybook-dev
99
- ```
100
-
101
- to build and deploy the storybook from your repo to Chromatic.
102
-
103
- You will find the address of your deployed storybook in the console output, looking something like this:
104
-
105
- `→ View your Storybook at https://randomHexString-randomAlphabeticalString.chromatic.com`
106
-
107
- ### **3. To deploy a release version**
108
-
109
- You can deploy the contents of `./storybook-static` to S3 as a static site, which is permanently accessible at [WIP] TODO: S3 deployment
110
-
111
- **NOTE:** To do this you will need the correct `AWS` credentials set up, as described in *Prerequisites* above.
112
-
113
- First build the storybook using:
114
-
115
- ```
116
- yarn build-storybook
117
- ```
118
-
119
- then run:
120
-
121
- ```bash
122
- yarn deploy-storybook
123
- ```
124
-
125
- > **IMPORTANT:** This URL is intended to showcase the latest stable version of Harmonic, it should be kept up to date with the `main` Harmonic 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*.
126
-
127
-
128
- ## Releasing a New Package Version
129
- ---
130
-
131
- This is the procedure for releasing a new Harmonic NPM package.
132
-
133
- There are two types of package:
134
-
135
- A **snapshot** can be published to use a development version of the Harmonic library in our frontend staging environments, to perform integrated, manual testing.
136
-
137
- A **stable** package is published for use in production.
138
-
139
- **NOTE:** You will need the `NPM_TOKEN`, as described in 'Prerequisites' above.
140
-
141
- ### **1. To release a snapshot version**
142
-
143
- > **IMPORTANT:** Make sure you always publish your **snapshots** from `development` after merging in your feature branch.
144
-
145
- For snapshots, `RELEASE_VERSION` should be the same as the latest **stable** version of the Harmonic Library, as found in [npm Harmonic - Versions](https://www.npmjs.com/package/@royaloperahouse/harmonic?activeTab=versions), followed by an **unused** lowercase letter.
146
-
147
- 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`
148
-
149
- To publish a snapshot use:
150
-
151
- ```bash
152
- NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-snapshot
153
- ```
154
- Use the version name to install the package in a frontend repo.
155
-
156
- ### **2. To release a stable version**
157
-
158
- > **IMPORTANT:** Make sure you always publish your **stable** packages from `main` after merging in your feature branch.
159
-
160
- For stable releases, increment your version from the latest **stable** version found on [npm Harmonic - Versions](https://www.npmjs.com/package/@royaloperahouse/harmonic?activeTab=versions), 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`!)
161
-
162
- To publish a stable package use:
163
-
164
- ```bash
165
- NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
166
- ```
167
-
168
-
169
- ## Using the Package
170
- ---
171
-
172
- The package is deployed to NPM, and can be installed using yarn or npm:
173
-
174
- ```bash
175
- npm i --save @royaloperahouse/harmonic
176
- ```
177
- ```bash
178
- yarn add @royaloperahouse/harmonic
179
- ```
180
-
181
-
182
- ## Testing
183
- ---
184
-
185
- To **Lint** the package use:
186
-
187
- ```bash
188
- yarn lint
189
- # Use the --fix option to perform automatic fixes
190
- ```
191
-
192
- To run the **unit tests** (using Jest) use:
193
-
194
- ```bash
195
- yarn test
196
-
197
- # Use the -u option to update snapshots if needed
198
- # Run `yarn test:watch` to re-run tests on changes
199
- ```
200
-
201
- To **run and and store the unit tests** for display in storybook use:
202
-
203
- ```bash
204
- yarn test-storybook
205
- # Use the -u option to update snapshots if needed
206
- ```
207
-
208
-
209
- ## Development Process
210
- ---
211
-
212
- ### **1. Branching Model**
213
- * The Harmonic project lives in the `harmonic-library/harmonic` *repository*
214
- * When working on Harmonic, treat the `harmonic` directory as your root
215
- * The Harmonic **development** branch is for QA
216
- * The Harmonic **main** branch is currently for stable releases
217
- * All work should be done on a correctly named **feature branch** of the format: `issueType/ticketNumber-short-description-of-feature`, e.g. `feature/RD-12345-add-example-component`
218
- * Always create your feature branch FROM, and submit pull requests TO, the **main** branch
219
- * For **QA / UAT** of a Harmonic component in isolation: following review you should deploy a preview version to Chromatic straight from your **feature branch** _without_ merging to development
220
- * For releasing an **NPM snapshot**: merge your feature branch into the **development** branch and publish the NPM snapshot from there
221
-
222
- ### **2. Detailed Workflow**
223
-
224
- #### **Before review:**
225
-
226
- * Git pull the latest version of Harmonic from `main`
227
- * Checkout a new, correctly-named feature branch from `main`
228
- * Do your work on this feature branch
229
- * Run: `yarn lint --fix`
230
- * Run: `yarn test -u`
231
- * Commit your changes
232
- * Create a pull request from your feature branch to `main`
233
- * Add the appropriate reviewers
234
-
235
- #### **Before QA / UAT:**
236
-
237
- After your PR is approved, you have two options:
238
-
239
- **i.** For QA of a component in isolation:
240
-
241
- * Follow the steps above in *Deploying the Storybook -> 2. Deploying a preview version remotely*
242
- * Share the generated Chromatic URL with the appropriate people for QA / UAT
243
-
244
- **ii.** For integrated testing of a component in the frontend staging environments:
245
-
246
- * Check out the `development` branch
247
- * Merge your work in to `development`
248
- * Follow the steps above under *Publishing a New Package Version -> 1. To release a snapshot version*
249
- * Git push the updated `development` branch to remote
250
- * Finally, in the frontend repo:
251
-
252
- 1. Update the `package.json` to reference the new snapshot version
253
- 2. Run: `yarn install`
254
- 3. Deploy the frontend to a staging environment
255
-
256
- #### **When ready for production:**
257
-
258
- * Return to your Harmonic **feature branch**
259
- * Update the HArmonic version in `package.json`, incrementing from the last **stable** release, found in [npm Harmonic - Versions](https://www.npmjs.com/package/@royaloperahouse/harmonic?activeTab=versions), and following the rules described in the *Versioning* section
260
- * Update `CHANGELOG.md`, adding the new version number and a short description of your changes
261
- * Run: `yarn lint --fix`
262
- * Run: `yarn test -u`
263
- * Run: `yarn test-storybook -u`
264
- * Run: `yarn build-storybook`
265
- * Git commit, push, and update your PR for final approval
266
- * Merge your approved PR to `main`
267
- * Follow the steps in *Publishing a New Package Version -> 2. To release a stable version* to publish the NPM package
268
- * Finally, follow the steps in *Deploying The Storybook -> 3. To deploy a release version*, to update the public Harmonic Storybook page
269
-
270
- 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.
271
-
272
-
273
- ## Notes
274
- ---
275
- ### The `storybook-static` folder
276
-
277
- 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:
278
-
279
- ```bash
280
- yarn build-storybook
281
- ```
282
-
283
- 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.
284
-
285
- ---
286
- ### Examples
287
-
288
- 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.
289
-
290
- ---
291
- ### Bundle analysis
292
-
293
- 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`.
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { IRadioProps } from '../../../types/formTypes';
3
- /**
4
- * DEPRECATED. Use Radio2 instead
5
- */
6
- declare const Radio: ({ checked, error, label, onChange }: IRadioProps) => React.JSX.Element;
7
- export default Radio;
@@ -1,4 +0,0 @@
1
- import { IRadioProps } from '../../../types/formTypes';
2
- export declare const RadioContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const RadioLine: import("styled-components").StyledComponent<"div", any, IRadioProps, never>;
4
- export declare const RadioError: import("styled-components").StyledComponent<"div", any, IRadioProps, never>;
@@ -1,2 +0,0 @@
1
- import Radio from './Radio';
2
- export default Radio;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { IVideoControlsImpactProps } from '../../../types/types';
3
- declare const VideoControlsImpact: React.FC<IVideoControlsImpactProps>;
4
- export default VideoControlsImpact;
@@ -1,5 +0,0 @@
1
- export declare const VideoPlayButton: import("styled-components").StyledComponent<"button", any, {}, never>;
2
- export declare const VideoControlsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const VideoControlsInnerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export declare const LeftWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const StoryBookWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,2 +0,0 @@
1
- import VideoControlsImpact from './VideoControlsImpact';
2
- export default VideoControlsImpact;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { IRadioGroupProps } from '../../../types/formTypes';
3
- /**
4
- * DEPRECATED. Use RadioGroup2 instead
5
- */
6
- declare const RadioGroup: ({ radios, columnStartDesktop, columnStartDevice, columnSpanDesktop, columnSpanDevice, columnStartSmallDevice, columnSpanSmallDevice, onChange, }: IRadioGroupProps) => React.JSX.Element;
7
- export default RadioGroup;
@@ -1 +0,0 @@
1
- export declare const RadioGroupContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,2 +0,0 @@
1
- import RadioGroup from './RadioGroup';
2
- export default RadioGroup;