@royaloperahouse/harmonic 0.18.4 → 0.18.5
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 +3 -0
- package/README.md +267 -43
- package/dist/components/molecules/PeopleListing/PeopleListing.d.ts +1 -1
- package/dist/components/molecules/PeopleListing/PeopleListing.style.d.ts +3 -1
- package/dist/components/molecules/PersonCard/PersonCard.style.d.ts +3 -1
- package/dist/components/molecules/Select2/Select2.d.ts +1 -1
- package/dist/harmonic.cjs.development.js +112 -37
- package/dist/harmonic.cjs.development.js.map +1 -1
- package/dist/harmonic.cjs.production.min.js +1 -1
- package/dist/harmonic.cjs.production.min.js.map +1 -1
- package/dist/harmonic.esm.js +112 -37
- package/dist/harmonic.esm.js.map +1 -1
- package/dist/types/card.d.ts +2 -0
- package/dist/types/types.d.ts +4 -0
- package/package.json +1 -1
- package/README.GIT +0 -294
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,69 +1,293 @@
|
|
|
1
|
-
# Royal Opera House -
|
|
1
|
+
# Royal Opera House Harmonic - 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/harmonic`
|
|
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 [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:
|
|
9
150
|
|
|
10
151
|
```bash
|
|
11
|
-
|
|
152
|
+
NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-snapshot
|
|
12
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
|
+
|
|
13
164
|
```bash
|
|
14
|
-
|
|
165
|
+
NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
|
|
15
166
|
```
|
|
16
167
|
|
|
17
|
-
## Usage
|
|
18
168
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
169
|
+
## Using the Package
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
The package is deployed to NPM, and can be installed using yarn or npm:
|
|
23
173
|
|
|
174
|
+
```bash
|
|
175
|
+
npm i --save @royaloperahouse/harmonic
|
|
24
176
|
```
|
|
25
|
-
|
|
177
|
+
```bash
|
|
178
|
+
yarn add @royaloperahouse/harmonic
|
|
179
|
+
```
|
|
180
|
+
|
|
26
181
|
|
|
27
|
-
|
|
182
|
+
## Testing
|
|
183
|
+
---
|
|
28
184
|
|
|
29
|
-
|
|
30
|
-
Footer, GlobalStyles, ThemeProvider, ThemeType,
|
|
31
|
-
} from '@royaloperahouse/harmonic';
|
|
185
|
+
To **Lint** the package use:
|
|
32
186
|
|
|
187
|
+
```bash
|
|
188
|
+
yarn lint
|
|
189
|
+
# Use the --fix option to perform automatic fixes
|
|
190
|
+
```
|
|
33
191
|
|
|
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
|
-
);
|
|
192
|
+
To run the **unit tests** (using Jest) use:
|
|
53
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
|
|
54
199
|
```
|
|
55
200
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
```
|
|
59
282
|
|
|
60
|
-
|
|
61
|
-
Colors, Footer, Iconography, Navigation, Tab, Tabs, TabLink
|
|
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.
|
|
62
284
|
|
|
63
|
-
|
|
64
|
-
|
|
285
|
+
---
|
|
286
|
+
### Examples
|
|
65
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.
|
|
66
289
|
|
|
67
|
-
|
|
290
|
+
---
|
|
291
|
+
### Bundle analysis
|
|
68
292
|
|
|
69
|
-
|
|
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,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IPeopleListing } from '../../../types/types';
|
|
3
|
-
declare const PeopleListing: ({ roles, className }: IPeopleListing) => React.JSX.Element;
|
|
3
|
+
declare const PeopleListing: ({ roles, className, greyscale, largeDesktopColumns }: IPeopleListing) => React.JSX.Element;
|
|
4
4
|
export default PeopleListing;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare const PersonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const HeadshotWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
export declare const HeadshotWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
greyscale?: boolean | undefined;
|
|
4
|
+
}, never>;
|
|
@@ -2,7 +2,7 @@ import React, { FunctionComponent } from 'react';
|
|
|
2
2
|
import { DropdownIndicatorProps } from 'react-select';
|
|
3
3
|
import { ISelect2Props } from '../../../types/formTypes';
|
|
4
4
|
export declare const DropdownIndicator: (props: DropdownIndicatorProps) => React.JSX.Element;
|
|
5
|
-
interface IWrapperProps extends Pick<ISelect2Props, 'label' | 'error' | 'width' | 'darkMode'> {
|
|
5
|
+
interface IWrapperProps extends Pick<ISelect2Props, 'label' | 'error' | 'width' | 'darkMode' | 'className'> {
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
export declare const WrapperComponent: FunctionComponent<IWrapperProps>;
|
|
@@ -5979,21 +5979,69 @@ var Accordion = function Accordion(_ref) {
|
|
|
5979
5979
|
var content = React.useRef(null);
|
|
5980
5980
|
var timeoutRef = React.useRef(null);
|
|
5981
5981
|
var rafRef = React.useRef(null);
|
|
5982
|
+
var resizeObserverRef = React.useRef(null);
|
|
5983
|
+
var intervalRef = React.useRef(null);
|
|
5982
5984
|
React.useEffect(function () {
|
|
5983
|
-
if (content
|
|
5985
|
+
if (content.current && initOpen) {
|
|
5984
5986
|
setTextHeight(content.current.scrollHeight + "px");
|
|
5985
5987
|
}
|
|
5986
|
-
}, [
|
|
5988
|
+
}, [initOpen]);
|
|
5987
5989
|
React.useEffect(function () {
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5990
|
+
var cleanup = function cleanup() {
|
|
5991
|
+
return undefined;
|
|
5992
|
+
};
|
|
5993
|
+
var el = content.current;
|
|
5994
|
+
if (!el) return cleanup;
|
|
5995
|
+
if (!openAccordion) {
|
|
5994
5996
|
setTextHeight('0px');
|
|
5997
|
+
if (resizeObserverRef.current) {
|
|
5998
|
+
resizeObserverRef.current.disconnect();
|
|
5999
|
+
resizeObserverRef.current = null;
|
|
6000
|
+
}
|
|
6001
|
+
if (intervalRef.current) {
|
|
6002
|
+
window.clearInterval(intervalRef.current);
|
|
6003
|
+
intervalRef.current = null;
|
|
6004
|
+
}
|
|
6005
|
+
if (rafRef.current) {
|
|
6006
|
+
window.cancelAnimationFrame(rafRef.current);
|
|
6007
|
+
rafRef.current = null;
|
|
6008
|
+
}
|
|
6009
|
+
return cleanup;
|
|
6010
|
+
}
|
|
6011
|
+
var updateHeight = function updateHeight() {
|
|
6012
|
+
setTextHeight(el.scrollHeight + "px");
|
|
6013
|
+
};
|
|
6014
|
+
rafRef.current = window.requestAnimationFrame(updateHeight);
|
|
6015
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
6016
|
+
var ro = new ResizeObserver(updateHeight);
|
|
6017
|
+
ro.observe(el);
|
|
6018
|
+
resizeObserverRef.current = ro;
|
|
6019
|
+
intervalRef.current = window.setInterval(updateHeight, 200);
|
|
6020
|
+
return function () {
|
|
6021
|
+
ro.disconnect();
|
|
6022
|
+
resizeObserverRef.current = null;
|
|
6023
|
+
if (intervalRef.current) {
|
|
6024
|
+
window.clearInterval(intervalRef.current);
|
|
6025
|
+
intervalRef.current = null;
|
|
6026
|
+
}
|
|
6027
|
+
if (rafRef.current) {
|
|
6028
|
+
window.cancelAnimationFrame(rafRef.current);
|
|
6029
|
+
rafRef.current = null;
|
|
6030
|
+
}
|
|
6031
|
+
};
|
|
5995
6032
|
}
|
|
5996
|
-
|
|
6033
|
+
intervalRef.current = window.setInterval(updateHeight, 200);
|
|
6034
|
+
return function () {
|
|
6035
|
+
if (intervalRef.current) {
|
|
6036
|
+
window.clearInterval(intervalRef.current);
|
|
6037
|
+
intervalRef.current = null;
|
|
6038
|
+
}
|
|
6039
|
+
if (rafRef.current) {
|
|
6040
|
+
window.cancelAnimationFrame(rafRef.current);
|
|
6041
|
+
rafRef.current = null;
|
|
6042
|
+
}
|
|
6043
|
+
};
|
|
6044
|
+
}, [openAccordion, childrenVisibility, children]);
|
|
5997
6045
|
React.useEffect(function () {
|
|
5998
6046
|
return function () {
|
|
5999
6047
|
if (timeoutRef.current) {
|
|
@@ -6004,6 +6052,14 @@ var Accordion = function Accordion(_ref) {
|
|
|
6004
6052
|
window.cancelAnimationFrame(rafRef.current);
|
|
6005
6053
|
rafRef.current = null;
|
|
6006
6054
|
}
|
|
6055
|
+
if (resizeObserverRef.current) {
|
|
6056
|
+
resizeObserverRef.current.disconnect();
|
|
6057
|
+
resizeObserverRef.current = null;
|
|
6058
|
+
}
|
|
6059
|
+
if (intervalRef.current) {
|
|
6060
|
+
window.clearInterval(intervalRef.current);
|
|
6061
|
+
intervalRef.current = null;
|
|
6062
|
+
}
|
|
6007
6063
|
};
|
|
6008
6064
|
}, []);
|
|
6009
6065
|
var toggleAccordion = function toggleAccordion() {
|
|
@@ -8628,7 +8684,10 @@ var Pagination = function Pagination(_ref) {
|
|
|
8628
8684
|
};
|
|
8629
8685
|
|
|
8630
8686
|
var _templateObject$Y;
|
|
8631
|
-
var PeopleListingGrid = /*#__PURE__*/styled__default(Grid)(_templateObject$Y || (_templateObject$Y = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n gap: 40px 36px;\n\n grid-template-columns: 1fr 1fr 1fr;\n\n @media ", " {\n grid-template-columns: 1fr;\n }\n\n @media ", " {\n grid-template-columns: 1fr 1fr;\n }\n\n @media ", " {\n grid-template-columns:
|
|
8687
|
+
var PeopleListingGrid = /*#__PURE__*/styled__default(Grid)(_templateObject$Y || (_templateObject$Y = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n gap: 40px 36px;\n\n grid-template-columns: 1fr 1fr 1fr;\n\n @media ", " {\n grid-template-columns: 1fr;\n }\n\n @media ", " {\n grid-template-columns: 1fr 1fr;\n }\n\n @media ", " {\n grid-template-columns: ", ";\n }\n"])), devices.mobile, devices.tablet, devices.largeDesktop, function (_ref) {
|
|
8688
|
+
var $largeDesktopColumns = _ref.$largeDesktopColumns;
|
|
8689
|
+
return "repeat(" + ($largeDesktopColumns != null ? $largeDesktopColumns : 4) + ", 1fr)";
|
|
8690
|
+
});
|
|
8632
8691
|
|
|
8633
8692
|
var _templateObject$Z, _templateObject2$M;
|
|
8634
8693
|
var TextWrapper$2 = /*#__PURE__*/styled__default.div(_templateObject$Z || (_templateObject$Z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n && {\n color: var(--color-primary-black);\n }\n grid-area: role-person;\n break-inside: avoid;\n"])));
|
|
@@ -8677,11 +8736,15 @@ var PersonDetails = function PersonDetails(_ref) {
|
|
|
8677
8736
|
|
|
8678
8737
|
var _templateObject$$, _templateObject2$O;
|
|
8679
8738
|
var PersonWrapper$1 = /*#__PURE__*/styled__default.div(_templateObject$$ || (_templateObject$$ = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: grid;\n grid-template-columns: 82px 1fr;\n grid-template-areas: 'headshot role-person';\n grid-column-gap: 16px;\n"])));
|
|
8680
|
-
var HeadshotWrapper = /*#__PURE__*/styled__default.div(_templateObject2$O || (_templateObject2$O = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n grid-area: headshot;\n img {\n width: 82px;\n height: 82px;\n }\n"])))
|
|
8739
|
+
var HeadshotWrapper = /*#__PURE__*/styled__default.div(_templateObject2$O || (_templateObject2$O = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n grid-area: headshot;\n img {\n width: 82px;\n height: 82px;\n filter: ", ";\n }\n"])), function (_ref) {
|
|
8740
|
+
var greyscale = _ref.greyscale;
|
|
8741
|
+
return greyscale ? 'grayscale(100%)' : 'none';
|
|
8742
|
+
});
|
|
8681
8743
|
|
|
8682
8744
|
var PersonCard = function PersonCard(_ref) {
|
|
8683
8745
|
var role = _ref.role,
|
|
8684
|
-
className = _ref.className
|
|
8746
|
+
className = _ref.className,
|
|
8747
|
+
greyscale = _ref.greyscale;
|
|
8685
8748
|
var hasHeadshot = React__default.useMemo(function () {
|
|
8686
8749
|
var _role$people;
|
|
8687
8750
|
var firstPerson = (_role$people = role.people) == null ? void 0 : _role$people[0];
|
|
@@ -8689,7 +8752,9 @@ var PersonCard = function PersonCard(_ref) {
|
|
|
8689
8752
|
}, [role]);
|
|
8690
8753
|
if (hasHeadshot) return /*#__PURE__*/React__default.createElement(PersonWrapper$1, {
|
|
8691
8754
|
className: className
|
|
8692
|
-
}, /*#__PURE__*/React__default.createElement(HeadshotWrapper,
|
|
8755
|
+
}, /*#__PURE__*/React__default.createElement(HeadshotWrapper, {
|
|
8756
|
+
greyscale: greyscale
|
|
8757
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
8693
8758
|
src: role.people[0].headshot,
|
|
8694
8759
|
alt: role.people[0].name
|
|
8695
8760
|
})), /*#__PURE__*/React__default.createElement(PersonDetails, {
|
|
@@ -8703,14 +8768,19 @@ var PersonCard = function PersonCard(_ref) {
|
|
|
8703
8768
|
|
|
8704
8769
|
var PeopleListing = function PeopleListing(_ref) {
|
|
8705
8770
|
var roles = _ref.roles,
|
|
8706
|
-
className = _ref.className
|
|
8771
|
+
className = _ref.className,
|
|
8772
|
+
greyscale = _ref.greyscale,
|
|
8773
|
+
largeDesktopColumns = _ref.largeDesktopColumns;
|
|
8707
8774
|
return /*#__PURE__*/React__default.createElement(PeopleListingGrid, {
|
|
8708
|
-
className: className
|
|
8775
|
+
className: className,
|
|
8776
|
+
"$largeDesktopColumns": largeDesktopColumns
|
|
8709
8777
|
}, roles.map(function (role, index) {
|
|
8710
8778
|
return /*#__PURE__*/React__default.createElement(GridItem, {
|
|
8711
8779
|
key: role.name + "-" + index
|
|
8712
8780
|
}, /*#__PURE__*/React__default.createElement(PersonCard, {
|
|
8713
|
-
role: role
|
|
8781
|
+
role: role,
|
|
8782
|
+
className: className,
|
|
8783
|
+
greyscale: greyscale
|
|
8714
8784
|
}));
|
|
8715
8785
|
}));
|
|
8716
8786
|
};
|
|
@@ -9994,35 +10064,35 @@ function Select(_ref3) {
|
|
|
9994
10064
|
|
|
9995
10065
|
var _templateObject$1a, _templateObject2$U, _templateObject3$G, _templateObject4$y;
|
|
9996
10066
|
var Container$4 = /*#__PURE__*/styled__default.div(_templateObject$1a || (_templateObject$1a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n"])));
|
|
9997
|
-
var SelectWrapper$1 = /*#__PURE__*/styled__default.div(_templateObject2$U || (_templateObject2$U = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: auto;\n max-width: ", ";\n\n .harmonic-select__control {\n min-height: 48px;\n border-radius: 0;\n transition: none;\n border: ", ";\n &:hover {\n border-color: ", ";\n }\n }\n .harmonic-select__control--is-focused {\n border-color: var(--base-
|
|
10067
|
+
var SelectWrapper$1 = /*#__PURE__*/styled__default.div(_templateObject2$U || (_templateObject2$U = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: auto;\n max-width: ", ";\n\n .harmonic-select__control {\n min-height: 48px;\n border-radius: 0;\n transition: none;\n border: ", ";\n &:hover {\n border-color: ", ";\n }\n }\n\n .harmonic-select__control--is-focused {\n border-color: var(--color-base-dark-grey);\n box-shadow: ", ";\n }\n\n .harmonic-select__control--menu-is-open {\n .harmonic-select__indicator {\n svg {\n transform: rotate(180deg);\n }\n }\n }\n\n .harmonic-select__indicator {\n font-size: 25px;\n padding: 0;\n margin-right: 12px;\n color: var(--color-primary-black);\n svg {\n height: 1em;\n width: 1em;\n color: inherit;\n path {\n fill: currentColor;\n color: inherit;\n }\n }\n }\n\n .harmonic-select__single-value,\n .harmonic-select__placeholder {\n margin-left: 0;\n margin-right: 0;\n font-family: var(--font-family-sans);\n font-weight: 400;\n font-size: 19px;\n line-height: 26px;\n letter-spacing: -0.5px;\n\n @media ", " {\n font-size: 17px;\n }\n }\n\n .harmonic-select__placeholder {\n color: var(--color-primary-black);\n }\n\n .harmonic-select__single-value {\n color: var(--color-primary-black);\n }\n\n .harmonic-select__value-container {\n padding-left: 20px;\n padding-right: 20px;\n padding-top: 1px;\n padding-bottom: 0px;\n }\n\n .harmonic-select--is-disabled {\n .harmonic-select__control {\n border: 1px solid var(--color-base-light-grey);\n background: var(--color-base-light-grey);\n }\n .harmonic-select__indicator,\n .harmonic-select__single-value {\n color: var(--color-base-dark-grey);\n }\n }\n\n .harmonic-select__menu {\n margin-top: -1px;\n box-shadow: none;\n border-radius: 0;\n border: 1px solid var(--color-base-mid-grey);\n }\n\n .harmonic-select__menu-list {\n padding: 10px 0;\n }\n\n .harmonic-select__option {\n padding: 10px 20px;\n font-family: var(--font-family-sans);\n font-weight: 400;\n font-size: 19px;\n line-height: 26px;\n letter-spacing: -0.5px;\n color: var(--color-primary-black);\n\n @media ", " {\n font-size: 17px;\n }\n\n &:active,\n &.harmonic-select__option--is-focused {\n background: var(--color-base-light-grey);\n }\n }\n\n .harmonic-select__option--is-selected {\n color: var(--color-primary-black);\n background: none;\n }\n\n .harmonic-select__input-container {\n margin: 0;\n padding-top: 0;\n padding-bottom: 0;\n color: var(--color-primary-black);\n }\n\n .harmonic-select__menu-notice {\n color: var(--color-primary-black);\n padding: 20px 20px;\n text-align: left;\n }\n\n .harmonic-select__menu-notice--loading {\n font-style: italic;\n }\n"])), function (_ref) {
|
|
9998
10068
|
var width = _ref.width;
|
|
9999
10069
|
if (!width) return 'none';
|
|
10000
10070
|
return width + "px";
|
|
10001
10071
|
}, function (_ref2) {
|
|
10002
10072
|
var error = _ref2.error;
|
|
10003
|
-
if (error !== undefined) return "1px solid var(--
|
|
10004
|
-
return "1px solid var(--base-
|
|
10073
|
+
if (error !== undefined) return "1px solid var(--color-state-error)";
|
|
10074
|
+
return "1px solid var(--color-base-mid-grey)";
|
|
10005
10075
|
}, function (_ref3) {
|
|
10006
10076
|
var error = _ref3.error;
|
|
10007
|
-
if (error !== undefined) return "var(--
|
|
10008
|
-
return "var(--base-
|
|
10077
|
+
if (error !== undefined) return "var(--color-state-error)";
|
|
10078
|
+
return "var(--color-base-dark-grey)";
|
|
10009
10079
|
}, function (_ref4) {
|
|
10010
10080
|
var darkMode = _ref4.darkMode;
|
|
10011
|
-
if (darkMode) return "0 0 0
|
|
10081
|
+
if (darkMode) return "0 0 0 1px var(--color-state-medium)";
|
|
10012
10082
|
return "0 0 0 3px var(--base-color-lapislazuli)";
|
|
10013
|
-
});
|
|
10014
|
-
var TextLabel$4 = /*#__PURE__*/styled__default.div(_templateObject3$G || (_templateObject3$G = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0 0 20px;\n color: ", ";\n"])), function (_ref5) {
|
|
10083
|
+
}, devices.mobile, devices.mobile);
|
|
10084
|
+
var TextLabel$4 = /*#__PURE__*/styled__default.div(_templateObject3$G || (_templateObject3$G = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0 0 20px;\n color: ", ";\n\n @media ", " {\n margin: 0 0 12px;\n }\n"])), function (_ref5) {
|
|
10015
10085
|
var darkMode = _ref5.darkMode;
|
|
10016
|
-
if (darkMode) return "var(--base-
|
|
10017
|
-
return "var(--
|
|
10018
|
-
});
|
|
10086
|
+
if (darkMode) return "var(--color-base-white)";
|
|
10087
|
+
return "var(--color-primary-black)";
|
|
10088
|
+
}, devices.mobile);
|
|
10019
10089
|
var ErrorLabel$5 = /*#__PURE__*/styled__default.div(_templateObject4$y || (_templateObject4$y = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 20px 0 0;\n color: ", ";\n"])), function (_ref6) {
|
|
10020
10090
|
var darkMode = _ref6.darkMode;
|
|
10021
|
-
if (darkMode) return "var(--base-
|
|
10022
|
-
return "var(--
|
|
10091
|
+
if (darkMode) return "var(--color-base-white)";
|
|
10092
|
+
return "var(--color-state-error)";
|
|
10023
10093
|
});
|
|
10024
10094
|
|
|
10025
|
-
var _excluded$o = ["label", "error", "width", "darkMode", "isSearchable", "components"];
|
|
10095
|
+
var _excluded$o = ["label", "error", "width", "darkMode", "isSearchable", "components", "className"];
|
|
10026
10096
|
var DropdownIndicator = function DropdownIndicator(props) {
|
|
10027
10097
|
return /*#__PURE__*/React__default.createElement(Select$1.components.DropdownIndicator, Object.assign({}, props), /*#__PURE__*/React__default.createElement(Icon, {
|
|
10028
10098
|
iconName: "DropdownArrow"
|
|
@@ -10033,12 +10103,15 @@ var WrapperComponent = function WrapperComponent(_ref) {
|
|
|
10033
10103
|
error = _ref.error,
|
|
10034
10104
|
width = _ref.width,
|
|
10035
10105
|
darkMode = _ref.darkMode,
|
|
10036
|
-
children = _ref.children
|
|
10037
|
-
|
|
10106
|
+
children = _ref.children,
|
|
10107
|
+
className = _ref.className;
|
|
10108
|
+
return /*#__PURE__*/React__default.createElement(Container$4, {
|
|
10109
|
+
className: className
|
|
10110
|
+
}, /*#__PURE__*/React__default.createElement("label", null, !!label && (/*#__PURE__*/React__default.createElement(TextLabel$4, {
|
|
10038
10111
|
darkMode: darkMode,
|
|
10039
10112
|
"data-testid": "select2-text-label"
|
|
10040
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
10041
|
-
|
|
10113
|
+
}, /*#__PURE__*/React__default.createElement(BodyCopyHarmonic, {
|
|
10114
|
+
size: "large"
|
|
10042
10115
|
}, label))), /*#__PURE__*/React__default.createElement(SelectWrapper$1, {
|
|
10043
10116
|
width: width,
|
|
10044
10117
|
error: error,
|
|
@@ -10046,8 +10119,8 @@ var WrapperComponent = function WrapperComponent(_ref) {
|
|
|
10046
10119
|
}, children)), !!error && (/*#__PURE__*/React__default.createElement(ErrorLabel$5, {
|
|
10047
10120
|
darkMode: darkMode,
|
|
10048
10121
|
"data-testid": "select2-error-label"
|
|
10049
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
10050
|
-
|
|
10122
|
+
}, /*#__PURE__*/React__default.createElement(BodyCopyHarmonic, {
|
|
10123
|
+
size: "medium"
|
|
10051
10124
|
}, error))));
|
|
10052
10125
|
};
|
|
10053
10126
|
/**
|
|
@@ -10073,12 +10146,14 @@ var SelectComponent = function SelectComponent(_ref2) {
|
|
|
10073
10146
|
_ref2$isSearchable = _ref2.isSearchable,
|
|
10074
10147
|
isSearchable = _ref2$isSearchable === void 0 ? false : _ref2$isSearchable,
|
|
10075
10148
|
components = _ref2.components,
|
|
10149
|
+
className = _ref2.className,
|
|
10076
10150
|
selectProps = _objectWithoutPropertiesLoose(_ref2, _excluded$o);
|
|
10077
10151
|
return /*#__PURE__*/React__default.createElement(WrapperComponent, {
|
|
10078
10152
|
label: label,
|
|
10079
10153
|
error: error,
|
|
10080
10154
|
width: width,
|
|
10081
|
-
darkMode: darkMode
|
|
10155
|
+
darkMode: darkMode,
|
|
10156
|
+
className: className
|
|
10082
10157
|
}, /*#__PURE__*/React__default.createElement(Select$1__default, Object.assign({}, selectProps, {
|
|
10083
10158
|
components: _extends({
|
|
10084
10159
|
DropdownIndicator: DropdownIndicator,
|