@royaloperahouse/chord 1.4.0 → 1.6.0

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## [1.6.0]
4
+ - Add new PageHeadingHighlight component
5
+
6
+ ## [1.5.0]
7
+ - PageHeading: decrease header height when title is not available
8
+
3
9
  ## [1.4.0]
4
10
  - ImpactHeader: make it possible to pass custom image as a sponsor logo
5
11
 
@@ -23,6 +29,9 @@
23
29
  - Card component: buttons are aligned by height
24
30
  - Highlight carousel: added possibility to display two CTAs
25
31
 
32
+ ## [0.7.50]
33
+ - Add Static Actvivity Cards
34
+
26
35
  ## [0.7.49]
27
36
  - Change button behaviour on stream and DED pages
28
37
 
@@ -245,7 +254,7 @@
245
254
  - Fix in PageHeadingImpact image
246
255
 
247
256
  ## [0.4.4]
248
- - AnchorTapBar a11y: added tabIndex to links
257
+ - AnchorTabBar a11y: added tabIndex to links
249
258
 
250
259
  ## [0.4.3]
251
260
  - Prevent focus when navigation tab is clicked
@@ -257,7 +266,7 @@
257
266
  ## [0.4.1]
258
267
  - Swiper included as dependency
259
268
  - Fix for italics in Editorial, Card and PromoWithTitle components
260
- - Extra Props for AnchorTapBar
269
+ - Extra Props for AnchorTabBar
261
270
 
262
271
  ## [0.4.0]
263
272
  - Navigation Logo breaking change
@@ -299,7 +308,7 @@
299
308
  - Subtitles 2 typography changes
300
309
 
301
310
  ## [0.3.3]
302
- - Added AnchorTapBar Component
311
+ - Added AnchorTabBar Component
303
312
  - Added Accordion Component
304
313
  - Added Card Component
305
314
  - Fixes to fonts setup
package/README.GIT CHANGED
@@ -1,122 +1,275 @@
1
- # Royal Opera House - Front End Design System
1
+ # Royal Opera House Chord - Front End Design System
2
2
 
3
- Welcome to the Royal Opera House Front End Design System, `@royaloperahouse/chord`.
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
- ## Commands
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 required package dependencies need to be insalled using `yarn`. Once ready you can issue the following:
11
+ The Storybook for the latest version of the library is hosted at [chord.roh.org.uk](chord.roh.org.uk)
12
12
 
