@ons/design-system 73.0.4 → 73.3.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 (41) hide show
  1. package/components/chart/_chart.scss +2 -2
  2. package/components/chart/_macro.spec.js +32 -0
  3. package/components/chart/annotations-options.js +1 -0
  4. package/components/chart/area-chart.js +3 -0
  5. package/components/chart/bar-chart.js +1 -0
  6. package/components/chart/chart.js +6 -4
  7. package/components/chart/column-chart.js +3 -0
  8. package/components/chart/example-area-chart.njk +2 -2
  9. package/components/chart/example-line-chart-with-label-format.njk +89 -0
  10. package/components/chart/reference-line-annotations-options.js +1 -0
  11. package/components/chart/specific-chart-options.js +8 -1
  12. package/components/details-panel/_macro.njk +6 -6
  13. package/components/header/_header.scss +3 -3
  14. package/components/header/_macro.njk +153 -143
  15. package/components/header/_macro.spec.js +223 -0
  16. package/components/header/example-header-basic-with-search-and-language-DEPRECATED.njk +207 -0
  17. package/components/header/example-header-basic-with-search-and-language.njk +36 -27
  18. package/components/header/example-header-basic-with-search-button.njk +35 -27
  19. package/components/hero/_macro.njk +4 -1
  20. package/components/hero/_macro.spec.js +26 -0
  21. package/components/list/_list.scss +0 -3
  22. package/components/panel/_panel.scss +5 -0
  23. package/components/phase-banner/_macro.njk +10 -1
  24. package/components/phase-banner/_macro.spec.js +27 -0
  25. package/components/phase-banner/example-phase-banner-beta-with-feedback-link.njk +18 -0
  26. package/components/phase-banner/example-phase-banner-beta-without-feedback-link.njk +7 -0
  27. package/components/question/_question.scss +1 -0
  28. package/components/radios/_macro.njk +1 -1
  29. package/components/skip-to-content/_macro.njk +1 -1
  30. package/components/skip-to-content/_skip.scss +0 -2
  31. package/components/table/_macro.njk +6 -3
  32. package/components/table/_macro.spec.js +58 -0
  33. package/components/table/_table.scss +9 -1
  34. package/components/table/example-table-with-valign-property.njk +142 -0
  35. package/components/table-of-contents/example-table-of-contents-grouped-with-single-list-item.njk +34 -0
  36. package/css/main.css +1 -1
  37. package/js/cookies-settings.js +5 -5
  38. package/package.json +18 -12
  39. package/scripts/main.es5.js +5 -3
  40. package/scripts/main.js +2 -2
  41. package/scss/utilities/_highlight.scss +1 -1
@@ -26,10 +26,18 @@
26
26
  overflow: hidden;
27
27
  padding: 0.5rem 0 0.5rem 1rem;
28
28
  text-align: left;
29
- vertical-align: top;
30
29
  &--numeric {
31
30
  text-align: right;
32
31
  }
32
+ &--top {
33
+ vertical-align: top;
34
+ }
35
+ &--bottom {
36
+ vertical-align: bottom;
37
+ }
38
+ &--center {
39
+ vertical-align: middle;
40
+ }
33
41
  }
34
42
 
35
43
  &--has-rowspan {
@@ -0,0 +1,142 @@
1
+ {% from "components/table/_macro.njk" import onsTable %}
2
+ {{
3
+ onsTable({
4
+ "caption": "Table with cells merged, multiple row headers and column headers",
5
+ "id": "basic-table",
6
+ "ths": [
7
+ {
8
+ "value": "Trade Category"
9
+ },
10
+ {
11
+ "value": "Metrics"
12
+ },
13
+ {
14
+ "value": "Exports"
15
+ },
16
+ {
17
+ "value": "Imports"
18
+ },
19
+ {
20
+ "value": "Balance"
21
+ }
22
+
23
+ ],
24
+ "trs": [
25
+ {
26
+ "tds": [
27
+ {
28
+ "heading": true,
29
+ "value": "Total trade in goods: December 2024 vs November 2024",
30
+ "rowspan":3,
31
+ "valign": "center"
32
+ },
33
+ {
34
+ "heading": true,
35
+ "value": "Value (£bn)"
36
+ },
37
+ {
38
+ "value": "28.8"
39
+ },
40
+ {
41
+ "value": "45.7"
42
+ },
43
+ {
44
+ "value": "-16.9"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "tds": [
50
+ {
51
+ "heading": true,
52
+ "value": "Change (£bn)"
53
+ },
54
+ {
55
+ "value": "0.0"
56
+ },
57
+ {
58
+ "value": "-1.2"
59
+ },
60
+ {
61
+ "value": "1.2"
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "tds": [
67
+ {
68
+ "heading": true,
69
+ "value": "%Change"
70
+ },
71
+ {
72
+ "value": "0.0"
73
+ },
74
+ {
75
+ "value": "2.6"
76
+ },
77
+ {
78
+ "value": ""
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ "tds": [
84
+ {
85
+ "heading": true,
86
+ "value": "EU: December 2024 vs November 2024",
87
+ "rowspan": 3,
88
+ "valign": "center"
89
+ },
90
+ {
91
+ "value": "Value (£bn)",
92
+ "heading": true
93
+ },
94
+ {
95
+ "value": "13.6"
96
+ },
97
+ {
98
+ "value": "24.9"
99
+ },
100
+ {
101
+ "value": "-11.3"
102
+ }
103
+ ]
104
+ },
105
+ {
106
+ "tds": [
107
+ {
108
+ "value": "Change (£bn)",
109
+ "heading": true
110
+ },
111
+ {
112
+ "value": "-0.5"
113
+
114
+ },
115
+ {
116
+ "value": "-0.8"
117
+ },
118
+ {
119
+ "value": "0.3"
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "tds": [
125
+ {
126
+ "heading": true,
127
+ "value": "%Change"
128
+ },
129
+ {
130
+ "value": "3.5"
131
+ },
132
+ {
133
+ "value": "-1.8"
134
+ },
135
+ {
136
+ "value": ""
137
+ }
138
+ ]
139
+ }
140
+ ]
141
+ })
142
+ }}
@@ -0,0 +1,34 @@
1
+ {% from "components/table-of-contents/_macro.njk" import onsTableOfContents %}
2
+
3
+ {{-
4
+ onsTableOfContents({
5
+ "title": 'Contents',
6
+ "ariaLabel": 'Links to page sections',
7
+ "skipLink": {
8
+ "url": '#0',
9
+ "text": 'Skip to guide content'
10
+ },
11
+ "lists": [
12
+ {
13
+ "listHeading": 'Household questions',
14
+ "listHeadingHidden": 'help topics',
15
+ "itemsList": [
16
+ {
17
+ "url": '#household1',
18
+ "text": 'Household and who lives here'
19
+ }
20
+ ]
21
+ },
22
+ {
23
+ "listHeading": 'Individual questions',
24
+ "listHeadingHidden": 'help topics',
25
+ "itemsList": [
26
+ {
27
+ "url": '#individual1',
28
+ "text": 'Name, date of birth and marital status'
29
+ }
30
+ ]
31
+ }
32
+ ]
33
+ })
34
+ -}}