@ons/design-system 62.0.2 → 62.1.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 (203) hide show
  1. package/README.md +0 -63
  2. package/components/access-code/example-access-code-error.njk +87 -0
  3. package/components/access-code/example-access-code.njk +63 -0
  4. package/components/accordion/example-accordion-open.njk +126 -0
  5. package/components/accordion/example-accordion.njk +25 -0
  6. package/components/address-input/example-address-input-editable.njk +52 -0
  7. package/components/address-input/example-address-input-manual.njk +23 -0
  8. package/components/address-input/example-address-input.njk +40 -0
  9. package/components/autosuggest/example-autosuggest-country-multiple.njk +30 -0
  10. package/components/autosuggest/example-autosuggest-country.njk +29 -0
  11. package/components/back-link/example-back-link.njk +17 -0
  12. package/components/breadcrumbs/example-breadcrumbs-single.njk +13 -0
  13. package/components/breadcrumbs/example-breadcrumbs.njk +17 -0
  14. package/components/button/example-button-custom.njk +20 -0
  15. package/components/button/example-button-disabled.njk +7 -0
  16. package/components/button/example-button-download.njk +9 -0
  17. package/components/button/example-button-ghost.njk +15 -0
  18. package/components/button/example-button-group.njk +16 -0
  19. package/components/button/example-button-link.njk +7 -0
  20. package/components/button/example-button-loader.njk +9 -0
  21. package/components/button/example-button-new-window.njk +12 -0
  22. package/components/button/example-button-print.njk +8 -0
  23. package/components/button/example-button-secondary-small.njk +8 -0
  24. package/components/button/example-button-secondary.njk +8 -0
  25. package/components/button/example-button-small.njk +8 -0
  26. package/components/button/example-button-timer.njk +9 -0
  27. package/components/button/example-button.njk +6 -0
  28. package/components/call-to-action/example-call-to-action-default.njk +14 -0
  29. package/components/card/example-card-set-with-images.njk +41 -0
  30. package/components/card/example-card-set-with-lists.njk +68 -0
  31. package/components/card/example-card-set.njk +38 -0
  32. package/components/card/example-card.njk +9 -0
  33. package/components/checkboxes/example-checkboxes-disabled.njk +34 -0
  34. package/components/checkboxes/example-checkboxes-error.njk +60 -0
  35. package/components/checkboxes/example-checkboxes-with-descriptions.njk +71 -0
  36. package/components/checkboxes/example-checkboxes-with-hidden-label.njk +177 -0
  37. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +86 -0
  38. package/components/checkboxes/example-checkboxes-with-revealed-radios.njk +69 -0
  39. package/components/checkboxes/example-checkboxes-with-revealed-select.njk +71 -0
  40. package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +59 -0
  41. package/components/checkboxes/example-checkboxes-with-select-all-button.njk +51 -0
  42. package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +61 -0
  43. package/components/checkboxes/example-checkboxes-without-border.njk +33 -0
  44. package/components/checkboxes/example-checkboxes.njk +46 -0
  45. package/components/content-pagination/example-content-pagination.njk +20 -0
  46. package/components/cookies-banner/_macro.njk +2 -2
  47. package/components/cookies-banner/_macro.spec.js +1 -1
  48. package/components/cookies-banner/example-cookies-banner-cymraeg.njk +9 -0
  49. package/components/cookies-banner/example-cookies-banner.njk +7 -0
  50. package/components/date-input/example-date-input-error.njk +62 -0
  51. package/components/date-input/example-date-input.njk +36 -0
  52. package/components/details/example-details-with-saved-state.njk +10 -0
  53. package/components/details/example-details-with-warning.njk +19 -0
  54. package/components/details/example-details.njk +9 -0
  55. package/components/document-list/example-document-list-article-featured.njk +31 -0
  56. package/components/document-list/example-document-list-articles.njk +60 -0
  57. package/components/document-list/example-document-list-downloads.njk +59 -0
  58. package/components/document-list/example-document-list-search-result-featured.njk +19 -0
  59. package/components/document-list/example-document-list-search-results.njk +67 -0
  60. package/components/duration/example-duration-error.njk +30 -0
  61. package/components/duration/example-duration.njk +35 -0
  62. package/components/duration/examples-duration-error-for-single-field.njk +31 -0
  63. package/components/external-link/example-external-link.njk +8 -0
  64. package/components/feedback/example-feedback-call-to-action.njk +14 -0
  65. package/components/footer/example-footer-cymraeg.njk +54 -0
  66. package/components/footer/example-footer-default.njk +7 -0
  67. package/components/footer/example-footer-transactional.njk +62 -0
  68. package/components/footer/example-footer-warning.njk +32 -0
  69. package/components/footer/example-footer-with-alternative-organisation.njk +124 -0
  70. package/components/footer/example-footer-with-coat-of-arms.njk +32 -0
  71. package/components/footer/example-footer-with-copyright.njk +35 -0
  72. package/components/footer/example-footer.njk +85 -0
  73. package/components/header/_header.scss +2 -2
  74. package/components/header/example-header-default.njk +12 -0
  75. package/components/header/example-header-external-for-survey-with-description.njk +20 -0
  76. package/components/header/example-header-external-for-surveys.njk +33 -0
  77. package/components/header/example-header-external-welsh.njk +29 -0
  78. package/components/header/example-header-external-with-navigation.njk +42 -0
  79. package/components/header/example-header-external-with-service-links.njk +35 -0
  80. package/components/header/example-header-external-with-sub-navigation.njk +132 -0
  81. package/components/header/example-header-internal.njk +32 -0
  82. package/components/header/example-header-neutral-for-multicoloured-logo.njk +59 -0
  83. package/components/hero/example-hero-dark.njk +15 -0
  84. package/components/hero/example-hero-default.njk +14 -0
  85. package/components/images/example-images-for-regular-screens.njk +8 -0
  86. package/components/images/example-images-for-retina-screens.njk +10 -0
  87. package/components/input/example-input-email.njk +12 -0
  88. package/components/input/example-input-number-prefixed.njk +17 -0
  89. package/components/input/example-input-number-suffixed.njk +34 -0
  90. package/components/input/example-input-number.njk +15 -0
  91. package/components/input/example-input-numeric-values.njk +64 -0
  92. package/components/input/example-input-telephone.njk +13 -0
  93. package/components/input/example-input-text-width-constrained.njk +11 -0
  94. package/components/input/example-input-text-with-character-limit-checker.njk +17 -0
  95. package/components/input/example-input-text-with-description.njk +10 -0
  96. package/components/input/example-input-text.njk +9 -0
  97. package/components/label/example-label-with-description.njk +8 -0
  98. package/components/label/example-label.njk +8 -0
  99. package/components/metadata/example-metadata.njk +57 -0
  100. package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +71 -0
  101. package/components/mutually-exclusive/example-mutually-exclusive-date-with-error.njk +47 -0
  102. package/components/mutually-exclusive/example-mutually-exclusive-date.njk +49 -0
  103. package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +45 -0
  104. package/components/mutually-exclusive/example-mutually-exclusive-email.njk +36 -0
  105. package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +63 -0
  106. package/components/mutually-exclusive/example-mutually-exclusive-number.njk +43 -0
  107. package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +40 -0
  108. package/components/pagination/example-pagination-first.njk +24 -0
  109. package/components/pagination/example-pagination-last.njk +24 -0
  110. package/components/pagination/example-pagination-with-no-range-indicator.njk +42 -0
  111. package/components/pagination/example-pagination.njk +116 -0
  112. package/components/panel/example-panel-bare.njk +9 -0
  113. package/components/panel/example-panel-with-announcement.njk +18 -0
  114. package/components/panel/example-panel-with-error-details.njk +18 -0
  115. package/components/panel/example-panel-with-error-summary.njk +25 -0
  116. package/components/panel/example-panel-with-information.njk +7 -0
  117. package/components/panel/example-panel-with-spacious-information.njk +7 -0
  118. package/components/panel/example-panel-with-success-message.njk +10 -0
  119. package/components/panel/example-panel-with-warning.njk +8 -0
  120. package/components/password/example-password.njk +11 -0
  121. package/components/phase-banner/example-phase-banner-alpha.njk +10 -0
  122. package/components/phase-banner/example-phase-banner-beta.njk +9 -0
  123. package/components/question/example-question-ccs.njk +49 -0
  124. package/components/question/example-question-fieldset.njk +99 -0
  125. package/components/question/example-question-interviewer-note.njk +38 -0
  126. package/components/question/example-question-no-fieldset.njk +46 -0
  127. package/components/radios/example-radios-with-clear-button.njk +97 -0
  128. package/components/radios/example-radios-with-descriptions.njk +57 -0
  129. package/components/radios/example-radios-with-error.njk +38 -0
  130. package/components/radios/example-radios-with-revealed-checkboxes.njk +69 -0
  131. package/components/radios/example-radios-with-revealed-radios.njk +68 -0
  132. package/components/radios/example-radios-with-revealed-select.njk +69 -0
  133. package/components/radios/example-radios-with-revealed-text-input.njk +80 -0
  134. package/components/radios/example-radios-with-separator.njk +59 -0
  135. package/components/radios/example-radios-with-visible-text-input.njk +40 -0
  136. package/components/radios/example-radios-without-border.njk +48 -0
  137. package/components/radios/examples-radios.njk +38 -0
  138. package/components/related-content/example-related-content-general.njk +44 -0
  139. package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -0
  140. package/components/related-content/example-related-content-social-media.njk +40 -0
  141. package/components/relationships/example-relationships-error.njk +211 -0
  142. package/components/relationships/example-relationships-you.njk +187 -0
  143. package/components/relationships/example-relationships.njk +185 -0
  144. package/components/search/example-search-with-character-check.njk +23 -0
  145. package/components/search/example-search-with-placeholder.njk +16 -0
  146. package/components/search/example-search.njk +16 -0
  147. package/components/section-navigation/example-section-navigation-vertical.njk +40 -0
  148. package/components/section-navigation/example-section-navigation.njk +21 -0
  149. package/components/select/example-select-wide.njk +55 -0
  150. package/components/select/example-select-with-error.njk +58 -0
  151. package/components/select/example-select-with-inline-label.njk +23 -0
  152. package/components/select/example-select.njk +50 -0
  153. package/components/share-page/example-share-page.njk +11 -0
  154. package/components/skip-to-content/example-skip-to-content.njk +10 -0
  155. package/components/status/example-status-dead.njk +7 -0
  156. package/components/status/example-status-error.njk +7 -0
  157. package/components/status/example-status-neutral-information.njk +6 -0
  158. package/components/status/example-status-pending.njk +7 -0
  159. package/components/status/example-status-small.njk +8 -0
  160. package/components/status/example-status-success.njk +7 -0
  161. package/components/summary/example-summary-grouped-total.njk +67 -0
  162. package/components/summary/example-summary-grouped-with-errors.njk +96 -0
  163. package/components/summary/example-summary-grouped.njk +353 -0
  164. package/components/summary/example-summary-household-no-rows.njk +20 -0
  165. package/components/summary/example-summary-household.njk +77 -0
  166. package/components/summary/example-summary-hub.njk +170 -0
  167. package/components/summary/example-summary-multiple.njk +81 -0
  168. package/components/summary/example-summary-no-action.njk +40 -0
  169. package/components/summary/example-summary.njk +107 -0
  170. package/components/table/example-table-basic.njk +47 -0
  171. package/components/table/example-table-compact.njk +73 -0
  172. package/components/table/example-table-footer.njk +56 -0
  173. package/components/table/example-table-numeric.njk +81 -0
  174. package/components/table/example-table-responsive.njk +89 -0
  175. package/components/table/example-table-scrollable.njk +158 -0
  176. package/components/table/example-table-sortable.njk +236 -0
  177. package/components/table-of-contents/example-table-of-contents-grouped.njk +50 -0
  178. package/components/table-of-contents/example-table-of-contents-single.njk +39 -0
  179. package/components/table-of-contents/example-table-of-contents-sticky.njk +78 -0
  180. package/components/tabs/example-tabs-details.njk +59 -0
  181. package/components/tabs/example-tabs.njk +39 -0
  182. package/components/textarea/example-textarea-error.njk +16 -0
  183. package/components/textarea/example-textarea-with-character-limit.njk +18 -0
  184. package/components/textarea/example-textarea.njk +12 -0
  185. package/components/timeline/example-timeline.njk +35 -0
  186. package/components/timeout-modal/example-timeout-modal.njk +16 -0
  187. package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -0
  188. package/components/upload/example-upload-error.njk +16 -0
  189. package/components/upload/example-upload.njk +12 -0
  190. package/components/video/example-video.njk +14 -0
  191. package/css/main.css +3 -3
  192. package/css/print.css +1 -1
  193. package/layout/_template.njk +1 -12
  194. package/package.json +3 -8
  195. package/scss/base/_typography.scss +2 -2
  196. package/scss/main.scss +0 -1
  197. package/scss/print.scss +13 -5
  198. package/scss/utilities/_highlight.scss +6 -0
  199. package/scss/utilities/_index.scss +1 -0
  200. package/components/code-highlight/_macro.njk +0 -5
  201. package/components/code-highlight/_macro.spec.js +0 -56
  202. package/components/code-highlight/code-highlight.spec.js +0 -18
  203. package/scss/patternlib.scss +0 -148