13
- To run Lint on the package use:
13
+
14
+ ## Prerequisites
15
+ ---
16
+
17
+ * Make sure the required package dependencies are installed using `yarn install`
18
+
19
+ * **To deploy the storybook publicly** you will need credentials for the **parent** 'Royal Opera House' AWS account in your `~/.aws/credentials` file.
20
+ * The deploy script expects these to be called `[parent]`.
21
+
22
+ * You can find these values at:
23
+
24
+ *AWS 'Your Applications' page -> 'Royal Opera House' -> 'Developer Access' -> 'Command line or programmatic access'*
25
+
26
+ * **To deploy a preview** for demo / QA you will need the `CHROMATIC_PROJECT_TOKEN` -- find this in 1Password
27
+
28
+
29
+ * **To publish the NPM package** you will need the ROH `NPM_TOKEN` -- find this in 1Password
30
+
31
+
32
+ ## Versioning
33
+ ---
34
+
35
+ We use [Semantic Versioning](https://semver.org/) for Chord.
36
+
37
+ Given a version number MAJOR.MINOR.PATCH, increment the:
38
+
39
+ * MAJOR version when you make incompatible library changes
40
+ * MINOR version when you add functionality in a backwards compatible manner
41
+ * PATCH version when you make backwards compatible bug fixes
42
+
43
+ When you create a new release always update the `CHANGELOG` and `package.json`
44
+
45
+ Increment your version from the latest stable version on `chord-releases`
46
+
47
+
48
+ ## Deploying the Storybook
49
+ ---
50
+
51
+ ### **1. To build and deploy locally**
52
+
53
+ 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
54
 
15
55
  ```bash
16
- yarn lint # you can also use the --fix option to perform automatic fixes
56
+ yarn storybook
17
57
  ```
18
58
 
19
- To run the unit tests (using Jest) use:
59
+ By default the storybook will be accessible at
60
+ [http://localhost:6006/]()
61
+
62
+ The server will hot-reload on most changes.
63
+
64
+ ### **2. To deploy a preview version remotely**
65
+
66
+ You can deploy a release candidate, or work-in-progress to [Chromatic](https://www.chromatic.com/) for showcase or QA.
67
+
68
+ **NOTE:** you will need the `CHROMATIC_PROJECT_TOKEN` as described in *Prerequisites* above.
69
+
70
+ Either set the token as a shell variable or use a `.env` file in the chord root directory containing the token, as so:
20
71
 
21
- ```bash
22
- yarn test # you can also use the -u option to update snapshots if needed
72
+ ```
73
+ CHROMATIC_PROJECT_TOKEN=tokengoeshere
23
74
  ```
24
75
 
25
- To run the unit tests (using Jest) and store them for display in storybook use:
76
+ Run:
26
77
 
27
- ```bash
28
- yarn test-storybook # you can also use the -u option to update snapshots if needed
78
+ ```
79
+ yarn deploy-storybook-dev
29
80
  ```
30
81
 
31
- To run storybook use:
82
+ to build and deploy the storybook from your repo to Chromatic.
83
+
84
+ You will find the address of your deployed storybook in the console output, looking something like this:
85
+
86
+ `→ View your Storybook at https://randomHexString-randomAlphabeticalString.chromatic.com`
87
+
88
+ ### **3. To deploy a release version**
89
+
90
+ 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)
91
+
92
+ **NOTE:** To do this you will need the correct `AWS` credentials set up, as described in *Prerequisites* above.
93
+
94
+ First build the storybook using:
32
95
 
33
- ```bash
34
- yarn storybook
96
+ ```
97
+ yarn build-storybook
35
98
  ```
36
99
 
37
- To build a static version of storybook use:
100
+ then run:
38
101
 
39
102
  ```bash
40
- yarn build-storybook
103
+ yarn deploy-storybook
41
104
  ```
42
105
 
43
- This will create a static copy in `./storybook-static`, and there is an index.html page inside the core directory. This allows the site to be previewed directly in the git repository via serving pages (it needs to be configured for that branch).
106
+ > **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*.
44
107
 
45
- To deploy the storybook publically:
46
108
 
47
- ### Prerequisites
109
+ ## Releasing a New Package Version
110
+ ---
48
111
 
49
- Make sure you have credentials for the *parent* 'Royal Opera House' AWS account in your `~/.aws/credentials` file. The deploy script expects these to be called `[parent]`.
112
+ This is the procedure for releasing a new Chord NPM package.
50
113
 
51
- You can get these values at:
114
+ There are two types of package:
52
115
 
53
- AWS 'Your Applications' page -> 'Royal Opera House' -> 'Developer Access' ->
54
- 'Command line or programmatic access'
116
+ A **snapshot** can be published to use a development version of the Chord library in our frontend staging environments, to perform integrated, manual testing.
55
117
 
56
- ### Deployment
118
+ A **stable** package is published for use in production.
57
119
 
58
- To deploy, first *build* the storybook as above
120
+ **NOTE:** You will need the `NPM_TOKEN`, as described in 'Prerequisites' above.
59
121
 
60
- then use:
122
+ ### **1. To release a snapshot version**
123
+
124
+ > **IMPORTANT:** Make sure you always publish your **snapshots** from `chord-development` after merging in your feature branch.
125
+
126
+ 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.
127
+
128
+ 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`
129
+
130
+ To publish a snapshot use:
61
131
 
62
132
  ```bash
63
- yarn deploy-storybook
133
+ NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-snapshot
64
134
  ```
65
135
 
66
- This will deploy the contents of `./storybook-static` to S3 as a static site accessible at [chord.roh.org.uk](chord.roh.org.uk)
136
+ 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.
67
137
 
68
- To build the package use:
138
+ ### **2. To release a stable version**
139
+
140
+ > **IMPORTANT:** Make sure you always publish your **stable** packages from `chord-releases` after merging in your feature branch.
141
+
142
+ 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`!)
143
+
144
+ To publish a stable package use:
69
145
 
70
146
  ```bash
71
- yarn build
147
+ NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
72
148
  ```
73
149
 
74
- To release a new version.
75
150
 
76
- Release will be published in npm (NPM_TOKEN will be required)
77
- Storybook will be pushed to bitbucket. *** Push will be done Ensure you don't have things pendint to push
151
+ ## Using the Package
152
+ ---
153
+
154
+ The package is deployed to NPM, and can be installed using yarn or npm:
78
155
 
79
156
  ```bash
80
- NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
157
+ npm i --save @royaloperahouse/chord
158
+ ```
159
+ ```bash
160
+ yarn add @royaloperahouse/chord
81
161
  ```
82
162
 
83
163
 
84
- MORE INFO TO FOLLOW - PARTICULARLY FOR THE CI SETUP AND HOW PACKAGES ARE PUSHED.
164
+ ## Testing
165
+ ---
85
166
 
86
- # Recommended Use of Package
167
+ To **Lint** the package use:
87
168
 
88
- The package is deployed to NPM, and can be installed using yarn or npm:
169
+ ```bash
170
+ yarn lint
171
+ # Use the --fix option to perform automatic fixes
172
+ ```
173
+
174
+ To run the **unit tests** (using Jest) use:
89
175
 
90
176
  ```bash
91
- npm i --save @royaloperahouse/chord
177
+ yarn test
178
+
179
+ # Use the -u option to update snapshots if needed
180
+ # Run `yarn test:watch` to re-run tests on changes
92
181
  ```
182
+
183
+ To **run and and store the unit tests** for display in storybook use:
184
+
93
185
  ```bash
94
- yarn add @royaloperahouse/chord
186
+ yarn test-storybook
187
+ # Use the -u option to update snapshots if needed
95
188
  ```
96
189
 
97
- # Processes to follow prior to commits
98
190
 
99
- Before a commit is made you need to do the following:
191
+ ## Development Process
192
+ ---
100
193
 
101
- - Make sure that you are in your own work branch (properly named, including the JIRA ticket number and a short description)
102
- - `yarn lint` - ensure that you are not introducing errors
103
- - `yarn test` - ensure that tests are running as expected
104
- - `yarn test-storybook` - Save the test results to for the static site
105
- - `yarn build-storybook` - Update the static site
106
- - Commit your changes in your branch locally
194
+ ### **1. Branching Model**
195
+ * The Chord project lives in the `roh-components` *monorepo*
196
+ * When working on Chord, treat the `roh-components/packages/chord` directory as your root
197
+ * The Chord **development** branch is currently `chord-development`
198
+ * The Chord **main** branch is currently `chord-releases`
199
+ * 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`
200
+ * Always create your feature branch FROM, and submit pull requests TO, the **main** branch
201
+ * 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
202
+ * For releasing an **NPM snapshot**: merge your feature branch into the **development** branch and publish the NPM snapshot from there
107
203
 
108
- Next, if you are ready to merge into the main development branch then:
204
+ ### **2. Detailed Workflow**
205
+
206
+ #### **Before review:**
207
+
208
+ * Git pull the latest version of `chord-releases`
209
+ * Checkout a new, correctly-named feature branch from `chord releases`
210
+ * Do your work on this feature branch
211
+ * Run: `yarn lint`
212
+ * Run: `yarn test`
213
+ * Commit your changes
214
+ * Create a pull request from your feature branch to `chord-releases`
215
+ * Add the appropriate reviewers
216
+
217
+ #### **Before QA / UAT:**
218
+
219
+ After your PR is approved, you have two options:
220
+
221
+ **i.** For QA of a component in isolation:
222
+
223
+ * Follow the steps above in *Deploying the Storybook -> 2. Deploying a preview version remotely*
224
+ * Share the generated Chromatic URL with the appropriate people for QA / UAT
225
+
226
+ **ii.** For integrated testing of a component in the frontend staging environments:
227
+
228
+ * Check out the `chord-development` branch
229
+ * Merge your work in to `chord-development`
230
+ * Follow the steps above under *Publishing a New Package Version -> 1. To release a snapshot version*
231
+ * Git push the updated `chord-development` branch to remote
232
+ * Finally, in the frontend repo:
233
+
234
+ 1. Update the `package.json` to reference the new snapshot version
235
+ 2. Run: `yarn install`
236
+ 3. Deploy the frontend to a staging environment
237
+
238
+ #### **When ready for production:**
239
+
240
+ * Return to your chord **feature branch**
241
+ * 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
242
+ * Update `CHANGELOG.md`, adding the new version number and a short description of your changes
243
+ * Run: `yarn lint`
244
+ * Run: `yarn test`
245
+ * Run: `yarn test-storybook -u`
246
+ * Run: `yarn build-storybook`
247
+ * Git commit, push, and update your PR for final approval
248
+ * Merge your approved PR to `chord-releases`
249
+ * Follow the steps in *Publishing a New Package Version -> 2. To release a stable version* to publish the NPM package
250
+ * Finally, follow the steps in *Deploying The Storybook -> 3. To deploy a release version*, to update the public Chord Storybook page
251
+
252
+ 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.
253
+
254
+
255
+ ## Notes
256
+ ---
257
+ ### The `storybook-static` folder
258
+
259
+ 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:
260
+
261
+ ```bash
262
+ yarn build-storybook
263
+ ```
109
264
 
110
- - _*ensure that you pull the latest changes from that branch into your new branch, resolving any merge conflicts that may arise*_
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.
265
+ 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
266
 
116
- ### Example
267
+ ---
268
+ ### Examples
117
269
 
118
270
  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
271
 
272
+ ---
120
273
  ### Bundle analysis
121
274
 
122
- Calculates the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `yarn size` and visulize it with `yarn analyze`.
275
+ 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
@@ -55,7 +55,7 @@ const App = ({ children }: InnerProps): React.ReactElement => (
55
55
 
56
56
  ## Components
57
57
 
58
- Accordion, Accordions, AltHeader, AnchorTapBar, 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
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
 
@@ -3158,14 +3158,16 @@ var RotatorButtons = function RotatorButtons(_ref) {
3158
3158
  onClick: onClickLeftHandler,
3159
3159
  onKeyDown: onPrevKeyDownHandler,
3160
3160
  tabIndex: 0,
3161
- "data-testid": "iconprev"
3161
+ "data-testid": "iconprev",
3162
+ className: "carousel-icon-wrapper-left"
3162
3163
  }, renderPrevIcon()) : /*#__PURE__*/React__default.createElement(IconUnavailableWrapper, {
3163
3164
  "data-testid": "iconprevnoavailable"
3164
3165
  }, renderPrevIcon()), availableNext ? /*#__PURE__*/React__default.createElement(IconWrapper$1, {
3165
3166
  onClick: onClickRightHandler,
3166
3167
  onKeyDown: onNextKeyDownHandler,
3167
3168
  tabIndex: 0,
3168
- "data-testid": "iconnext"
3169
+ "data-testid": "iconnext",
3170
+ className: "carousel-icon-wrapper-right"
3169
3171
  }, renderNextIcon()) : /*#__PURE__*/React__default.createElement(IconUnavailableWrapper, {
3170
3172
  "data-testid": "iconnextnoavailable"
3171
3173
  }, renderNextIcon()));
@@ -4046,7 +4048,7 @@ var Footer = function Footer(_ref) {
4046
4048
  };
4047
4049
 
4048
4050
  var _templateObject$x, _templateObject2$i, _templateObject3$b, _templateObject4$7, _templateObject5$4, _templateObject6$4;
4049
- var AnchorTapbarWrapper = /*#__PURE__*/styled__default.div(_templateObject$x || (_templateObject$x = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: sticky;\n top: 0;\n background-color: var(--base-color-white);\n z-index: ", ";\n"])), zIndexes.anchor);
4051
+ var AnchorTabbarWrapper = /*#__PURE__*/styled__default.div(_templateObject$x || (_templateObject$x = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: sticky;\n top: 0;\n background-color: var(--base-color-white);\n z-index: ", ";\n"])), zIndexes.anchor);
4050
4052
  var TabsGrid = /*#__PURE__*/styled__default(Grid)(_templateObject2$i || (_templateObject2$i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: var(--anchor-tabs-height);\n"])));
4051
4053
  var TabsWrapper = /*#__PURE__*/styled__default.div(_templateObject3$b || (_templateObject3$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n"])));
4052
4054
  var TabsList = /*#__PURE__*/styled__default.ul(_templateObject4$7 || (_templateObject4$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: ", ";\n display: flex;\n gap: 32px;\n justify-content: ", ";\n align-items: center;\n list-style: none;\n padding: 0;\n margin: 0;\n height: var(--anchor-tabs-height);\n white-space: nowrap;\n overflow: scroll;\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n scroll-behavior: smooth;\n\n @media ", " {\n & {\n width: ", ";\n }\n }\n"])), function (_ref) {
@@ -4177,7 +4179,7 @@ var AnchorTabBar = function AnchorTabBar(_ref) {
4177
4179
  setCanScrollToRight(scrollLeft + clientWidth < scrollWidth);
4178
4180
  };
4179
4181
 
4180
- return /*#__PURE__*/React__default.createElement(AnchorTapbarWrapper, null, /*#__PURE__*/React__default.createElement(TabsGrid, null, /*#__PURE__*/React__default.createElement(GridItem, {
4182
+ return /*#__PURE__*/React__default.createElement(AnchorTabbarWrapper, null, /*#__PURE__*/React__default.createElement(TabsGrid, null, /*#__PURE__*/React__default.createElement(GridItem, {
4181
4183
  columnStartDesktop: tabsColumnStart,
4182
4184
  columnSpanDesktop: tabsColumnSpan,
4183
4185
  columnStartDevice: 2,
@@ -5488,13 +5490,22 @@ var Information = function Information(_ref) {
5488
5490
  };
5489
5491
 
5490
5492
  var _templateObject$L, _templateObject2$v, _templateObject3$m, _templateObject4$g, _templateObject5$b, _templateObject6$8, _templateObject7$5, _templateObject8$5;
5491
- var PageHeadingWrapper = /*#__PURE__*/styled__default.div(_templateObject$L || (_templateObject$L = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding-bottom: 80px;\n background-color: ", ";\n color: var(--base-color-white);\n\n h2 {\n margin: 0;\n padding: 0;\n }\n\n @media ", " {\n padding-bottom: 0;\n }\n"])), function (_ref) {
5493
+ var PageHeadingWrapper = /*#__PURE__*/styled__default.div(_templateObject$L || (_templateObject$L = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding-bottom: 80px;\n background-color: ", ";\n color: var(--base-color-white);\n\n ", ";\n\n h2 {\n margin: 0;\n padding: 0;\n }\n\n @media ", " {\n padding-bottom: 0;\n }\n"])), function (_ref) {
5492
5494
  var theme = _ref.theme;
5493
5495
  return theme.colors.primary;
5496
+ }, function (_ref2) {
5497
+ var isPageHeadingWithoutTitle = _ref2.isPageHeadingWithoutTitle;
5498
+ return isPageHeadingWithoutTitle && "\n padding-bottom: 42px;\n ";
5494
5499
  }, devices.mobile);
5495
5500
  var PageHeadingGrid = /*#__PURE__*/styled__default(Grid)(_templateObject2$v || (_templateObject2$v = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n gap: 0 var(--grid-column-gap);\n grid-template-rows: min-content min-content;\n grid-template-areas:\n '. . title title title title title title title title title title . . logo .'\n '. . text text text text text text text text text button button button . .';\n\n @media ", " {\n & {\n grid-template-rows: 20px min-content min-content min-content 20px;\n grid-template-areas:\n '. . . . . . . . . . . . . .'\n '. title title title title title title title title title title logo logo .'\n '. text text text text text text text text text text text text .'\n '. button button button button button button button button button button button button .'\n '. . . . . . . . . . . . . .';\n }\n }\n\n @media ", " {\n & {\n grid-template-areas:\n '. title title title title title title title title title title logo logo .'\n '. text text text text text text text text text button button button .';\n }\n }\n"])), devices.mobile, devices.tablet);
5496
- var TitleWrapper$1 = /*#__PURE__*/styled__default.div(_templateObject3$m || (_templateObject3$m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n grid-area: title;\n margin-top: 80px;\n\n @media ", " {\n & {\n margin-top: 0;\n }\n }\n"])), devices.mobile);
5497
- var ChildrenWrapper = /*#__PURE__*/styled__default.div(_templateObject4$g || (_templateObject4$g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 20px;\n width: fit-content;\n height: 36px;\n\n @media ", " {\n & {\n height: 30px;\n }\n }\n"])), devices.mobile);
5501
+ var TitleWrapper$1 = /*#__PURE__*/styled__default.div(_templateObject3$m || (_templateObject3$m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n grid-area: title;\n margin-top: 80px;\n\n ", ";\n\n @media ", " {\n & {\n margin-top: 0;\n }\n }\n"])), function (_ref3) {
5502
+ var isPageHeadingWithoutTitle = _ref3.isPageHeadingWithoutTitle;
5503
+ return isPageHeadingWithoutTitle && "\n margin-top: 42px;\n ";
5504
+ }, devices.mobile);
5505
+ var ChildrenWrapper = /*#__PURE__*/styled__default.div(_templateObject4$g || (_templateObject4$g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 20px;\n width: fit-content;\n height: 36px;\n\n ", ";\n\n @media ", " {\n & {\n height: 30px;\n }\n }\n"])), function (_ref4) {
5506
+ var isPageHeadingWithoutTitle = _ref4.isPageHeadingWithoutTitle;
5507
+ return isPageHeadingWithoutTitle && "\n margin: 10px 0;\n ";
5508
+ }, devices.mobile);
5498
5509
  var TextWrapper = /*#__PURE__*/styled__default.div(_templateObject5$b || (_templateObject5$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n grid-area: text;\n align-self: end;\n margin-top: 12px;\n\n h6 {\n margin: 0;\n padding: 0;\n }\n"])));
5499
5510
  var LogoWrapper$1 = /*#__PURE__*/styled__default.div(_templateObject6$8 || (_templateObject6$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n grid-area: logo;\n justify-self: end;\n margin-top: 20px;\n position: relative;\n\n > div {\n position: absolute;\n top: 0;\n right: 0;\n }\n\n @media ", " {\n & {\n align-self: start;\n margin-top: 0;\n }\n }\n"])), devices.mobile);
5500
5511
  var ButtonWrapper$1 = /*#__PURE__*/styled__default.div(_templateObject7$5 || (_templateObject7$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n grid-area: button;\n justify-self: end;\n align-self: end;\n\n @media ", " {\n & {\n justify-self: center;\n align-self: center;\n width: 100%;\n margin-top: 16px;\n }\n }\n"])), devices.mobile);
@@ -5515,12 +5526,17 @@ var PageHeading = function PageHeading(_ref) {
5515
5526
  restLink = _objectWithoutPropertiesLoose(_ref2, _excluded$e);
5516
5527
 
5517
5528
  var truncatedText = text == null ? void 0 : text.substring(0, 250);
5518
- var truncatedTitle = title.substring(0, 40);
5529
+ var truncatedTitle = title && title.substring(0, 40);
5530
+ var isTitleUnAvailable = !title;
5519
5531
  return /*#__PURE__*/React__default.createElement(PageHeadingWrapper, {
5520
- "data-testid": "page-heading-wrapper"
5532
+ "data-testid": "page-heading-wrapper",
5533
+ isPageHeadingWithoutTitle: isTitleUnAvailable
5521
5534
  }, /*#__PURE__*/React__default.createElement(PageHeadingGrid, null, /*#__PURE__*/React__default.createElement(TitleWrapper$1, {
5522
- "data-testid": "page-heading-title"
5523
- }, children ? /*#__PURE__*/React__default.createElement(ChildrenWrapper, null, children) : null, /*#__PURE__*/React__default.createElement(Header, {
5535
+ "data-testid": "page-heading-title",
5536
+ isPageHeadingWithoutTitle: isTitleUnAvailable
5537
+ }, children ? /*#__PURE__*/React__default.createElement(ChildrenWrapper, {
5538
+ isPageHeadingWithoutTitle: isTitleUnAvailable
5539
+ }, children) : null, !isTitleUnAvailable && /*#__PURE__*/React__default.createElement(Header, {
5524
5540
  level: 2
5525
5541
  }, truncatedTitle)), text ? /*#__PURE__*/React__default.createElement(TextWrapper, {
5526
5542
  "data-testid": "page-heading-text"