@ons/design-system 72.6.0 → 72.9.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.
Files changed (42) hide show
  1. package/components/breadcrumbs/_breadcrumbs.scss +1 -0
  2. package/components/chart/_chart.scss +10 -0
  3. package/components/chart/_macro.njk +50 -32
  4. package/components/chart/_macro.spec.js +201 -0
  5. package/components/chart/annotations-options.js +1 -1
  6. package/components/chart/area-chart.js +26 -0
  7. package/components/chart/bar-chart.js +11 -2
  8. package/components/chart/chart-constants.js +84 -3
  9. package/components/chart/chart.js +43 -10
  10. package/components/chart/column-chart.js +33 -24
  11. package/components/chart/common-chart-options.js +14 -35
  12. package/components/chart/example-area-chart.njk +68 -0
  13. package/components/chart/example-clustered-column-chart.njk +2 -1
  14. package/components/chart/example-column-chart-with-annotations.njk +2 -1
  15. package/components/chart/example-column-chart.njk +2 -1
  16. package/components/chart/example-column-with-line-chart.njk +5 -2
  17. package/components/chart/example-line-chart-with-markers.njk +138 -0
  18. package/components/chart/example-line-chart.njk +3 -1
  19. package/components/chart/example-scatter-chart.njk +94 -0
  20. package/components/chart/line-chart.js +18 -23
  21. package/components/chart/scatter-chart.js +34 -0
  22. package/components/details/details.js +5 -0
  23. package/components/details-panel/_details-panel.scss +107 -0
  24. package/components/details-panel/_macro.njk +41 -0
  25. package/components/details-panel/_macro.spec.js +54 -0
  26. package/components/details-panel/example-details-panel-open.njk +29 -0
  27. package/components/details-panel/example-details-panel.njk +28 -0
  28. package/components/hero/_hero.scss +87 -60
  29. package/components/hero/_macro.njk +1 -1
  30. package/components/hero/example-hero-dark.njk +1 -1
  31. package/components/pagination/_macro.njk +1 -1
  32. package/components/pagination/_pagination.scss +7 -7
  33. package/components/summary/_macro.njk +2 -2
  34. package/components/summary/_macro.spec.js +37 -21
  35. package/components/summary/_summary.scss +5 -1
  36. package/components/summary/example-summary-grouped.njk +0 -12
  37. package/css/main.css +1 -1
  38. package/package.json +1 -1
  39. package/scripts/main.es5.js +1 -1
  40. package/scripts/main.js +1 -1
  41. package/scss/main.scss +1 -0
  42. package/scss/vars/_colors.scss +1 -0