@@ -0,0 +1,170 @@
1
+ {% from "components/summary/_macro.njk" import onsSummary %}
2
+
3
+ {{ onsSummary({
4
+ "hub": true,
5
+ "summaries": [
6
+ {
7
+ "groups": [
8
+ {
9
+ "rows": [
10
+ {
11
+ "rowTitle": "People who live here",
12
+ "rowItems": [
13
+ {
14
+ "iconType": "check",
15
+ "valueList": [
16
+ {
17
+ "text": "Completed"
18
+ }
19
+ ],
20
+ "actions": [
21
+ {
22
+ "text": "View answers",
23
+ "ariaLabel": "View answers for People who live here",
24
+ "url": "#0"
25
+ }
26
+ ]
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ "rowTitle": "Accommodation",
32
+ "rowItems": [
33
+ {
34
+ "iconType": "check",
35
+ "valueList": [
36
+ {
37
+ "text": "Completed"
38
+ }
39
+ ],
40
+ "actions": [
41
+ {
42
+ "text": "View answers",
43
+ "ariaLabel": "View answers for Accommodation",
44
+ "url": "#0"
45
+ }
46
+ ]
47
+ }
48
+ ]
49
+ },
50
+ {
51
+ "rowTitle": "Mary Smith (You)",
52
+ "rowItems": [
53
+ {
54
+ "iconType": "check",
55
+ "valueList": [
56
+ {
57
+ "text": "Completed"
58
+ }
59
+ ],
60
+ "actions": [
61
+ {
62
+ "text": "View answers",
63
+ "ariaLabel": "View answers for Mary Smith",
64
+ "url": "#0"
65
+ }
66
+ ]
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "rowTitle": "John Smith",
72
+ "rowItems": [
73
+ {
74
+ "valueList": [
75
+ {
76
+ "text": "Partially completed"
77
+ }
78
+ ],
79
+ "actions": [
80
+ {
81
+ "text": "Continue with section",
82
+ "ariaLabel": "Continue with John Smith's section",
83
+ "url": "#0"
84
+ }
85
+ ]
86
+ }
87
+ ]
88
+ },
89
+ {
90
+ "rowTitle": "Billy Smith",
91
+ "rowItems": [
92
+ {
93
+ "valueList": [
94
+ {
95
+ "text": "Not started"
96
+ }
97
+ ],
98
+ "actions": [
99
+ {
100
+ "text": "Start section",
101
+ "ariaLabel": "Start Billy Smith's section",
102
+ "url": "#0"
103
+ }
104
+ ]
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "rowTitle": "Sally Smith",
110
+ "rowItems": [
111
+ {
112
+ "valueList": [
113
+ {
114
+ "text": "Not started"
115
+ }
116
+ ],
117
+ "actions": [
118
+ {
119
+ "text": "Start section",
120
+ "ariaLabel": "Start Sally Smith's section",
121
+ "url": "#0"
122
+ }
123
+ ]
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "rowTitle": "Wilhelmina Susannah Clementine-Smith (Visitor)",
129
+ "rowItems": [
130
+ {
131
+ "valueList": [
132
+ {
133
+ "text": "Not started"
134
+ }
135
+ ],
136
+ "actions": [
137
+ {
138
+ "text": "Start section",
139
+ "ariaLabel": "Start Wilhelmina Susannah Clementine-Smith's section",
140
+ "url": "#0"
141
+ }
142
+ ]
143
+ }
144
+ ]
145
+ },
146
+ {
147
+ "rowTitle": "Vera Jones (Visitor)",
148
+ "rowItems": [
149
+ {
150
+ "valueList": [
151
+ {
152
+ "text": "Not started"
153
+ }
154
+ ],
155
+ "actions": [
156
+ {
157
+ "text": "Start section",
158
+ "ariaLabel": "Start Vera Jones's section",
159
+ "url": "#0"
160
+ }
161
+ ]
162
+ }
163
+ ]
164
+ }
165
+ ]
166
+ }
167
+ ]
168
+ }
169
+ ]
170
+ }) }}
@@ -0,0 +1,81 @@
1
+ {% from "components/summary/_macro.njk" import onsSummary %}
2
+ {{
3
+ onsSummary({
4
+ "summaries": [
5
+ {
6
+ "summaryTitle": "Summary - Section Title",
7
+ "groups": [
8
+ {
9
+ "rows": [
10
+ {
11
+ "rowTitle": "What are your monthly household expenses?",
12
+ "rowItems": [
13
+ {
14
+ "rowTitle": "Food",
15
+ "valueList": [
16
+ {
17
+ "text": "£50.00"
18
+ }
19
+ ],
20
+ "actions": [
21
+ {
22
+ "text": "Change",
23
+ "ariaLabel": "Change answer",
24
+ "url": "#0"
25
+ }
26
+ ]
27
+ },
28
+ {
29
+ "rowTitle": "Utilities",
30
+ "valueList": [
31
+ {
32
+ "text": "£65.00"
33
+ }
34
+ ],
35
+ "actions": [
36
+ {
37
+ "text": "Change",
38
+ "ariaLabel": "Change answer",
39
+ "url": "#0"
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "rowTitle": "Transport",
45
+ "valueList": [
46
+ {
47
+ "text": "£70.00"
48
+ }
49
+ ],
50
+ "actions": [
51
+ {
52
+ "text": "Change",
53
+ "ariaLabel": "Change answer",
54
+ "url": "#0"
55
+ }
56
+ ]
57
+ },
58
+ {
59
+ "rowTitle": "Other",
60
+ "valueList": [
61
+ {
62
+ "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
63
+ }
64
+ ],
65
+ "actions": [
66
+ {
67
+ "text": "Change",
68
+ "ariaLabel": "Change answer",
69
+ "url": "#0"
70
+ }
71
+ ]
72
+ }
73
+ ]
74
+ }
75
+ ]
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ })
81
+ }}
@@ -0,0 +1,40 @@
1
+ {% from "components/summary/_macro.njk" import onsSummary %}
2
+ {{
3
+ onsSummary({
4
+ "summaries": [
5
+ {
6
+ "groups": [
7
+ {
8
+ "groupTitle": "Turnover",
9
+ "rows": [
10
+ {
11
+ "rowTitle": "What are the dates of the sales period you are reporting for?",
12
+ "rowItems": [
13
+ {
14
+ "valueList": [
15
+ {
16
+ "text": "01 January 2015 to 02 February 2017"
17
+ }
18
+ ]
19
+ }
20
+ ]
21
+ },
22
+ {
23
+ "rowTitle": "Total turnover",
24
+ "rowItems": [
25
+ {
26
+ "valueList": [
27
+ {
28
+ "text": "£234,000.00"
29
+ }
30
+ ]
31
+ }
32
+ ]
33
+ }
34
+ ]
35
+ }
36
+ ]
37
+ }
38
+ ]
39
+ })
40
+ }}
@@ -0,0 +1,107 @@
1
+ {% from "components/summary/_macro.njk" import onsSummary %}
2
+
3
+ {{
4
+ onsSummary({
5
+ "summaries": [
6
+ {
7
+ "groups": [
8
+ {
9
+ "placeholderText": 'test',
10
+ "id": "turnover",
11
+ "groupTitle": "Turnover",
12
+ "rows": [
13
+ {
14
+ "id": "sales-dates-row",
15
+ "rowTitle": "What are the dates of the sales period you are reporting for?",
16
+ "rowItems": [
17
+ {
18
+ "id": "sales-dates",
19
+ "valueList": [
20
+ {
21
+ "text": "1 January 2015 to 2 February 2017"
22
+ }
23
+ ],
24
+ "actions": [
25
+ {
26
+ "text": "Change",
27
+ "ariaLabel": "Change answer",
28
+ "url": "#0"
29
+ }
30
+ ]
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ "rowTitle": "For the period 1 January 2015 to 2 February 2017, what was the value of your total turnover, excluding VAT?",
36
+ "id": "sales-value-row",
37
+ "rowItems": [
38
+ {
39
+ "id": "sales-value",
40
+ "valueList": [
41
+ {
42
+ "text": "£180,440"
43
+ }
44
+ ],
45
+ "actions": [
46
+ {
47
+ "text": "Change",
48
+ "ariaLabel": "Change answer",
49
+ "url": "#0"
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ "id": "sales-reasons-row",
57
+ "rowTitle": "Please indicate the reasons for any changes in the total turnover",
58
+ "rowItems": [
59
+ {
60
+ "id": "sales-reasons",
61
+ "valueList": [
62
+ {
63
+ "text": "Change in level of business activity"
64
+ },
65
+ {
66
+ "text": "Special/calendar events",
67
+ "other": "Some other value"
68
+ }
69
+ ],
70
+ "actions": [
71
+ {
72
+ "text": "Change",
73
+ "ariaLabel": "Change answer",
74
+ "url": "#0"
75
+ }
76
+ ]
77
+ }
78
+ ]
79
+ },
80
+ {
81
+ "id": "sales-detail-row",
82
+ "rowTitle": "Please describe the changes in total turnover in more detail",
83
+ "rowItems": [
84
+ {
85
+ "id": "sales-detail",
86
+ "valueList": [
87
+ {
88
+ "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
89
+ }
90
+ ],
91
+ "actions": [
92
+ {
93
+ "text": "Change",
94
+ "ariaLabel": "Change answer",
95
+ "url": "#0"
96
+ }
97
+ ]
98
+ }
99
+ ]
100
+ }
101
+ ]
102
+ }
103
+ ]
104
+ }
105
+ ]
106
+ })
107
+ }}
@@ -0,0 +1,47 @@
1
+ {% from "components/table/_macro.njk" import onsTable %}
2
+ {{
3
+ onsTable({
4
+ "caption": "A basic table with a caption",
5
+ "id": "basic-table",
6
+ "ths": [
7
+ {
8
+ "value": "Column A"
9
+ },
10
+ {
11
+ "value": "Column B"
12
+ },
13
+ {
14
+ "value": "Column C"
15
+ }
16
+ ],
17
+ "trs": [
18
+ {
19
+ "tds": [
20
+ {
21
+ "value": "Cell A1",
22
+ "name": "cell-name"
23
+ },
24
+ {
25
+ "value": "Cell B1"
26
+ },
27
+ {
28
+ "value": "Cell C1"
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ "tds": [
34
+ {
35
+ "value": "Cell A2"
36
+ },
37
+ {
38
+ "value": "Cell B2"
39
+ },
40
+ {
41
+ "value": "Cell C2"
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ })
47
+ }}
@@ -0,0 +1,73 @@
1
+ {% from "components/table/_macro.njk" import onsTable %}
2
+ {{
3
+ onsTable({
4
+ "variants": ['compact', 'row-hover'],
5
+ "caption": "A compacted table with a large number of columns",
6
+ "ths": [
7
+ {
8
+ "value": "Column A"
9
+ },
10
+ {
11
+ "value": "Column B"
12
+ },
13
+ {
14
+ "value": "Column C"
15
+ },
16
+ {
17
+ "value": "Column D"
18
+ },
19
+ {
20
+ "value": "Column E"
21
+ },
22
+ {
23
+ "value": "Column F"
24
+ }
25
+ ],
26
+ "trs": [
27
+ {
28
+ "tds": [
29
+ {
30
+ "value": "Cell A1"
31
+ },
32
+ {
33
+ "value": "Cell B1"
34
+ },
35
+ {
36
+ "value": "Cell C1"
37
+ },
38
+ {
39
+ "value": "Cell D1"
40
+ },
41
+ {
42
+ "value": "Cell E1"
43
+ },
44
+ {
45
+ "value": "Cell F1"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "tds": [
51
+ {
52
+ "value": "Cell A2"
53
+ },
54
+ {
55
+ "value": "Cell B2"
56
+ },
57
+ {
58
+ "value": "Cell C2"
59
+ },
60
+ {
61
+ "value": "Cell D2"
62
+ },
63
+ {
64
+ "value": "Cell E1"
65
+ },
66
+ {
67
+ "value": "Cell F1"
68
+ }
69
+ ]
70
+ }
71
+ ]
72
+ })
73
+ }}
@@ -0,0 +1,56 @@
1
+ {% from "components/table/_macro.njk" import onsTable %}
2
+ {{
3
+ onsTable({
4
+ "caption": "A basic table with a footer",
5
+ "ths": [
6
+ {
7
+ "value": "Column A"
8
+ },
9
+ {
10
+ "value": "Column B"
11
+ },
12
+ {
13
+ "value": "Column C"
14
+ }
15
+ ],
16
+ "trs": [
17
+ {
18
+ "tds": [
19
+ {
20
+ "value": "Cell A1"
21
+ },
22
+ {
23
+ "value": "Cell B1"
24
+ },
25
+ {
26
+ "value": "Cell C1"
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ "tds": [
32
+ {
33
+ "value": "Cell A2"
34
+ },
35
+ {
36
+ "value": "Cell B2"
37
+ },
38
+ {
39
+ "value": "Cell C2"
40
+ }
41
+ ]
42
+ }
43
+ ],
44
+ "tfoot": [
45
+ {
46
+ "value": "Column summary"
47
+ },
48
+ {
49
+ "value": "Column summary"
50
+ },
51
+ {
52
+ "value": "Column summary"
53
+ }
54
+ ]
55
+ })
56
+ }}
@@ -0,0 +1,81 @@
1
+ {% from "components/table/_macro.njk" import onsTable %}
2
+ {{
3
+ onsTable({
4
+ "caption": "A basic table with numeric values",
5
+ "ths": [
6
+ {
7
+ "value": "Country"
8
+ },
9
+ {
10
+ "value": "Population mid-2020",
11
+ "numeric": true
12
+ },
13
+ {
14
+ "value": "% change 2019 to 2020",
15
+ "numeric": true
16
+ }
17
+ ],
18
+ "trs": [
19
+ {
20
+ "tds": [
21
+ {
22
+ "value": "England"
23
+ },
24
+ {
25
+ "value": "67,081,000",
26
+ "numeric": true
27
+ },
28
+ {
29
+ "value": "0.43",
30
+ "numeric": true
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ "tds": [
36
+ {
37
+ "value": "Northern Ireland"
38
+ },
39
+ {
40
+ "value": "1,896,000",
41
+ "numeric": true
42
+ },
43
+ {
44
+ "value": "0.10",
45
+ "numeric": true
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "tds": [
51
+ {
52
+ "value": "Scotland"
53
+ },
54
+ {
55
+ "value": "5,466,000",
56
+ "numeric": true
57
+ },
58
+ {
59
+ "value": "0.05",
60
+ "numeric": true
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "tds": [
66
+ {
67
+ "value": "Wales"
68
+ },
69
+ {
70
+ "value": "3,170,000",
71
+ "numeric": true
72
+ },
73
+ {
74
+ "value": "0.53",
75
+ "numeric": true
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ })
81
+ }}