@royaloperahouse/chord 1.1.0 → 1.2.10
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.
- package/CHANGELOG.md +196 -4
- package/README.GIT +211 -56
- package/README.md +2 -2
- package/dist/chord.cjs.development.js +4009 -1673
- package/dist/chord.cjs.development.js.map +1 -1
- package/dist/chord.cjs.production.min.js +1 -1
- package/dist/chord.cjs.production.min.js.map +1 -1
- package/dist/chord.esm.js +4109 -1787
- package/dist/chord.esm.js.map +1 -1
- package/dist/components/atoms/Icons/SvgIcons/Logos/Social/X.svg.d.ts +4 -0
- package/dist/components/atoms/Icons/SvgIcons/index.d.ts +1 -0
- package/dist/components/atoms/Progress/Progress.d.ts +1 -1
- package/dist/components/atoms/Progress/Progress.styles.d.ts +10 -3
- package/dist/components/atoms/Radio/Radio.d.ts +3 -0
- package/dist/components/atoms/Radio/Radio.style.d.ts +4 -0
- package/dist/components/atoms/Radio/index.d.ts +2 -0
- package/dist/components/atoms/Sponsorship/Sponsorship.style.d.ts +2 -0
- package/dist/components/atoms/Stepper/Stepper.d.ts +58 -0
- package/dist/components/atoms/Stepper/Stepper.style.d.ts +6 -0
- package/dist/components/atoms/Stepper/index.d.ts +2 -0
- package/dist/components/atoms/TextArea/TextArea.d.ts +44 -0
- package/dist/components/atoms/TextArea/TextArea.style.d.ts +5 -0
- package/dist/components/atoms/TextArea/index.d.ts +2 -0
- package/dist/components/atoms/TextField/TextField.d.ts +41 -0
- package/dist/components/atoms/TextField/TextField.style.d.ts +5 -0
- package/dist/components/atoms/TextField/index.d.ts +2 -0
- package/dist/components/atoms/TextLogo/TextLogo.d.ts +13 -0
- package/dist/components/atoms/TextLogo/index.d.ts +2 -0
- package/dist/components/atoms/TextLogo/styled.d.ts +12 -0
- package/dist/components/atoms/Tickbox/Tickbox.style.d.ts +5 -0
- package/dist/components/atoms/Timer/Timer.d.ts +4 -0
- package/dist/components/atoms/Timer/Timer.style.d.ts +9 -0
- package/dist/components/atoms/Timer/index.d.ts +2 -0
- package/dist/components/atoms/Typography/Typography.d.ts +1 -1
- package/dist/components/atoms/VideoControls/VideoControls.d.ts +9 -0
- package/dist/components/atoms/VideoControls/VideoControls.style.d.ts +10 -0
- package/dist/components/atoms/VideoControls/index.d.ts +2 -0
- package/dist/components/atoms/index.d.ts +14 -6
- package/dist/components/index.d.ts +4 -4
- package/dist/components/molecules/Basket/Basket.d.ts +3 -0
- package/dist/components/molecules/Basket/helpers.d.ts +3 -0
- package/dist/components/molecules/Basket/hooks.d.ts +8 -0
- package/dist/components/molecules/Card/Card.style.d.ts +13 -1
- package/dist/components/molecules/ContentSummary/ContentSummary.d.ts +3 -0
- package/dist/components/molecules/ContentSummary/ContentSummary.style.d.ts +17 -0
- package/dist/components/molecules/ContentSummary/ContentSummaryData.d.ts +25 -0
- package/dist/components/molecules/ContentSummary/index.d.ts +2 -0
- package/dist/components/molecules/MiniCard/MiniCard.d.ts +4 -0
- package/dist/components/molecules/MiniCard/MiniCard.style.d.ts +6 -0
- package/dist/components/molecules/MiniCard/index.d.ts +2 -0
- package/dist/components/molecules/NavTop/NavTop.d.ts +1 -1
- package/dist/components/molecules/PageHeading/Compact/Compact.d.ts +4 -0
- package/dist/components/molecules/PageHeading/Compact/Compact.style.d.ts +24 -0
- package/dist/components/molecules/PageHeading/Compact/components/CompactHeaderBranding.d.ts +10 -0
- package/dist/components/molecules/PageHeading/Compact/index.d.ts +2 -0
- package/dist/components/molecules/PageHeading/Impact/Impact.d.ts +1 -1
- package/dist/components/molecules/PageHeading/Impact/Impact.style.d.ts +1 -0
- package/dist/components/molecules/PageHeading/PageHeading.style.d.ts +6 -3
- package/dist/components/molecules/PageHeading/Panel/Panel.d.ts +4 -0
- package/dist/components/molecules/PageHeading/Panel/Panel.style.d.ts +9 -0
- package/dist/components/molecules/PageHeading/Panel/index.d.ts +2 -0
- package/dist/components/molecules/PageHeading/index.d.ts +3 -1
- package/dist/components/molecules/Pagination/Pagination.d.ts +9 -0
- package/dist/components/molecules/Pagination/Pagination.style.d.ts +8 -0
- package/dist/components/molecules/Pagination/index.d.ts +2 -0
- package/dist/components/molecules/PeopleListing/CreditListing/CreditListing.d.ts +3 -0
- package/dist/components/molecules/PeopleListing/CreditListing/CreditListing.style.d.ts +5 -0
- package/dist/components/molecules/PeopleListing/CreditListing/index.d.ts +2 -0
- package/dist/components/molecules/PeopleListing/index.d.ts +2 -1
- package/dist/components/molecules/PromoWithTags/PromoWithTags.d.ts +1 -1
- package/dist/components/molecules/PromoWithTags/PromoWithTags.style.d.ts +11 -4
- package/dist/components/molecules/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/molecules/RadioGroup/RadioGroup.style.d.ts +1 -0
- package/dist/components/molecules/RadioGroup/index.d.ts +2 -0
- package/dist/components/molecules/SearchBar/SearchBar.style.d.ts +1 -0
- package/dist/components/molecules/Select/Select.d.ts +99 -0
- package/dist/components/molecules/Select/Select.style.d.ts +14 -0
- package/dist/components/molecules/Select/index.d.ts +2 -0
- package/dist/components/molecules/UpsellCard/OfferText.d.ts +2 -0
- package/dist/components/molecules/UpsellCard/UpsellCard.d.ts +4 -0
- package/dist/components/molecules/UpsellCard/UpsellCard.style.d.ts +15 -0
- package/dist/components/molecules/UpsellCard/index.d.ts +2 -0
- package/dist/components/molecules/UpsellCards/UpsellCards.d.ts +4 -0
- package/dist/components/molecules/UpsellCards/UpsellCards.style.d.ts +1 -0
- package/dist/components/molecules/UpsellCards/index.d.ts +2 -0
- package/dist/components/molecules/index.d.ts +10 -3
- package/dist/components/organisms/AnchorTabBar/AnchorTabBar.style.d.ts +4 -3
- package/dist/components/organisms/Navigation/Navigation.style.d.ts +6 -2
- package/dist/components/organisms/StickyBar/StickyBar.style.d.ts +5 -1
- package/dist/components/organisms/UpsellSection/UpsellSection.d.ts +4 -0
- package/dist/components/organisms/UpsellSection/UpsellSection.style.d.ts +3 -0
- package/dist/components/organisms/UpsellSection/index.d.ts +2 -0
- package/dist/components/organisms/index.d.ts +2 -3
- package/dist/helpers/arrays.d.ts +6 -0
- package/dist/helpers/defaultValues.d.ts +7 -0
- package/dist/helpers/devices.d.ts +3 -0
- package/dist/helpers/formatStrings.d.ts +2 -0
- package/dist/helpers/htmlStrings.d.ts +2 -0
- package/dist/helpers/urls.d.ts +2 -0
- package/dist/index.d.ts +6 -4
- package/dist/styles/themes.d.ts +1172 -96
- package/dist/styles/viewports.d.ts +3 -0
- package/dist/types/card.d.ts +40 -0
- package/dist/types/carousel.d.ts +22 -1
- package/dist/types/creditListing.d.ts +12 -0
- package/dist/types/editorial.d.ts +59 -55
- package/dist/types/formTypes.d.ts +170 -0
- package/dist/types/impactHeader.d.ts +122 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/miniCard.d.ts +27 -0
- package/dist/types/navigation.d.ts +68 -4
- package/dist/types/progress.d.ts +33 -0
- package/dist/types/promoWithTags.d.ts +81 -0
- package/dist/types/tickbox.d.ts +35 -0
- package/dist/types/timer.d.ts +37 -0
- package/dist/types/types.d.ts +38 -9
- package/dist/types/typography.d.ts +18 -2
- package/dist/types/upsell.d.ts +78 -0
- package/dist/types/utility.d.ts +4 -0
- package/package.json +9 -4
- package/dist/components/atoms/Basket/Basket.d.ts +0 -3
- package/dist/components/organisms/Carousel/Carousel.d.ts +0 -5
- package/dist/components/organisms/Carousel/Carousel.style.d.ts +0 -6
- package/dist/components/organisms/Carousel/index.d.ts +0 -2
- package/dist/components/organisms/HighlightsCarousel/HighlightsCarousel.d.ts +0 -5
- package/dist/components/organisms/HighlightsCarousel/HighlightsCarousel.style.d.ts +0 -12
- package/dist/components/organisms/HighlightsCarousel/HighlightsCinema.d.ts +0 -4
- package/dist/components/organisms/HighlightsCarousel/HighlightsCore.d.ts +0 -4
- package/dist/components/organisms/HighlightsCarousel/HighlightsStream.d.ts +0 -4
- package/dist/components/organisms/HighlightsCarousel/index.d.ts +0 -5
- /package/dist/components/{atoms → molecules}/Basket/Basket.style.d.ts +0 -0
- /package/dist/components/{atoms → molecules}/Basket/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,193 @@
|
|
|
1
|
-
|
|
1
|
+
## [2.1.10]
|
|
2
|
+
- Add missing export for `CreditListing`
|
|
3
|
+
|
|
4
|
+
## [2.1.9]
|
|
5
|
+
- Add Credit Listing
|
|
6
|
+
|
|
7
|
+
## [2.1.8]
|
|
8
|
+
- Add Branding Link to Compact Header
|
|
9
|
+
|
|
10
|
+
## [2.1.7]
|
|
11
|
+
- Footer updates
|
|
12
|
+
|
|
13
|
+
## [2.1.6]
|
|
14
|
+
- Add X logo
|
|
15
|
+
|
|
16
|
+
## [2.1.5]
|
|
17
|
+
- Revert search error caused by previous version
|
|
18
|
+
|
|
19
|
+
## [2.1.4]
|
|
20
|
+
- Fix screenreader accessibility for accordions
|
|
21
|
+
|
|
22
|
+
## [2.1.3]
|
|
23
|
+
- Navigation: make links links
|
|
24
|
+
- Clear testing errors
|
|
25
|
+
|
|
26
|
+
## [2.1.2]
|
|
27
|
+
- TextField: include optional width param
|
|
28
|
+
|
|
29
|
+
## [2.1.1]
|
|
30
|
+
- AnchorTabBar: change grid, to move tabs to the center
|
|
31
|
+
|
|
32
|
+
## [2.1.0]
|
|
33
|
+
- Convert Pagination to href instead of React Router Link
|
|
34
|
+
|
|
35
|
+
## [2.0.0]
|
|
36
|
+
- Remove swiper dependency
|
|
37
|
+
## [1.28.0]
|
|
38
|
+
- Add new RadioGroup component
|
|
39
|
+
- Progress: add the steps
|
|
40
|
+
- Compact header: hide CTA if the prop is undefined
|
|
41
|
+
- Compact header: change highlight color for Stream variant
|
|
42
|
+
|
|
43
|
+
## [1.27.1]
|
|
44
|
+
- Fixed failing test on timer component
|
|
45
|
+
|
|
46
|
+
## [1.27.0]
|
|
47
|
+
- ContentSummary component can now be configured to be fully clickable
|
|
48
|
+
|
|
49
|
+
## [1.26.0]
|
|
50
|
+
- MiniCard and MinimalCarousel: add new components
|
|
51
|
+
|
|
52
|
+
## [1.25.2]
|
|
53
|
+
- Now clicking on the gray overlay closes the search bar
|
|
54
|
+
|
|
55
|
+
## [1.25.1]
|
|
56
|
+
- Stepper: Properly export component
|
|
57
|
+
|
|
58
|
+
## [1.25.0]
|
|
59
|
+
- Stepper: Add Stepper component
|
|
60
|
+
|
|
61
|
+
## [1.24.2]
|
|
62
|
+
- Increase Upsell Card Flag character limit to 30
|
|
63
|
+
|
|
64
|
+
## [1.24.1]
|
|
65
|
+
- Include link field to Upsell Cards
|
|
66
|
+
|
|
67
|
+
## [1.24.0]
|
|
68
|
+
- Implement Upsell Section & Upsell Cards
|
|
69
|
+
|
|
70
|
+
## [1.23.2]
|
|
71
|
+
- Fix BrandingStyle not showing bug
|
|
72
|
+
|
|
73
|
+
## [1.23.1]
|
|
74
|
+
- Fix enum on BrandingStyle
|
|
75
|
+
|
|
76
|
+
## [1.23.0]
|
|
77
|
+
- Re-enabled compact header on iOS
|
|
78
|
+
|
|
79
|
+
## [1.22.0]
|
|
80
|
+
- TextArea: Added new TextArea component
|
|
81
|
+
- TickBox: Added disabled and error states
|
|
82
|
+
|
|
83
|
+
## [1.21.1]
|
|
84
|
+
- Made select state reset behaviour opt-in
|
|
85
|
+
|
|
86
|
+
## [1.21.0]
|
|
87
|
+
- TextLogo: add new component
|
|
88
|
+
- Compact PageHeading: swap logo with TextLogo to fix iOS issues
|
|
89
|
+
|
|
90
|
+
## [1.20.2]
|
|
91
|
+
- Card: change cursor to default for cards without buttons
|
|
92
|
+
- HighlightsCarousel: hide button in case there are no text for them
|
|
93
|
+
|
|
94
|
+
## [1.20.1]
|
|
95
|
+
- Reset the select component's selected value to the first option if options change
|
|
96
|
+
|
|
97
|
+
## [1.20.0]
|
|
98
|
+
- Tickbox: Add black-on-white option
|
|
99
|
+
## [1.19.0]
|
|
100
|
+
- Add timer to navigation basket
|
|
101
|
+
## [1.18.3]
|
|
102
|
+
- iOS devices show image instead of video for Compact PageHeading
|
|
103
|
+
|
|
104
|
+
## [1.18.1-2]
|
|
105
|
+
- Fix iOS exception on VideoControls
|
|
106
|
+
|
|
107
|
+
## [1.18.0]
|
|
108
|
+
- Add Compact PageHeading component
|
|
109
|
+
|
|
110
|
+
## [1.17.0]
|
|
111
|
+
- Add Page Heading Panel variant
|
|
112
|
+
|
|
113
|
+
## [1.16.0]
|
|
114
|
+
- Implemented a new Timer component
|
|
115
|
+
- Progress: extended the component, added it to Storybook
|
|
116
|
+
- PromoWithTags: added Timer component
|
|
117
|
+
- PromoWithTags: added possibility to configure type of the buttons
|
|
118
|
+
- Highlight Carousel: added Timer component
|
|
119
|
+
- Card: added label
|
|
120
|
+
|
|
121
|
+
## [1.15.1]
|
|
122
|
+
- Change to pagination component to align page numbers with URL numbers.
|
|
123
|
+
|
|
124
|
+
## [1.15.0]
|
|
125
|
+
- Implemented a new Select component
|
|
126
|
+
|
|
127
|
+
## [1.14.0]
|
|
128
|
+
- Added standfirst functionality to Accordion/ Accordions component and theme for Schools Platform
|
|
129
|
+
|
|
130
|
+
## [1.13.2]
|
|
131
|
+
- Add styled-components to dev-dependencies, to fix issues with tests that appear after adding the new styled components
|
|
132
|
+
|
|
133
|
+
## [1.13.1]
|
|
134
|
+
- AnchorTabBar: fix the issues on mobile devices that are related to scroll/stickiness
|
|
135
|
+
|
|
136
|
+
## [1.13.0]
|
|
137
|
+
- Implemented a new TextField component
|
|
138
|
+
|
|
139
|
+
## [1.12.4]
|
|
140
|
+
- Search: change copy
|
|
141
|
+
|
|
142
|
+
## [1.12.0]
|
|
143
|
+
- Search: Extend ContentSummary and SearchBar components to support new search results
|
|
144
|
+
|
|
145
|
+
## [1.11.0]
|
|
146
|
+
- Carousels: Rewrite logic that cuts description, to support older browsers
|
|
147
|
+
|
|
148
|
+
## [1.10.0]
|
|
149
|
+
- PageHeadingImpact: Replace CSS background-image with HTML image element
|
|
150
|
+
|
|
151
|
+
## [1.9.0]
|
|
152
|
+
- Card: Add a new prop for the hover line color
|
|
153
|
+
|
|
154
|
+
## [1.8.0]
|
|
155
|
+
- SearchBar: Disable
|
|
156
|
+
|
|
157
|
+
## [1.7.2]
|
|
158
|
+
- Add imageAltText to Card component
|
|
159
|
+
|
|
160
|
+
## [1.7.0]
|
|
161
|
+
- Add new ContentSummary component
|
|
162
|
+
- Add new ContentSummarySection component
|
|
163
|
+
- Add Content Summary Section and individual Content Summaries
|
|
164
|
+
|
|
165
|
+
## [1.6.3]
|
|
166
|
+
- Add exports for zIndexes
|
|
167
|
+
|
|
168
|
+
## [1.6.2]
|
|
169
|
+
- ImpactHeader: add alt text for sponsors logo custom image
|
|
170
|
+
|
|
171
|
+
## [1.6.1]
|
|
172
|
+
- PageHeadingHighlight component: update exports
|
|
173
|
+
|
|
174
|
+
## [1.6.0]
|
|
175
|
+
- Add new PageHeadingHighlight component
|
|
176
|
+
|
|
177
|
+
## [1.5.0]
|
|
178
|
+
- PageHeading: decrease header height when title is not available
|
|
179
|
+
|
|
180
|
+
## [1.4.0]
|
|
181
|
+
- ImpactHeader: make it possible to pass custom image as a sponsor logo
|
|
182
|
+
|
|
183
|
+
## [1.3.1]
|
|
184
|
+
- Enable reduced size textLinks on PromoWithTags/asCard
|
|
185
|
+
|
|
186
|
+
## [1.3.0]
|
|
187
|
+
- Add Static Actvivity Cards as PromoWithTags variant
|
|
188
|
+
|
|
189
|
+
## [1.2.0]
|
|
190
|
+
- Card: buttons do not change position on mobiles;
|
|
2
191
|
|
|
3
192
|
## [1.1.0]
|
|
4
193
|
- TitleWithCTA: fix cases with a long title
|
|
@@ -11,6 +200,9 @@
|
|
|
11
200
|
- Card component: buttons are aligned by height
|
|
12
201
|
- Highlight carousel: added possibility to display two CTAs
|
|
13
202
|
|
|
203
|
+
## [0.7.50]
|
|
204
|
+
- Add Static Actvivity Cards
|
|
205
|
+
|
|
14
206
|
## [0.7.49]
|
|
15
207
|
- Change button behaviour on stream and DED pages
|
|
16
208
|
|
|
@@ -233,7 +425,7 @@
|
|
|
233
425
|
- Fix in PageHeadingImpact image
|
|
234
426
|
|
|
235
427
|
## [0.4.4]
|
|
236
|
-
-
|
|
428
|
+
- AnchorTabBar a11y: added tabIndex to links
|
|
237
429
|
|
|
238
430
|
## [0.4.3]
|
|
239
431
|
- Prevent focus when navigation tab is clicked
|
|
@@ -245,7 +437,7 @@
|
|
|
245
437
|
## [0.4.1]
|
|
246
438
|
- Swiper included as dependency
|
|
247
439
|
- Fix for italics in Editorial, Card and PromoWithTitle components
|
|
248
|
-
- Extra Props for
|
|
440
|
+
- Extra Props for AnchorTabBar
|
|
249
441
|
|
|
250
442
|
## [0.4.0]
|
|
251
443
|
- Navigation Logo breaking change
|
|
@@ -287,7 +479,7 @@
|
|
|
287
479
|
- Subtitles 2 typography changes
|
|
288
480
|
|
|
289
481
|
## [0.3.3]
|
|
290
|
-
- Added
|
|
482
|
+
- Added AnchorTabBar Component
|
|
291
483
|
- Added Accordion Component
|
|
292
484
|
- Added Card Component
|
|
293
485
|
- Fixes to fonts setup
|
package/README.GIT
CHANGED
|
@@ -1,122 +1,277 @@
|
|
|
1
|
-
# Royal Opera House - Front End Design System
|
|
1
|
+
# Royal Opera House Chord - Front End Design System
|
|
2
2
|
|
|
3
|
-
Welcome to
|
|
3
|
+
Welcome to The Royal Opera House Front End Design System, `@royaloperahouse/chord`
|
|
4
4
|
|
|
5
5
|
This package is a library of UI components intended to be used in the ROH website.
|
|
6
6
|
|
|
7
7
|
It uses React, TypeScript, TSDX and Storybook.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The NPM packages are published at [https://www.npmjs.com/package/@royaloperahouse/chord](https://www.npmjs.com/package/@royaloperahouse/chord)
|
|
10
10
|
|
|
11
|
-
The
|
|
11
|
+
The Storybook for the latest version of the library is hosted at [chord.roh.org.uk](chord.roh.org.uk)
|
|
12
12
|
|
|
13
|
-
|
|
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:
|
|
14
56
|
|
|
15
57
|
```bash
|
|
16
|
-
yarn
|
|
58
|
+
yarn storybook
|
|
17
59
|
```
|
|
18
60
|
|
|
19
|
-
|
|
61
|
+
By default the storybook will be accessible at
|
|
62
|
+
[http://localhost:6006/]()
|
|
20
63
|
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
23
76
|
```
|
|
24
77
|
|
|
25
|
-
|
|
78
|
+
Run:
|
|
26
79
|
|
|
27
|
-
```
|
|
28
|
-
yarn
|
|
80
|
+
```
|
|
81
|
+
yarn deploy-storybook-dev
|
|
29
82
|
```
|
|
30
83
|
|
|
31
|
-
|
|
84
|
+
to build and deploy the storybook from your repo to Chromatic.
|
|
32
85
|
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
35
100
|
```
|
|
36
101
|
|
|
37
|
-
|
|
102
|
+
then run:
|
|
38
103
|
|
|
39
104
|
```bash
|
|
40
|
-
yarn
|
|
105
|
+
yarn deploy-storybook
|
|
41
106
|
```
|
|
42
107
|
|
|
43
|
-
This
|
|
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:
|
|
44
117
|
|
|
45
|
-
|
|
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.
|
|
46
119
|
|
|
47
|
-
|
|
120
|
+
A **stable** package is published for use in production.
|
|
48
121
|
|
|
49
|
-
|
|
122
|
+
**NOTE:** You will need the `NPM_TOKEN`, as described in 'Prerequisites' above.
|
|
50
123
|
|
|
51
|
-
|
|
124
|
+
### **1. To release a snapshot version**
|
|
52
125
|
|
|
53
|
-
|
|
54
|
-
'Command line or programmatic access'
|
|
126
|
+
> **IMPORTANT:** Make sure you always publish your **snapshots** from `chord-development` after merging in your feature branch.
|
|
55
127
|
|
|
56
|
-
|
|
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.
|
|
57
129
|
|
|
58
|
-
|
|
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`
|
|
59
131
|
|
|
60
|
-
|
|
132
|
+
To publish a snapshot use:
|
|
61
133
|
|
|
62
134
|
```bash
|
|
63
|
-
yarn
|
|
135
|
+
NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-snapshot
|
|
64
136
|
```
|
|
65
137
|
|
|
66
|
-
|
|
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.
|
|
67
143
|
|
|
68
|
-
|
|
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:
|
|
69
147
|
|
|
70
148
|
```bash
|
|
71
|
-
yarn
|
|
149
|
+
NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
|
|
72
150
|
```
|
|
73
151
|
|
|
74
|
-
To release a new version.
|
|
75
152
|
|
|
76
|
-
|
|
77
|
-
|
|
153
|
+
## Using the Package
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
The package is deployed to NPM, and can be installed using yarn or npm:
|
|
78
157
|
|
|
79
158
|
```bash
|
|
80
|
-
|
|
159
|
+
npm i --save @royaloperahouse/chord
|
|
160
|
+
```
|
|
161
|
+
```bash
|
|
162
|
+
yarn add @royaloperahouse/chord
|
|
81
163
|
```
|
|
82
164
|
|
|
83
165
|
|
|
84
|
-
|
|
166
|
+
## Testing
|
|
167
|
+
---
|
|
85
168
|
|
|
86
|
-
|
|
169
|
+
To **Lint** the package use:
|
|
87
170
|
|
|
88
|
-
|
|
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:
|
|
89
177
|
|
|
90
178
|
```bash
|
|
91
|
-
|
|
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
|
|
92
183
|
```
|
|
184
|
+
|
|
185
|
+
To **run and and store the unit tests** for display in storybook use:
|
|
186
|
+
|
|
93
187
|
```bash
|
|
94
|
-
|
|
188
|
+
yarn test-storybook
|
|
189
|
+
# Use the -u option to update snapshots if needed
|
|
95
190
|
```
|
|
96
191
|
|
|
97
|
-
# Processes to follow prior to commits
|
|
98
192
|
|
|
99
|
-
|
|
193
|
+
## Development Process
|
|
194
|
+
---
|
|
100
195
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
|
107
205
|
|
|
108
|
-
|
|
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
|
+
```
|
|
109
266
|
|
|
110
|
-
|
|
111
|
-
- Commit any merge changes locally
|
|
112
|
-
- Push your branch changes to the origin repo
|
|
113
|
-
- Raise a Pull Request to merge back into the main development branch, AND ensure that the required reviewers are assigned.
|
|
114
|
-
- The reviewers may raise issues, and once resolved, they will be responsible for performing the merge.
|
|
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.
|
|
115
268
|
|
|
116
|
-
|
|
269
|
+
---
|
|
270
|
+
### Examples
|
|
117
271
|
|
|
118
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.
|
|
119
273
|
|
|
274
|
+
---
|
|
120
275
|
### Bundle analysis
|
|
121
276
|
|
|
122
|
-
|
|
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`.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Royal Opera House - chord
|
|
2
2
|
|
|
3
|
-
Welcome to
|
|
3
|
+
Welcome to The Royal Opera House library components `@royaloperahouse/chord`.
|
|
4
4
|
|
|
5
5
|
This package is a library of UI components intended to be used in the ROH website.
|
|
6
6
|
|
|
@@ -55,7 +55,7 @@ const App = ({ children }: InnerProps): React.ReactElement => (
|
|
|
55
55
|
|
|
56
56
|
## Components
|
|
57
57
|
|
|
58
|
-
Accordion, Accordions, AltHeader,
|
|
58
|
+
Accordion, Accordions, AltHeader, AnchorTabBar, AnnouncementBanner, BodyText, Card, Cards, Carousel, CinemaBadge, ContactCard, ControlledDropdown, devices, Editorial, Footer, GlobalStyles, Grid, GridItem, Header, HighlightsCarousel, HighlightsCarouselCinema, HighlightsCarouselCore, HighlightsCarouselStream, Icon, ImageWithCaption, Navigation, Overline, PageHeadingCinema, PageHeadingCore, PageHeadingImpact, PageHeadingStream, PeopleListing, PrimaryButton, PromoWithTags, PromoWithTitle, RotatorButtons, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Sponsorship, StickyBar, StreamBadge, Subtitle, Tab, TabLink, Tabs, TertiaryButton, TextLink, TextOnly, Tickbox, TitleWithCTA, ThemeProvider, TypeTags, Quote
|
|
59
59
|
|
|
60
60
|
## Types
|
|
61
61
|
|