@@ -0,0 +1,94 @@
1
+ {% from "components/chart/_macro.njk" import onsChart %}
2
+
3
+ {{
4
+ onsChart({
5
+ "chartType": "scatter",
6
+ "description": "Example scatter chart",
7
+ "theme": "alternate",
8
+ "title": "Example scatter chart",
9
+ "subtitle": "Scatter chart subtitle",
10
+ "id": "id",
11
+ "headingLevel": 4,
12
+ "caption": "Source: Monthly Business Survey, Retails Sales Inquiry from the Office for National Statistics",
13
+ "download": {
14
+ 'title': 'Download Figure 1 data',
15
+ 'itemsList': [
16
+ {
17
+ "text": "Excel spreadsheet (XLSX format, 18KB)",
18
+ "url": "#"
19
+ },
20
+ {
21
+ "text": "Simple text file (CSV format, 25KB)",
22
+ "url": "#"
23
+ },
24
+ {
25
+
26
+ "text": "Image (PNG format, 25KB)",
27
+ "url": "#"
28
+ }
29
+ ]},
30
+ "xAxis": {
31
+ "title": "Height"
32
+ },
33
+ "yAxis": {
34
+ "title": "Weight"
35
+ },
36
+ "legend": 'true',
37
+ "series": [
38
+ {
39
+ "name": "Female",
40
+ "data": [
41
+ [161.2, 51.6], [167.5, 59.0], [159.5, 49.2], [157.0, 63.0],
42
+ [163.8, 54.5], [158.4, 50.8], [165.2, 57.3], [160.7, 52.4],
43
+ [162.3, 55.1], [166.8, 58.7], [159.8, 51.9], [164.5, 56.2],
44
+ [158.9, 50.3], [163.1, 53.8],
45
+ [161.8, 52.1], [167.1, 58.8], [159.2, 49.8], [157.4, 62.7],
46
+ [163.5, 54.9], [158.7, 51.2], [165.5, 57.8], [160.4, 52.7],
47
+ [162.7, 55.4], [166.4, 58.4], [159.4, 51.5], [164.8, 56.5],
48
+ [158.6, 50.6], [163.4, 53.5]
49
+ ],
50
+ "marker": 'true'
51
+ },
52
+ {
53
+ "name": "Male",
54
+ "data": [
55
+ [174.0, 65.6], [175.3, 71.8], [187.5, 80.7], [186.5, 72.6],
56
+ [178.2, 68.4], [182.7, 74.3], [176.8, 67.9], [188.4, 77.2],
57
+ [184.5, 73.8], [179.6, 70.5], [186.2, 79.4], [183.8, 75.1],
58
+ [177.4, 69.2], [185.9, 76.3],
59
+ [174.3, 66.1], [175.8, 71.4], [187.8, 80.2], [186.1, 72.9],
60
+ [178.7, 68.8], [182.2, 74.7], [176.4, 67.5], [188.0, 77.6],
61
+ [184.1, 73.4], [179.2, 70.8], [186.6, 79.8], [183.4, 75.4],
62
+ [177.8, 69.6], [185.5, 76.7]
63
+ ],
64
+ "marker": 'true'
65
+ },
66
+ {
67
+ "name": "Adolescent Male",
68
+ "data": [
69
+ [168.5, 58.2], [171.2, 62.4], [169.8, 59.7], [173.4, 63.8],
70
+ [170.6, 61.2], [172.8, 64.5], [167.9, 57.8], [174.2, 65.1],
71
+ [169.5, 60.3], [171.8, 63.2],
72
+ [168.8, 58.6], [171.5, 62.8], [169.2, 59.4], [173.7, 63.5],
73
+ [170.2, 61.6], [172.4, 64.2], [168.2, 58.1], [173.9, 64.8],
74
+ [169.8, 60.7], [171.4, 63.6]
75
+ ],
76
+ "marker": 'true'
77
+ },
78
+ {
79
+ "name": "Adolescent Female",
80
+ "data": [
81
+ [164.2, 54.8], [166.5, 57.2], [163.8, 53.9], [165.7, 56.4],
82
+ [162.9, 52.8], [167.2, 58.1], [164.8, 55.3], [166.9, 57.8],
83
+ [163.5, 53.4], [165.4, 56.7],
84
+ [164.5, 55.1], [166.2, 57.5], [163.4, 53.6], [165.9, 56.2],
85
+ [162.6, 52.5], [167.5, 58.4], [164.4, 55.6], [166.6, 57.6],
86
+ [163.8, 53.7], [165.2, 56.9]
87
+ ],
88
+ "marker": 'true'
89
+ }
90
+ ],
91
+ "percentageHeightDesktop": 35,
92
+ "percentageHeightMobile": 90
93
+ })
94
+ }}
@@ -1,39 +1,34 @@
1
+ import ChartConstants from './chart-constants';
1
2
  class LineChart {
3
+ constructor() {
4
+ this.chartConstants = ChartConstants.constants();
5
+ this.markerStyles = this.chartConstants.lineMarkerStyles;
6
+ }
7
+
2
8
  getLineChartOptions = () => {
3
9
  return {
4
10
  plotOptions: {
5
11
  line: {
6
12
  lineWidth: 3,
7
13
  linecap: 'round',
8
- // In a later PR we will update the marker styles
9
- marker: {
10
- enabled: false,
11
- radius: 4,
12
- symbol: 'circle',
13
- lineWidth: 0,
14
- },
15
14
  },
16
15
  },
17
16
  };
18
17
  };
19
18
 
20
19
  updateLastPointMarker = (series) => {
21
- series.forEach((series) => {
22
- // If markers are disabled, hide them all but the last point marker
23
- if (series.options.marker.enabled.enabled === undefined) {
24
- const points = series.points;
25
- if (points && points.length > 0) {
26
- // Show only the last point marker
27
- const lastPoint = points[points.length - 1];
28
- lastPoint.update(
29
- {
30
- marker: {
31
- enabled: true,
32
- },
33
- },
34
- false,
35
- );
36
- }
20
+ series.forEach((series, i) => {
21
+ const points = series.points;
22
+ if (points && points.length > 0) {
23
+ // Show only the last point marker
24
+ const lastPoint = points[points.length - 1];
25
+ lastPoint.update({
26
+ marker: {
27
+ enabled: true,
28
+ },
29
+ });
30
+ // Update the marker styles to use for each series
31
+ series.update({ marker: this.markerStyles[i] != undefined ? this.markerStyles[i] : this.markerStyles[0] }, false);
37
32
  }
38
33
  });
39
34
  };
@@ -0,0 +1,34 @@
1
+ import ChartConstants from './chart-constants';
2
+
3
+ class ScatterChart {
4
+ constructor() {
5
+ this.chartConstants = ChartConstants.constants();
6
+ this.markerStyles = this.chartConstants.scatterMarkerStyles;
7
+ }
8
+
9
+ getScatterChartOptions = () => {
10
+ return {
11
+ plotOptions: {
12
+ scatter: {
13
+ // enable tooltips for scatter charts
14
+ enableMouseTracking: true,
15
+ },
16
+ },
17
+ xAxis: {
18
+ gridLineWidth: 1,
19
+ },
20
+ yAxis: {
21
+ gridLineWidth: 1,
22
+ },
23
+ };
24
+ };
25
+
26
+ // Use a different set of marker styles for scatter charts
27
+ updateMarkers = (currentChart) => {
28
+ currentChart.series.forEach((series, i) => {
29
+ series.update({ marker: this.markerStyles[i] != undefined ? this.markerStyles[i] : this.markerStyles[0] }, false);
30
+ });
31
+ };
32
+ }
33
+
34
+ export default ScatterChart;
@@ -8,6 +8,7 @@ export default class Details {
8
8
  this.details = detailsElement;
9
9
  this.detailsHeader = this.details.querySelector('.ons-js-details-heading');
10
10
  this.content = this.details.querySelector('.ons-js-details-content');
11
+ this.detailsTitle = this.details.querySelector('.ons-js-corrections-details-title');
11
12
 
12
13
  // Initialise
13
14
  const detailsId = detailsElement.getAttribute('id');
@@ -38,6 +39,7 @@ export default class Details {
38
39
  const action = open ? 'Open' : 'Close';
39
40
  const cls = open ? 'add' : 'remove';
40
41
  const openAttribute = open ? 'set' : 'remove';
42
+ const setText = open ? 'Close detail' : 'Show detail';
41
43
 
42
44
  this.isOpen = open;
43
45
  this.details[`${openAttribute}Attribute`]('open', '');
@@ -45,6 +47,9 @@ export default class Details {
45
47
  this.detailsHeader.setAttribute('aria-expanded', open);
46
48
  this.content.setAttribute('aria-hidden', !open);
47
49
  this.detailsHeader.setAttribute('data-ga-action', `${action} panel`);
50
+ if (this.detailsTitle) {
51
+ this.detailsTitle.textContent = setText;
52
+ }
48
53
 
49
54
  if (this.onOpen && this.onClose) {
50
55
  if (open) {
@@ -0,0 +1,107 @@
1
+ .ons-details-panel {
2
+ $root: &;
3
+
4
+ background-color: var(--ons-color-info-tint);
5
+
6
+ &__info-icon {
7
+ background: var(--ons-color-white);
8
+ border-radius: 50%;
9
+ color: var(--ons-color-ocean-blue);
10
+ font-size: 1.5rem;
11
+ font-weight: 700;
12
+ line-height: 2rem;
13
+ height: 2rem;
14
+ width: 2rem;
15
+ text-align: center;
16
+ }
17
+
18
+ &__banner {
19
+ list-style: none;
20
+ background-color: var(--ons-color-ocean-blue);
21
+ color: var(--ons-color-white);
22
+ border: 1px solid var(--ons-color-ocean-blue);
23
+ }
24
+
25
+ &__banner-contents {
26
+ display: flex;
27
+ }
28
+
29
+ &__banner-detail {
30
+ width: fit-content;
31
+ cursor: pointer;
32
+
33
+ &:focus {
34
+ background: var(--ons-color-focus);
35
+ box-shadow: 0 ems($button-shadow-size) 0 var(--ons-color-text-link-focus);
36
+ color: var(--ons-color-text-link-focus);
37
+ outline: none;
38
+ }
39
+ }
40
+
41
+ &__banner-detail-title {
42
+ text-decoration: underline var(--ons-color-white) 2px;
43
+ text-underline-position: under;
44
+ }
45
+
46
+ &__banner-detail:focus &__banner-detail-title {
47
+ text-decoration: none;
48
+ }
49
+
50
+ &__banner-detail-icon {
51
+ .ons-icon {
52
+ width: 1rem;
53
+ height: 1rem;
54
+ transform: rotate(90deg);
55
+ }
56
+
57
+ #{$root}[open] & {
58
+ .ons-icon {
59
+ transform: rotate(270deg);
60
+ }
61
+ }
62
+ }
63
+
64
+ &__content {
65
+ #{$root}[open] & {
66
+ display: block;
67
+ }
68
+
69
+ .ons-details--initialised & {
70
+ display: none;
71
+ }
72
+ }
73
+
74
+ &__item {
75
+ display: flex;
76
+ flex-direction: column;
77
+ border-bottom: 1px solid var(--ons-color-borders);
78
+ @extend .ons-u-pb-xl;
79
+ @extend .ons-u-mb-l;
80
+ @extend .ons-u-ml-2xs;
81
+
82
+ @include mq('m') {
83
+ flex-direction: row;
84
+ column-gap: 2.5rem;
85
+ }
86
+
87
+ &:last-child {
88
+ border-bottom: 0;
89
+ @extend .ons-u-mb-no;
90
+ @extend .ons-u-pb-no;
91
+ }
92
+ }
93
+
94
+ &__content-meta {
95
+ @extend .ons-u-mb-no;
96
+ @include mq('m') {
97
+ flex-basis: 25%;
98
+ min-width: 16.5rem;
99
+ }
100
+ }
101
+
102
+ &__content-heading {
103
+ color: var(--ons-color-black);
104
+ @extend .ons-u-fs-r--b;
105
+ @extend .ons-u-mb-no;
106
+ }
107
+ }
@@ -0,0 +1,41 @@
1
+ {% macro onsDetailsPanel(params) %}
2
+ <div class="ons-details-panel ons-js-details" {% if params.open %}{{ ' ' }}data-open="true"{% endif %}>
3
+ <div class="ons-details-panel__banner ons-u-pt-s ons-u-pb-s">
4
+ <div class="ons-container ons-details-panel__banner-contents">
5
+ <span class="ons-details-panel__info-icon ons-u-mr-2xs" aria-hidden="true">i</span>
6
+ <div class="ons-details-panel__banner-body">
7
+ <h3 class="ons-details-panel__banner-title ons-u-mb-2xs">{{ params.title }}</h3>
8
+ <div class="ons-details-panel__banner-detail ons-js-details-heading">
9
+ <span class="ons-details-panel__banner-detail-title ons-js-corrections-details-title ons-u-mr-3xs"
10
+ >Show detail</span
11
+ >
12
+ <span class="ons-details-panel__banner-detail-icon">
13
+ {% from "components/icon/_macro.njk" import onsIcon %}
14
+ {{
15
+ onsIcon({
16
+ "iconType": "chevron"
17
+ })
18
+ }}
19
+ </span>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ <div class="ons-container ons-details-panel__content ons-js-details-content ons-u-pt-xl ons-u-pb-3xl">
25
+ {% for item in params.detailsItems %}
26
+ <div class="ons-details-panel__item">
27
+ <div class="ons-details-panel__content-meta ons-u-mb-l@2xs@m">
28
+ <h3 class="ons-details-panel__content-heading">{{ item.text }}</h3>
29
+ <time class="ons-details-panel__content-date" datetime="{{ item.date.iso }}">{{ item.date.short }}</time>
30
+ </div>
31
+ <div class="ons-details-panel__content-description">
32
+ <div class="ons-details-panel__content-text ons-u-mb-s">{{ item.description | safe }}</div>
33
+ {% if item.url or item.text == 'Content' %}
34
+ <a class="ons-details-panel__content-url" href="{{ item.url }}"> View superseded version</a>
35
+ {% endif %}
36
+ </div>
37
+ </div>
38
+ {% endfor %}
39
+ </div>
40
+ </div>
41
+ {% endmacro %}
@@ -0,0 +1,54 @@
1
+ /** @jest-environment jsdom */
2
+ import * as cheerio from 'cheerio';
3
+ import axe from '../../tests/helpers/axe';
4
+ import { renderComponent } from '../../tests/helpers/rendering';
5
+ import { EXAMPLE_DETAILS_PANEL } from './_test-examples';
6
+
7
+ describe('FOR: Macro: Details Panel', () => {
8
+ describe('GIVEN: Params: title', () => {
9
+ describe('WHEN: title param is provided', () => {
10
+ const $ = cheerio.load(renderComponent('details-panel', EXAMPLE_DETAILS_PANEL));
11
+ test('THEN: banner has the correct title', () => {
12
+ const contentTitle = $('.ons-details-panel__banner-title').text().replace(/\s+/g, ' ').trim();
13
+ expect(contentTitle).toBe('Correction and Notice');
14
+ });
15
+ });
16
+ });
17
+
18
+ describe('GIVEN: Params: detailsItems', () => {
19
+ describe('WHEN: detailsItems is provided', () => {
20
+ const $ = cheerio.load(renderComponent('details-panel', EXAMPLE_DETAILS_PANEL));
21
+ test('THEN: jest-axe tests pass', async () => {
22
+ const results = await axe($.html());
23
+ expect(results).toHaveNoViolations();
24
+ });
25
+ test('THEN: items have correct titles', () => {
26
+ const contentTitle0 = $('.ons-details-panel__content-heading').eq(0).text().trim();
27
+ const contentTitle1 = $('.ons-details-panel__content-heading').eq(1).text().trim();
28
+ expect(contentTitle0).toBe('Correction');
29
+ expect(contentTitle1).toBe('Notice');
30
+ });
31
+ test('THEN: items have correct dates', () => {
32
+ const dateText0 = $('.ons-details-panel__content-date').eq(0).text().trim();
33
+ const dateText1 = $('.ons-details-panel__content-date').eq(1).text().trim();
34
+
35
+ expect(dateText0).toBe('22nd January 2025, 4:30PM');
36
+ expect(dateText1).toBe('22nd January 2025');
37
+ });
38
+ test('THEN: items have correct description text', () => {
39
+ const contentdescriptionText0 = $('.ons-details-panel__content-text').eq(0).text().trim();
40
+ const contentdescriptionText1 = $('.ons-details-panel__content-text').eq(1).text().trim();
41
+
42
+ expect(contentdescriptionText0).toBe('description1');
43
+ expect(contentdescriptionText1).toBe('description2');
44
+ });
45
+ test('THEN: correction item has a valid link and text', () => {
46
+ const correctionLinkText = $('.ons-details-panel__content-url').eq(0).text().trim();
47
+ const correctionLinkUrl = $('.ons-details-panel__content-url').eq(0).attr('href');
48
+
49
+ expect(correctionLinkText).toBe('View superseded version');
50
+ expect(correctionLinkUrl).toBe('#0');
51
+ });
52
+ });
53
+ });
54
+ });
@@ -0,0 +1,29 @@
1
+ {% from "components/details-panel/_macro.njk" import onsDetailsPanel %}
2
+
3
+ {{
4
+ onsDetailsPanel({
5
+ "open": true,
6
+ "title": "Correction and Notice",
7
+ "detailsItems": [
8
+ {
9
+ "text": 'Correction',
10
+ "date": {
11
+ "iso": '2025-01-22T16:30Z',
12
+ "short": '22nd January 2025, 4:30PM'
13
+ },
14
+ "description": '<p>The Non-Financial Business Economy publication uses estimates from the Annual Business Survey (ABS). A weighting error means these data have now been revised, with the overall impact being minimal.</p>
15
+ <p>ONS apologises for any inconvenience caused.</p>',
16
+ "url": '#0'
17
+ },
18
+ {
19
+ "text": 'Notice',
20
+ "date": {
21
+ "iso": '2025-01-22T16:30Z',
22
+ "short": '22nd January 2025, 4:30PM'
23
+ },
24
+ "description": '<p>To improve the timeliness of our publications, we have discontinued the previously published <a href="#0">Non-financial business economy<a>, <a href="#0">UK and regional (Annual Business Survey)</a>.
25
+ We will now deliver the UK and regional elements separately, in our <a href="#0">Non-financial business economy</a>, <a href="#0">UK (Annual Business Survey)</a> and <a href="#0">Non-financial business economy</a>, <a href="#0">regional (Annual Business Survey) bulletins</a>.</p>'
26
+ }
27
+ ]
28
+ })
29
+ }}
@@ -0,0 +1,28 @@
1
+ {% from "components/details-panel/_macro.njk" import onsDetailsPanel %}
2
+
3
+ {{
4
+ onsDetailsPanel({
5
+ "title": "Correction and Notice",
6
+ "detailsItems": [
7
+ {
8
+ "text": 'Correction',
9
+ "date": {
10
+ "iso": '2025-01-22T16:30Z',
11
+ "short": '22nd January 2025, 4:30PM'
12
+ },
13
+ "description": '<p>The Non-Financial Business Economy publication uses estimates from the Annual Business Survey (ABS). A weighting error means these data have now been revised, with the overall impact being minimal.</p>
14
+ <p>ONS apologises for any inconvenience caused.</p>',
15
+ "url": '#0'
16
+ },
17
+ {
18
+ "text": 'Notice',
19
+ "date": {
20
+ "iso": '2025-01-22T16:30Z',
21
+ "short": '22nd January 2025, 4:30PM'
22
+ },
23
+ "description": '<p>To improve the timeliness of our publications, we have discontinued the previously published <a href="#0">Non-financial business economy<a>, <a href="#0">UK and regional (Annual Business Survey)</a>.
24
+ We will now deliver the UK and regional elements separately, in our <a href="#0">Non-financial business economy</a>, <a href="#0">UK (Annual Business Survey)</a> and <a href="#0">Non-financial business economy</a>, <a href="#0">regional (Annual Business Survey) bulletins</a>.</p>'
25
+ }
26
+ ]
27
+ })
28
+ }}
@@ -10,6 +10,8 @@
10
10
  }
11
11
 
12
12
  .ons-hero {
13
+ $root: &;
14
+
13
15
  background-color: var(--ons-color-hero-bg);
14
16
  display: flex;
15
17
  overflow: hidden;
@@ -81,73 +83,14 @@
81
83
  }
82
84
  }
83
85
 
84
- &__badge-link {
85
- display: block;
86
- width: fit-content;
87
- }
88
-
89
86
  &--topic {
90
87
  color: var(--ons-color-branded);
91
88
  @extend .ons-u-mb-no;
92
89
  }
93
90
 
94
- &__container {
95
- align-items: center;
96
- display: flex;
97
- min-height: 300px;
98
- position: relative;
99
-
100
- &--has-details {
101
- align-items: flex-start; // Prevents undesired shift if not enough content
102
- }
103
- }
104
-
105
- &__content {
106
- @include mq(l) {
107
- display: flex;
108
- justify-content: space-between;
109
- align-items: flex-start;
110
- }
111
- }
112
-
113
- &__information {
114
- display: flex;
115
- flex-wrap: wrap;
116
- column-gap: 1rem;
117
-
118
- & .ons-hero__panel {
119
- padding: 0.5rem 1rem;
120
- border-left: 5px solid transparent;
121
- @extend .ons-u-fs-r--b;
122
- }
123
-
124
- & .ons-hero__link {
125
- padding: 0.5rem 0;
126
- }
127
- }
128
-
129
- &__pre-title {
130
- margin-bottom: 0.5rem;
131
-
132
- @include mq('2xs', m) {
133
- max-width: 145px;
134
- }
135
- }
136
-
137
- &__details {
138
- padding-bottom: 3.5rem;
139
- padding-top: 2rem;
140
- position: relative;
141
- z-index: 5;
142
- }
143
-
144
- &__details:has(.ons-breadcrumbs) {
145
- padding-top: 1rem;
146
- }
147
-
148
91
  &--dark & {
149
92
  &__details {
150
- color: var(--ons-color-text-inverse) !important;
93
+ color: var(--ons-color-text-inverse);
151
94
 
152
95
  a {
153
96
  color: inherit;
@@ -162,6 +105,9 @@
162
105
  color: inherit;
163
106
  }
164
107
  }
108
+ &--topic {
109
+ color: var(--ons-color-light-blue-grey);
110
+ }
165
111
  }
166
112
  &--navy-blue & {
167
113
  &__details {
@@ -172,6 +118,10 @@
172
118
  }
173
119
  }
174
120
 
121
+ &--topic {
122
+ color: var(--ons-color-light-blue-grey);
123
+ }
124
+
175
125
  &__circle-1 {
176
126
  @include mq(l) {
177
127
  background-color: var(--ons-color-spring-green);
@@ -454,6 +404,83 @@
454
404
  }
455
405
  }
456
406
 
407
+ &--dark,
408
+ &--navy-blue {
409
+ .ons-breadcrumbs__link {
410
+ color: var(--ons-color-text-inverse);
411
+
412
+ &:hover {
413
+ color: var(--ons-color-text-inverse);
414
+ text-decoration: underline solid var(--ons-color-text-inverse) 2px;
415
+ }
416
+ &:focus {
417
+ color: var(--ons-color-text);
418
+ }
419
+ &:focus:hover {
420
+ color: var(--ons-color-text);
421
+ text-decoration: none;
422
+ }
423
+ }
424
+ }
425
+
426
+ &__badge-link {
427
+ display: block;
428
+ width: fit-content;
429
+ }
430
+
431
+ &__container {
432
+ align-items: center;
433
+ display: flex;
434
+ min-height: 300px;
435
+ position: relative;
436
+
437
+ &--has-details {
438
+ align-items: flex-start; // Prevents undesired shift if not enough content
439
+ }
440
+ }
441
+
442
+ &__content {
443
+ @include mq(l) {
444
+ display: flex;
445
+ justify-content: space-between;
446
+ align-items: flex-start;
447
+ }
448
+ }
449
+
450
+ &__information {
451
+ display: flex;
452
+ flex-wrap: wrap;
453
+ column-gap: 1rem;
454
+
455
+ & .ons-hero__panel {
456
+ padding: 0.5rem 1rem;
457
+ border-left: 5px solid transparent;
458
+ @extend .ons-u-fs-r--b;
459
+ }
460
+
461
+ & .ons-hero__link {
462
+ padding: 0.5rem 0;
463
+ }
464
+ }
465
+
466
+ &__pre-title {
467
+ margin-bottom: 0.5rem;
468
+
469
+ @include mq('2xs', m) {
470
+ max-width: 145px;
471
+ }
472
+ }
473
+
474
+ &__details {
475
+ padding-bottom: 3.5rem;
476
+ padding-top: 2rem;
477
+ position: relative;
478
+ z-index: 5;
479
+ #{$root}--with-breadcrumbs & {
480
+ padding-top: 1rem;
481
+ }
482
+ }
483
+
457
484
  &__title-container {
458
485
  @include mq(l) {
459
486
  display: grid;
@@ -6,7 +6,7 @@
6
6
  {% set detailsColumns = params.detailsColumns | default ('8') %}
7
7
 
8
8
  <section
9
- class="ons-hero ons-grid--gutterless{% if params.variants and params.variants is not string %}{% for variant in params.variants %}{{ ' ' }}ons-hero--{{ variant }}{% endfor %}{% else %}{{ ' ' }}ons-hero--{{ params.variants }}{% endif %}"
9
+ class="ons-hero ons-grid--gutterless{% if params.breadcrumbs %}{{ ' ' }}ons-hero--with-breadcrumbs{% endif %}{% if params.variants and params.variants is not string %}{% for variant in params.variants %}{{ ' ' }}ons-hero--{{ variant }}{% endfor %}{% else %}{{ ' ' }}ons-hero--{{ params.variants }}{% endif %}"
10
10
  >
11
11
  {% if params.variants == 'navy-blue' %}
12
12
  <div class="ons-hero__circles" aria-hidden="true">
@@ -11,6 +11,6 @@
11
11
  "url": '#0',
12
12
  "text": 'Get started'
13
13
  },
14
- "variants": ['dark']
14
+ "variants": 'dark'
15
15
  })
16
16
  }}