@ons/design-system 74.0.0-next.14 → 74.0.0-next.16
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/README.md +1 -1
- package/components/card/example-card-set-with-headline-figures.njk +4 -4
- package/components/chart/_chart.scss +0 -12
- package/components/chart/_macro.njk +62 -80
- package/components/chart/_macro.spec.js +0 -240
- package/components/chart/bar-chart.js +6 -1
- package/components/cookies-banner/_macro.njk +1 -1
- package/components/cookies-banner/_macro.spec.js +15 -3
- package/components/header/_macro.njk +4 -0
- package/components/message/_message.scss +3 -3
- package/components/summary/_macro.njk +3 -2
- package/components/summary/_summary.scss +6 -1
- package/components/table-of-contents/example-table-of-contents-sticky-full-page-ordered.njk +104 -106
- package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +103 -105
- package/components/table-of-contents/example-table-of-contents-sticky.njk +1 -1
- package/css/main.css +1 -1
- package/js/chart.js +0 -2
- package/js/cookies-functions.js +31 -42
- package/js/cookies-functions.spec.js +90 -46
- package/layout/_template.njk +1 -1
- package/package.json +2 -3
- package/scripts/chart.es5.js +1 -3
- package/scripts/chart.js +1 -3
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/objects/_container.scss +21 -4
- package/scss/utilities/_grid.scss +10 -25
- package/scss/vars/_forms.scss +0 -11
- package/scss/vars/_grid.scss +22 -3
- package/scss/vars/_utilities.scss +1 -1
- package/components/chart/chart-iframe-resize.dom.js +0 -8
- package/components/chart/chart-iframe-resize.js +0 -16
- package/components/chart/example-iframe-chart.njk +0 -36
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
.ons-container {
|
|
2
|
+
--ons-grid-gutter: #{$grid-gutter-mobile};
|
|
3
|
+
--ons-grid-container-padding: #{$grid-container-padding-mobile};
|
|
4
|
+
|
|
2
5
|
box-sizing: border-box;
|
|
3
6
|
margin: 0 auto;
|
|
4
7
|
max-width: $grid-max-width;
|
|
5
|
-
padding: 0
|
|
8
|
+
padding: 0 var(--ons-grid-container-padding);
|
|
6
9
|
position: relative;
|
|
7
10
|
width: 100%;
|
|
8
11
|
|
|
9
|
-
@include mq(
|
|
10
|
-
|
|
12
|
+
@include mq(m) {
|
|
13
|
+
--ons-grid-gutter: #{$grid-gutter-tablet};
|
|
14
|
+
--ons-grid-container-padding: #{$grid-container-padding-tablet};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@include mq(l) {
|
|
18
|
+
--ons-grid-gutter: #{$grid-gutter-standard};
|
|
19
|
+
--ons-grid-container-padding: #{$grid-container-padding-desktop-standard-mode};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--wide,
|
|
23
|
+
&--full-width {
|
|
24
|
+
@include mq(l) {
|
|
25
|
+
--ons-grid-gutter: #{$grid-gutter-wide};
|
|
26
|
+
--ons-grid-container-padding: #{$grid-container-padding-desktop-wide-mode};
|
|
27
|
+
}
|
|
11
28
|
}
|
|
12
29
|
|
|
13
30
|
&--wide {
|
|
14
|
-
max-width: $grid-max-
|
|
31
|
+
max-width: $grid-max-width-wide;
|
|
15
32
|
}
|
|
16
33
|
|
|
17
34
|
&--full-width {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
.ons-grid {
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
font-size: 0;
|
|
6
|
-
margin-left:
|
|
6
|
+
margin-left: calc(var(--ons-grid-gutter) * -1);
|
|
7
7
|
|
|
8
8
|
&--float {
|
|
9
9
|
letter-spacing: 0;
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
|
|
32
32
|
&--spaced {
|
|
33
33
|
.ons-grid__col {
|
|
34
|
-
margin-bottom:
|
|
34
|
+
margin-bottom: var(--ons-grid-gutter);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
&.ons-grid--tight {
|
|
38
38
|
.ons-grid__col {
|
|
39
|
-
margin-bottom:
|
|
39
|
+
margin-bottom: calc(var(--ons-grid-gutter) / 2);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
&--tight {
|
|
61
|
-
margin-left:
|
|
61
|
+
margin-left: calc(var(--ons-grid-gutter) / -2);
|
|
62
62
|
|
|
63
63
|
.ons-grid__col {
|
|
64
|
-
padding-left:
|
|
64
|
+
padding-left: calc(var(--ons-grid-gutter) / 2);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
&--loose {
|
|
69
|
-
margin-left:
|
|
69
|
+
margin-left: calc(var(--ons-grid-gutter) * -2);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
&--gutterless {
|
|
@@ -111,26 +111,11 @@
|
|
|
111
111
|
display: flex;
|
|
112
112
|
margin-left: 0;
|
|
113
113
|
flex-flow: column nowrap;
|
|
114
|
+
column-gap: var(--ons-grid-gutter);
|
|
114
115
|
|
|
115
116
|
@include mq('m') {
|
|
116
117
|
flex-direction: row;
|
|
117
118
|
}
|
|
118
|
-
|
|
119
|
-
&--xl {
|
|
120
|
-
column-gap: 2rem;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
&--l {
|
|
124
|
-
column-gap: 1.5rem;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
&--m {
|
|
128
|
-
column-gap: 1.25rem;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&--s {
|
|
132
|
-
column-gap: 1rem;
|
|
133
|
-
}
|
|
134
119
|
}
|
|
135
120
|
|
|
136
121
|
&__col {
|
|
@@ -139,7 +124,7 @@
|
|
|
139
124
|
display: inline-block;
|
|
140
125
|
// Fixes text overflow issues
|
|
141
126
|
min-width: 0;
|
|
142
|
-
padding-left:
|
|
127
|
+
padding-left: var(--ons-grid-gutter);
|
|
143
128
|
vertical-align: top;
|
|
144
129
|
width: 100%;
|
|
145
130
|
|
|
@@ -154,7 +139,7 @@
|
|
|
154
139
|
|
|
155
140
|
&--sticky\@m {
|
|
156
141
|
/* if parent element is set to flex, override the default align-self property
|
|
157
|
-
from stretch to flex-start so that it stays sticky on scroll after medium breakpoint -
|
|
142
|
+
from stretch to flex-start so that it stays sticky on scroll after medium breakpoint -
|
|
158
143
|
this is set for the table of contents component specifically */
|
|
159
144
|
.ons-grid-flex &,
|
|
160
145
|
.ons-grid-flex-gap & {
|
|
@@ -163,7 +148,7 @@
|
|
|
163
148
|
}
|
|
164
149
|
|
|
165
150
|
&--loose {
|
|
166
|
-
padding-left:
|
|
151
|
+
padding-left: calc(var(--ons-grid-gutter) * 2);
|
|
167
152
|
}
|
|
168
153
|
|
|
169
154
|
&--flex {
|
package/scss/vars/_forms.scss
CHANGED
|
@@ -47,14 +47,3 @@ $nbsp-width: 0.288rem;
|
|
|
47
47
|
#{$padding-width + $chars-width + $num-chars-width + $chars-space-width + $spaces-width} + #{($input-border-width * 2) + 2px}
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
$iframe-ratios: '16-9', '4-3', '21-9', '1-1', '3-2', '9-16';
|
|
52
|
-
|
|
53
|
-
@mixin iframe-aspect-ratio($class-name, $ratios: $iframe-ratios) {
|
|
54
|
-
@each $ratio in $ratios {
|
|
55
|
-
.#{str-replace($class-name, '{x}', $ratio)} {
|
|
56
|
-
aspect-ratio: #{str-replace($ratio, '-', '/')};
|
|
57
|
-
width: 100%;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
package/scss/vars/_grid.scss
CHANGED
|
@@ -10,10 +10,29 @@ $grid-bp: (
|
|
|
10
10
|
'2xl': 1600px,
|
|
11
11
|
) !default;
|
|
12
12
|
|
|
13
|
-
$grid-max-width:
|
|
14
|
-
$grid-max-
|
|
13
|
+
$grid-max-width: 69rem !default; // 1104px = 1024 content frame + 2×40 padding
|
|
14
|
+
$grid-max-width-wide: 87.5rem !default; // 1400px = 1304 content frame + 2×48 padding
|
|
15
15
|
$grid-cols: 12 !default;
|
|
16
16
|
$grid-cols-mobile: 4 !default;
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
// Inter-column gutter, per container mode
|
|
19
|
+
$grid-gutter-mobile: 0 !default;
|
|
20
|
+
$grid-gutter-tablet: 2rem !default; // 32px
|
|
21
|
+
$grid-gutter-standard: 2rem !default; // 32px
|
|
22
|
+
$grid-gutter-wide: 2.5rem !default; // 40px
|
|
23
|
+
|
|
24
|
+
// Container horizontal padding (space between container edge and its content)
|
|
25
|
+
$grid-container-padding-mobile: 1rem !default; // 16px
|
|
26
|
+
$grid-container-padding-tablet: 2rem !default; // 32px
|
|
27
|
+
$grid-container-padding-desktop-standard-mode: 2.5rem !default; // 40px
|
|
28
|
+
$grid-container-padding-desktop-wide-mode: 3rem !default; // 48px
|
|
29
|
+
|
|
18
30
|
$grid-bp-fixed: map.get($grid-bp, m) !default;
|
|
19
31
|
$grid-baseline: 16px;
|
|
32
|
+
|
|
33
|
+
// Default custom properties for standalone .ons-grid usage (outside any .ons-container).
|
|
34
|
+
// .ons-container overrides these via inheritance.
|
|
35
|
+
:root {
|
|
36
|
+
--ons-grid-gutter: #{$grid-gutter-standard};
|
|
37
|
+
--ons-grid-container-padding: #{$grid-container-padding-desktop-standard-mode};
|
|
38
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// equivalent of 9 columns at standard width
|
|
2
|
-
$reading-width:
|
|
2
|
+
$reading-width: 42rem; // 672px
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import ChartIframeResize from './chart-iframe-resize';
|
|
2
|
-
import domready from '../../js/domready';
|
|
3
|
-
|
|
4
|
-
domready(async () => {
|
|
5
|
-
[ChartIframeResize].forEach((Component) => {
|
|
6
|
-
document.querySelectorAll(Component.selector()).forEach((el) => new Component(el));
|
|
7
|
-
});
|
|
8
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import pym from 'pym.js';
|
|
2
|
-
|
|
3
|
-
class ChartIframeResize {
|
|
4
|
-
static selector() {
|
|
5
|
-
return '.ons-chart__iframe-wrapper iframe';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
constructor(node) {
|
|
9
|
-
this.node = node;
|
|
10
|
-
new pym.Child(this.node.getAttribute('id'), this.node.dataset.url, {
|
|
11
|
-
title: this.node.dataset.title,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default ChartIframeResize;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{% from "components/chart/_macro.njk" import onsChart %}
|
|
2
|
-
|
|
3
|
-
{# Important note: the example visualisation used here by the iframeUrl parameter
|
|
4
|
-
may not be available in the future once Florence is decommissioned. #}
|
|
5
|
-
|
|
6
|
-
{{
|
|
7
|
-
onsChart({
|
|
8
|
-
"description": "Volume sales, seasonally adjusted, Great Britain, January 2022 to January 2025",
|
|
9
|
-
"title": "Food stores showed a strong rise on the month, while non-food stores fell",
|
|
10
|
-
"subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
|
|
11
|
-
"id": "uuid",
|
|
12
|
-
"caption": "Source: Monthly Business Survey, Retail 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
|
-
"download": "file"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"text": "Simple text file (CSV format, 25KB)",
|
|
23
|
-
"url": "#",
|
|
24
|
-
"download": "file"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"text": "Image (PNG format, 25KB)",
|
|
28
|
-
"url": "#",
|
|
29
|
-
"download": "file"
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
"iframeUrl": "/iframe/index.html",
|
|
34
|
-
"fallbackImageUrl": "/img/small/line-chart-screenshot.png"
|
|
35
|
-
})
|
|
36
|
-
}}
|