@royaloperahouse/chord 2.1.3 → 2.1.4-b-chord-development-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.
- package/CHANGELOG.md +47 -3
- package/README.md +250 -40
- package/dist/chord.cjs.development.js +46 -11
- 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 +46 -11
- 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/molecules/PageHeading/Compact/components/CompactHeaderBranding.d.ts +1 -0
- package/dist/components/molecules/PageHeading/index.d.ts +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/types/formTypes.d.ts +12 -9
- package/dist/types/impactHeader.d.ts +6 -2
- package/package.json +1 -1
- package/README.GIT +0 -277
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
## [2.1.4]
|
|
2
|
+
- Fix screenreader accessibility for accordions
|
|
3
|
+
|
|
1
4
|
## [2.1.3]
|
|
2
5
|
- Navigation: make links links
|
|
3
6
|
- Clear testing errors
|
|
@@ -46,6 +49,10 @@
|
|
|
46
49
|
## [1.24.0]
|
|
47
50
|
- Implement Upsell Section & Upsell Cards
|
|
48
51
|
|
|
52
|
+
## [1.23.2-b]
|
|
53
|
+
- Add Stepper component
|
|
54
|
+
- Fix solo negative sign NaN bug
|
|
55
|
+
-
|
|
49
56
|
## [1.23.2]
|
|
50
57
|
- Fix BrandingStyle not showing bug
|
|
51
58
|
|
|
@@ -60,12 +67,15 @@
|
|
|
60
67
|
- TickBox: Added disabled and error states
|
|
61
68
|
|
|
62
69
|
## [1.21.1]
|
|
63
|
-
-
|
|
70
|
+
- Compact PageHeading: Refactored to support iOS devices
|
|
64
71
|
|
|
65
72
|
## [1.21.0]
|
|
66
73
|
- TextLogo: add new component
|
|
67
74
|
- Compact PageHeading: swap logo with TextLogo to fix iOS issues
|
|
68
75
|
|
|
76
|
+
## [1.20.2-a]
|
|
77
|
+
- Made select state reset behaviour opt-in
|
|
78
|
+
|
|
69
79
|
## [1.20.2]
|
|
70
80
|
- Card: change cursor to default for cards without buttons
|
|
71
81
|
- HighlightsCarousel: hide button in case there are no text for them
|
|
@@ -101,7 +111,7 @@
|
|
|
101
111
|
- Change to pagination component to align page numbers with URL numbers.
|
|
102
112
|
|
|
103
113
|
## [1.15.0]
|
|
104
|
-
-
|
|
114
|
+
- Add Compact PageHeading component
|
|
105
115
|
|
|
106
116
|
## [1.14.0]
|
|
107
117
|
- Added standfirst functionality to Accordion/ Accordions component and theme for Schools Platform
|
|
@@ -121,21 +131,55 @@
|
|
|
121
131
|
## [1.12.0]
|
|
122
132
|
- Search: Extend ContentSummary and SearchBar components to support new search results
|
|
123
133
|
|
|
134
|
+
## [1.11.0-a]
|
|
135
|
+
- Pagination: add new component
|
|
136
|
+
|
|
124
137
|
## [1.11.0]
|
|
125
138
|
- Carousels: Rewrite logic that cuts description, to support older browsers
|
|
126
139
|
|
|
140
|
+
## [1.10.0-a]
|
|
141
|
+
- ContentSummary: make image clickable
|
|
142
|
+
|
|
127
143
|
## [1.10.0]
|
|
128
144
|
- PageHeadingImpact: Replace CSS background-image with HTML image element
|
|
129
145
|
|
|
130
146
|
## [1.9.0]
|
|
131
147
|
- Card: Add a new prop for the hover line color
|
|
148
|
+
## [1.9.0-c]
|
|
149
|
+
- ContentSummary: make image clickable
|
|
150
|
+
|
|
151
|
+
## [1.9.0-b]
|
|
152
|
+
- ContentSummary: change image size
|
|
153
|
+
- SearchBar: Export component
|
|
154
|
+
|
|
155
|
+
## [1.9.0-a]
|
|
156
|
+
- ContentSummary: change image props
|
|
157
|
+
|
|
158
|
+
## [1.9.0]
|
|
159
|
+
- Card: Add a new prop for the hover line color
|
|
160
|
+
|
|
161
|
+
## [1.8.1-h]
|
|
162
|
+
- ContentSummary: add exports
|
|
163
|
+
|
|
164
|
+
## [1.8.1-g]
|
|
165
|
+
- ContentSummary: refactor
|
|
166
|
+
|
|
167
|
+
## [1.8.1-f]
|
|
168
|
+
- ContentSummary: update conditional rendering
|
|
169
|
+
|
|
170
|
+
## [1.8.1-c]
|
|
171
|
+
- ContentSummary: update for Search results
|
|
172
|
+
- ContentSummarySection: remove
|
|
173
|
+
|
|
174
|
+
## [1.8.1-b]
|
|
175
|
+
- Card: add new prop for the line color on hover
|
|
132
176
|
|
|
133
177
|
## [1.8.0]
|
|
134
178
|
- SearchBar: Disable
|
|
135
179
|
|
|
136
180
|
## [1.7.2]
|
|
137
181
|
- Add imageAltText to Card component
|
|
138
|
-
|
|
182
|
+
|
|
139
183
|
## [1.7.0]
|
|
140
184
|
- Add new ContentSummary component
|
|
141
185
|
- Add new ContentSummarySection component
|
package/README.md
CHANGED
|
@@ -1,67 +1,277 @@
|
|
|
1
|
-
# Royal Opera House -
|
|
1
|
+
# Royal Opera House Chord - Front End Design System
|
|
2
2
|
|
|
3
|
-
Welcome to the Royal Opera House
|
|
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
|
+
It uses React, TypeScript, TSDX and Storybook.
|
|
7
8
|
|
|
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:
|
|
9
133
|
|
|
10
134
|
```bash
|
|
11
|
-
|
|
135
|
+
NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-snapshot
|
|
12
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
|
+
|
|
13
148
|
```bash
|
|
14
|
-
|
|
149
|
+
NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
|
|
15
150
|
```
|
|
16
151
|
|
|
17
|
-
## Usage
|
|
18
152
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
153
|
+
## Using the Package
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
The package is deployed to NPM, and can be installed using yarn or npm:
|
|
23
157
|
|
|
158
|
+
```bash
|
|
159
|
+
npm i --save @royaloperahouse/chord
|
|
24
160
|
```
|
|
25
|
-
|
|
161
|
+
```bash
|
|
162
|
+
yarn add @royaloperahouse/chord
|
|
163
|
+
```
|
|
164
|
+
|
|
26
165
|
|
|
27
|
-
|
|
166
|
+
## Testing
|
|
167
|
+
---
|
|
28
168
|
|
|
29
|
-
|
|
30
|
-
Footer, GlobalStyles, ThemeProvider, ThemeType,
|
|
31
|
-
} from '@royaloperahouse/chord';
|
|
169
|
+
To **Lint** the package use:
|
|
32
170
|
|
|
171
|
+
```bash
|
|
172
|
+
yarn lint
|
|
173
|
+
# Use the --fix option to perform automatic fixes
|
|
174
|
+
```
|
|
33
175
|
|
|
34
|
-
|
|
35
|
-
<ErrorBoundary>
|
|
36
|
-
<ThemeProvider theme={ThemeType.Core}>
|
|
37
|
-
<GlobalStyles />
|
|
38
|
-
<Wrapper>
|
|
39
|
-
<Header />
|
|
40
|
-
<GlobalStyle />
|
|
41
|
-
<HealthBanner />
|
|
42
|
-
<ErrorBoundary>
|
|
43
|
-
<Content>
|
|
44
|
-
{children}
|
|
45
|
-
</Content>
|
|
46
|
-
</ErrorBoundary>
|
|
47
|
-
<LiveChat />
|
|
48
|
-
</Wrapper>
|
|
49
|
-
<Footer data={footerData} />
|
|
50
|
-
</ThemeProvider>
|
|
51
|
-
</ErrorBoundary>
|
|
52
|
-
);
|
|
176
|
+
To run the **unit tests** (using Jest) use:
|
|
53
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
|
|
54
183
|
```
|
|
55
184
|
|
|
56
|
-
|
|
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:
|
|
57
224
|
|
|
58
|
-
|
|
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
|
+
```
|
|
59
266
|
|
|
60
|
-
|
|
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.
|
|
61
268
|
|
|
62
|
-
|
|
269
|
+
---
|
|
270
|
+
### Examples
|
|
63
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.
|
|
64
273
|
|
|
65
|
-
|
|
274
|
+
---
|
|
275
|
+
### Bundle analysis
|
|
66
276
|
|
|
67
|
-
|
|
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`.
|
|
@@ -1581,6 +1581,21 @@ var Twitter = (function (_ref) {
|
|
|
1581
1581
|
}));
|
|
1582
1582
|
});
|
|
1583
1583
|
|
|
1584
|
+
var X = (function (_ref) {
|
|
1585
|
+
var _ref$color = _ref.color,
|
|
1586
|
+
color = _ref$color === void 0 ? '#1A1A1A' : _ref$color;
|
|
1587
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
1588
|
+
width: "100%",
|
|
1589
|
+
height: "100%",
|
|
1590
|
+
viewBox: "0 0 24 24",
|
|
1591
|
+
fill: "none",
|
|
1592
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1593
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
1594
|
+
d: "M13.7124 10.6179L20.4133 3H18.8254L13.007 9.61448L8.35992 3H3L10.0274 13.0023L3 20.9908H4.58799L10.7324 14.0056L15.6401 20.9908H21L13.7124 10.6179ZM11.5375 13.0904L10.8255 12.0944L5.16016 4.16911H7.59922L12.1712 10.5651L12.8832 11.5611L18.8262 19.8748H16.3871L11.5375 13.0904Z",
|
|
1595
|
+
fill: color
|
|
1596
|
+
}));
|
|
1597
|
+
});
|
|
1598
|
+
|
|
1584
1599
|
var Youtube = (function (_ref) {
|
|
1585
1600
|
var _ref$color = _ref.color,
|
|
1586
1601
|
color = _ref$color === void 0 ? '#1A1A1A' : _ref$color;
|
|
@@ -2135,6 +2150,7 @@ var IconLibrary = {
|
|
|
2135
2150
|
UserSignedIn: UserSignedIn,
|
|
2136
2151
|
Volume: Volume,
|
|
2137
2152
|
Watch: Watch,
|
|
2153
|
+
X: X,
|
|
2138
2154
|
Youtube: Youtube
|
|
2139
2155
|
};
|
|
2140
2156
|
|
|
@@ -5663,20 +5679,29 @@ var Accordion = function Accordion(_ref) {
|
|
|
5663
5679
|
return visibleStandfirst ? /*#__PURE__*/React__default.createElement(ContentContainer, null, /*#__PURE__*/React__default.createElement(ChildrenContainer, null, visibleStandfirst)) : null;
|
|
5664
5680
|
};
|
|
5665
5681
|
|
|
5666
|
-
|
|
5682
|
+
var contentContainerId = title + "-accordion-content";
|
|
5683
|
+
return /*#__PURE__*/React__default.createElement(AccordionContainer, {
|
|
5684
|
+
tabIndex: 0,
|
|
5685
|
+
onKeyDown: keyDown
|
|
5686
|
+
}, /*#__PURE__*/React__default.createElement(LineContainer, null), /*#__PURE__*/React__default.createElement(TitleContainer$3, {
|
|
5667
5687
|
onClick: toggleAccordion,
|
|
5668
|
-
|
|
5669
|
-
|
|
5688
|
+
tabIndex: -1,
|
|
5689
|
+
role: "button",
|
|
5690
|
+
"aria-label": title,
|
|
5691
|
+
"aria-expanded": openAccordion,
|
|
5692
|
+
"aria-controls": contentContainerId
|
|
5670
5693
|
}, /*#__PURE__*/React__default.createElement("h4", null, /*#__PURE__*/React__default.createElement("a", {
|
|
5671
5694
|
className: "accordion-title"
|
|
5672
5695
|
}, title)), children && /*#__PURE__*/React__default.createElement(Icon, {
|
|
5673
5696
|
iconName: iconName
|
|
5674
|
-
})), /*#__PURE__*/React__default.createElement(Standfirst, null), /*#__PURE__*/React__default.createElement(ContentContainer, {
|
|
5697
|
+
})), visibleStandfirst && /*#__PURE__*/React__default.createElement(Standfirst, null), /*#__PURE__*/React__default.createElement(ContentContainer, {
|
|
5675
5698
|
"data-testid": "richcontainer",
|
|
5676
5699
|
ref: content,
|
|
5677
5700
|
style: {
|
|
5678
5701
|
maxHeight: "" + textHeight
|
|
5679
|
-
}
|
|
5702
|
+
},
|
|
5703
|
+
id: contentContainerId,
|
|
5704
|
+
"aria-live": "polite"
|
|
5680
5705
|
}, /*#__PURE__*/React__default.createElement(ChildrenContainer, {
|
|
5681
5706
|
style: childrenVisibility
|
|
5682
5707
|
}, children)), showLine && /*#__PURE__*/React__default.createElement(LineContainer, null));
|
|
@@ -6717,7 +6742,7 @@ var PrimaryButtonWithInversion = /*#__PURE__*/styled__default(PrimaryButton)(_te
|
|
|
6717
6742
|
return invert ? theme.colors.white : theme.colors.black;
|
|
6718
6743
|
});
|
|
6719
6744
|
|
|
6720
|
-
var renderBranding = function renderBranding(brandingStyle, invert, brandingText) {
|
|
6745
|
+
var renderBranding = function renderBranding(brandingStyle, invert, brandingText, brandingLink) {
|
|
6721
6746
|
var color = invert ? exports.Colors.Black : exports.Colors.White;
|
|
6722
6747
|
|
|
6723
6748
|
switch (brandingStyle) {
|
|
@@ -6731,6 +6756,13 @@ var renderBranding = function renderBranding(brandingStyle, invert, brandingText
|
|
|
6731
6756
|
}
|
|
6732
6757
|
});
|
|
6733
6758
|
|
|
6759
|
+
case 'TextLink':
|
|
6760
|
+
return (brandingText == null ? void 0 : brandingText.trim()) && /*#__PURE__*/React__default.createElement(TextLink, {
|
|
6761
|
+
target: 'blank',
|
|
6762
|
+
href: brandingLink,
|
|
6763
|
+
color: color
|
|
6764
|
+
}, truncate(stripAllHtmlTags(brandingText), 25));
|
|
6765
|
+
|
|
6734
6766
|
case 'StreamLogo':
|
|
6735
6767
|
return /*#__PURE__*/React__default.createElement(Logo, {
|
|
6736
6768
|
color: color,
|
|
@@ -6754,14 +6786,15 @@ var CompactHeaderBranding = function CompactHeaderBranding(_ref) {
|
|
|
6754
6786
|
var brandingStyle = _ref.brandingStyle,
|
|
6755
6787
|
_ref$invert = _ref.invert,
|
|
6756
6788
|
invert = _ref$invert === void 0 ? false : _ref$invert,
|
|
6757
|
-
brandingText = _ref.brandingText
|
|
6758
|
-
|
|
6789
|
+
brandingText = _ref.brandingText,
|
|
6790
|
+
brandingLink = _ref.brandingLink;
|
|
6791
|
+
return /*#__PURE__*/React__default.createElement(CompactHeaderLogoWrapper, null, renderBranding(brandingStyle, invert, brandingText, brandingLink));
|
|
6759
6792
|
};
|
|
6760
6793
|
|
|
6761
6794
|
var isIOS = function isIOS() {
|
|
6762
6795
|
try {
|
|
6763
6796
|
console.warn('Do not use this on server side rendering, it may throw an error.');
|
|
6764
|
-
if (typeof navigator === undefined) return false;
|
|
6797
|
+
if (typeof navigator === 'undefined') return false;
|
|
6765
6798
|
return ['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(navigator.platform) || // iPad on iOS 13 detection
|
|
6766
6799
|
navigator.userAgent.includes('Mac') && 'ontouchend' in document;
|
|
6767
6800
|
} catch (e) {
|
|
@@ -6777,7 +6810,7 @@ var useIOS = function useIOS() {
|
|
|
6777
6810
|
setIOS = _useState[1];
|
|
6778
6811
|
|
|
6779
6812
|
React.useEffect(function () {
|
|
6780
|
-
if (typeof navigator === undefined) return;
|
|
6813
|
+
if (typeof navigator === 'undefined') return;
|
|
6781
6814
|
setIOS(isIOS());
|
|
6782
6815
|
}, []);
|
|
6783
6816
|
return IOS;
|
|
@@ -6917,7 +6950,8 @@ var PageHeadingCompact = function PageHeadingCompact(_ref4) {
|
|
|
6917
6950
|
invert = _ref4$invert === void 0 ? false : _ref4$invert,
|
|
6918
6951
|
_ref4$brandingStyle = _ref4.brandingStyle,
|
|
6919
6952
|
brandingStyle = _ref4$brandingStyle === void 0 ? 'BlockText' : _ref4$brandingStyle,
|
|
6920
|
-
brandingText = _ref4.brandingText
|
|
6953
|
+
brandingText = _ref4.brandingText,
|
|
6954
|
+
brandingLink = _ref4.brandingLink;
|
|
6921
6955
|
|
|
6922
6956
|
var _ref5 = link || {},
|
|
6923
6957
|
linkText = _ref5.text,
|
|
@@ -6949,6 +6983,7 @@ var PageHeadingCompact = function PageHeadingCompact(_ref4) {
|
|
|
6949
6983
|
}, /*#__PURE__*/React__default.createElement(CompactHeaderBranding, {
|
|
6950
6984
|
brandingStyle: brandingStyle,
|
|
6951
6985
|
brandingText: brandingText,
|
|
6986
|
+
brandingLink: brandingLink,
|
|
6952
6987
|
invert: invert
|
|
6953
6988
|
}), /*#__PURE__*/React__default.createElement(CompactHeaderTitleWrapper, null, /*#__PURE__*/React__default.createElement(Header, {
|
|
6954
6989
|
level: titleSize,
|