@dta-au/civictheme-twig 1.13.6 → 1.15.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 (67) hide show
  1. package/assets/fonts/arimo/Arimo-variable.woff2 +0 -0
  2. package/assets/fonts/arimo/OFL.txt +93 -0
  3. package/assets/fonts/geist-mono/GeistMono-variable.woff2 +0 -0
  4. package/assets/fonts/geist-mono/OFL.txt +93 -0
  5. package/components/00-base/_variables.base.scss +35 -30
  6. package/components/00-base/data-vis/data-vis.mdx +41 -0
  7. package/components/00-base/data-vis/data-vis.stories.js +80 -0
  8. package/components/00-base/data-vis/data-vis.stories.scss +99 -0
  9. package/components/00-base/data-vis/data-vis.stories.twig +90 -0
  10. package/components/00-base/fonts/fonts.mdx +25 -0
  11. package/components/00-base/storybook/storybook.container.utils.stories.scss +1 -1
  12. package/components/00-base/typography/typography.mdx +44 -0
  13. package/components/00-base/typography/typography.mono.scss +14 -0
  14. package/components/00-base/typography/typography.stories.js +0 -1
  15. package/components/00-base/typography/typography.stories.twig +14 -0
  16. package/components/01-atoms/summary-list/summary-list.scss +6 -0
  17. package/components/01-atoms/summary-list/summary-list.stories.js +37 -0
  18. package/components/01-atoms/summary-list/summary-list.twig +9 -1
  19. package/components/02-molecules/progress-nav/progress-nav.mdx +56 -0
  20. package/components/02-molecules/progress-nav/progress-nav.scss +363 -0
  21. package/components/02-molecules/progress-nav/progress-nav.stories.js +63 -0
  22. package/components/02-molecules/progress-nav/progress-nav.twig +191 -0
  23. package/components/02-molecules/progress-tracker/progress-tracker.mdx +38 -0
  24. package/components/02-molecules/progress-tracker/progress-tracker.scss +180 -0
  25. package/components/02-molecules/progress-tracker/progress-tracker.stories.js +45 -0
  26. package/components/02-molecules/progress-tracker/progress-tracker.twig +61 -0
  27. package/components/02-molecules/table-of-contents/table-of-contents.js +96 -10
  28. package/components/02-molecules/table-of-contents/table-of-contents.mdx +30 -1
  29. package/components/02-molecules/table-of-contents/table-of-contents.scss +5 -0
  30. package/components/02-molecules/table-of-contents/table-of-contents.stories.js +162 -33
  31. package/components/02-molecules/table-of-contents/table-of-contents.twig +30 -13
  32. package/components/02-molecules/tabs/__snapshots__/tabs.test.js.snap +454 -15
  33. package/components/02-molecules/tabs/tabs.js +43 -0
  34. package/components/02-molecules/tabs/tabs.scss +86 -1
  35. package/components/02-molecules/tabs/tabs.stories.js +39 -0
  36. package/components/02-molecules/tabs/tabs.test.js +69 -0
  37. package/components/02-molecules/tabs/tabs.twig +38 -8
  38. package/components/03-organisms/chart/chart.data.js +333 -0
  39. package/components/03-organisms/chart/chart.js +593 -52
  40. package/components/03-organisms/chart/chart.mdx +126 -0
  41. package/components/03-organisms/chart/chart.scss +197 -40
  42. package/components/03-organisms/chart/chart.stories.js +67 -10
  43. package/components/03-organisms/chart/chart.twig +18 -1
  44. package/components/03-organisms/decision-tool/README.md +109 -0
  45. package/components/03-organisms/decision-tool/decision-tool.js +554 -0
  46. package/components/03-organisms/decision-tool/decision-tool.mdx +134 -0
  47. package/components/03-organisms/decision-tool/decision-tool.scss +490 -0
  48. package/components/03-organisms/decision-tool/decision-tool.stories.js +220 -0
  49. package/components/03-organisms/decision-tool/decision-tool.twig +343 -0
  50. package/components/03-organisms/filterable-table/filterable-table.js +59 -27
  51. package/components/03-organisms/filterable-table/filterable-table.stories.data.js +56 -0
  52. package/components/03-organisms/filterable-table/filterable-table.stories.js +22 -1
  53. package/components/03-organisms/filterable-table/filterable-table.twig +4 -1
  54. package/components/style.stories.scss +5 -0
  55. package/components/variables.base.scss +27 -0
  56. package/components/variables.components.scss +13 -0
  57. package/dist/assets/fonts/arimo/Arimo-variable.woff2 +0 -0
  58. package/dist/assets/fonts/arimo/OFL.txt +93 -0
  59. package/dist/assets/fonts/geist-mono/GeistMono-variable.woff2 +0 -0
  60. package/dist/assets/fonts/geist-mono/OFL.txt +93 -0
  61. package/dist/civictheme.css +1162 -118
  62. package/dist/civictheme.stories.css +210 -17
  63. package/dist/civictheme.storybook.css +1162 -118
  64. package/dist/civictheme.storybook.js +1684 -89
  65. package/dist/civictheme.variables.css +75 -75
  66. package/dist/constants.json +61 -42
  67. package/package.json +1 -1
@@ -0,0 +1,93 @@
1
+ Copyright 2026 The Arimo Project Authors (https://github.com/googlefonts/arimo)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -209,75 +209,80 @@ $ct-font-base-line-height: $ct-font-base-size !default;
209
209
  // override the defaults. This allows CivicTheme to make typography additions
210
210
  // without breaking consumer sites.
211
211
  $ct-typography: () !default;
212
+
213
+ // Line heights follow the dga-dl scale: headings 1.25, body/quote 1.5 (labels
214
+ // stay tight as single-line UI text). Letter-spacing is reset to 0 - dga-dl
215
+ // proposes none, and the previous negative px tracking was tuned for Lexend, not
216
+ // the current Arimo, and did not scale with user font-size.
212
217
  $ct-typography-default: (
213
218
  'display': (
214
- 'xxs': ($ct-font-base-size * 2, $ct-font-base-line-height * 2.5, 'bold', 'primary', -0.03px),
215
- 'm': ($ct-font-base-size * 3.5, $ct-font-base-line-height * 3.75, 'bold', 'primary', -1px)
219
+ 'xxs': ($ct-font-base-size * 2, $ct-font-base-line-height * 2.5, 'bold', 'primary', 0),
220
+ 'm': ($ct-font-base-size * 3.5, $ct-font-base-line-height * 4.375, 'bold', 'primary', 0)
216
221
  ),
217
222
  // Headings.
218
223
  'heading-1': (
219
- 'xxs': ($ct-font-base-size * 2, $ct-font-base-line-height * 2.5, 'bold', 'primary', -0.6px),
220
- 'm': ($ct-font-base-size * 3, $ct-font-base-line-height * 3.75, 'bold', 'primary', -1px)
224
+ 'xxs': ($ct-font-base-size * 2, $ct-font-base-line-height * 2.5, 'bold', 'primary', 0),
225
+ 'm': ($ct-font-base-size * 3, $ct-font-base-line-height * 3.75, 'bold', 'primary', 0)
221
226
  ),
222
227
  'heading-2': (
223
- 'xxs': ($ct-font-base-size * 1.75, $ct-font-base-line-height * 2.25, 'bold', 'primary', -0.5px),
224
- 'm': ($ct-font-base-size * 2.5, $ct-font-base-line-height * 3, 'bold', 'primary', -0.8px)
228
+ 'xxs': ($ct-font-base-size * 1.75, $ct-font-base-line-height * 2.1875, 'bold', 'primary', 0),
229
+ 'm': ($ct-font-base-size * 2.5, $ct-font-base-line-height * 3.125, 'bold', 'primary', 0)
225
230
  ),
226
231
  'heading-3': (
227
- 'xxs': ($ct-font-base-size * 1.5, $ct-font-base-line-height * 2, 'bold', 'primary', -0.35px),
228
- 'm': ($ct-font-base-size * 2, $ct-font-base-line-height * 2.5, 'bold', 'primary', -0.6px)
232
+ 'xxs': ($ct-font-base-size * 1.5, $ct-font-base-line-height * 1.875, 'bold', 'primary', 0),
233
+ 'm': ($ct-font-base-size * 2, $ct-font-base-line-height * 2.5, 'bold', 'primary', 0)
229
234
  ),
230
235
  'heading-4': (
231
- 'xxs': ($ct-font-base-size * 1.25, $ct-font-base-line-height * 1.5, 'bold', 'primary', -0.25px),
232
- 'm': ($ct-font-base-size * 1.5, $ct-font-base-line-height * 2, 'bold', 'primary', -0.4px)
236
+ 'xxs': ($ct-font-base-size * 1.25, $ct-font-base-line-height * 1.5625, 'bold', 'primary', 0),
237
+ 'm': ($ct-font-base-size * 1.5, $ct-font-base-line-height * 1.875, 'bold', 'primary', 0)
233
238
  ),
234
239
  'heading-5': (
235
- 'xxs': ($ct-font-base-size, $ct-font-base-line-height * 1.375, 'bold', 'primary', 0),
236
- 'm': ($ct-font-base-size * 1.25, $ct-font-base-line-height * 1.5, 'bold', 'primary', -0.2px)
240
+ 'xxs': ($ct-font-base-size, $ct-font-base-line-height * 1.25, 'bold', 'primary', 0),
241
+ 'm': ($ct-font-base-size * 1.25, $ct-font-base-line-height * 1.5625, 'bold', 'primary', 0)
237
242
  ),
238
- 'heading-6': ($ct-font-base-size, $ct-font-base-line-height * 1.625, 'bold', 'primary', 0),
243
+ 'heading-6': ($ct-font-base-size, $ct-font-base-line-height * 1.25, 'bold', 'primary', 0),
239
244
  // Text.
240
245
  'text-extra-large': (
241
- 'xxs': ($ct-font-base-size * 1.25, $ct-font-base-line-height * 1.5, 'regular', 'primary', -0.1px),
242
- 'm': ($ct-font-base-size * 1.5, $ct-font-base-line-height * 1.5, 'regular', 'primary', 0)
246
+ 'xxs': ($ct-font-base-size * 1.25, $ct-font-base-line-height * 1.875, 'regular', 'primary', 0),
247
+ 'm': ($ct-font-base-size * 1.5, $ct-font-base-line-height * 2.25, 'regular', 'primary', 0)
243
248
  ),
244
249
  'text-large': (
245
- 'xxs': ($ct-font-base-size * 1.125, $ct-font-base-line-height * 1.75, 'regular', 'primary', 0),
246
- 'm': ($ct-font-base-size * 1.25, $ct-font-base-line-height * 2.125, 'regular', 'primary', 0)
250
+ 'xxs': ($ct-font-base-size * 1.125, $ct-font-base-line-height * 1.6875, 'regular', 'primary', 0),
251
+ 'm': ($ct-font-base-size * 1.25, $ct-font-base-line-height * 1.875, 'regular', 'primary', 0)
247
252
  ),
248
253
  'text-regular': (
249
- 'xxs': ($ct-font-base-size * 0.875, $ct-font-base-line-height * 1.5, 'regular', 'primary', 0),
250
- 'm': ($ct-font-base-size, $ct-font-base-line-height * 1.75, 'regular', 'primary', 0)
254
+ 'xxs': ($ct-font-base-size * 0.875, $ct-font-base-line-height * 1.3125, 'regular', 'primary', 0),
255
+ 'm': ($ct-font-base-size, $ct-font-base-line-height * 1.5, 'regular', 'primary', 0)
251
256
  ),
252
257
  'text-small': (
253
- 'xxs': ($ct-font-base-size * 0.75, $ct-font-base-line-height * 1.25, 'regular', 'primary', 0),
254
- 'm': ($ct-font-base-size * 0.875, $ct-font-base-line-height * 1.5, 'regular', 'primary', 0),
258
+ 'xxs': ($ct-font-base-size * 0.75, $ct-font-base-line-height * 1.125, 'regular', 'primary', 0),
259
+ 'm': ($ct-font-base-size * 0.875, $ct-font-base-line-height * 1.3125, 'regular', 'primary', 0),
255
260
  ),
256
261
  // Labels.
257
262
  'label-extra-large': (
258
- 'xxs': ($ct-font-base-size * 1.25, $ct-font-base-line-height * 1.5, 'semibold', 'primary', -0.1px),
263
+ 'xxs': ($ct-font-base-size * 1.25, $ct-font-base-line-height * 1.5, 'semibold', 'primary', 0),
259
264
  'm': ($ct-font-base-size * 1.5, $ct-font-base-line-height * 1.5, 'semibold', 'primary', 0)
260
265
  ),
261
266
  'label-large': (
262
- 'xxs': ($ct-font-base-size * 1.125, $ct-font-base-line-height * 1.5, 'semibold', 'primary', -0.1px),
267
+ 'xxs': ($ct-font-base-size * 1.125, $ct-font-base-line-height * 1.5, 'semibold', 'primary', 0),
263
268
  'm': ($ct-font-base-size * 1.125, $ct-font-base-line-height * 1.5, 'semibold', 'primary', 0)
264
269
  ),
265
270
  'label-regular': (
266
- 'xxs': ($ct-font-base-size, $ct-font-base-line-height * 1.25, 'semibold', 'primary', -0.1px),
267
- 'm': ($ct-font-base-size, $ct-font-base-line-height * 1.25, 'semibold', 'primary', -0.1px)
271
+ 'xxs': ($ct-font-base-size, $ct-font-base-line-height * 1.25, 'semibold', 'primary', 0),
272
+ 'm': ($ct-font-base-size, $ct-font-base-line-height * 1.25, 'semibold', 'primary', 0)
268
273
  ),
269
274
  'label-small': (
270
- 'xxs': ($ct-font-base-size, $ct-font-base-line-height * 1.25, 'regular', 'primary', -0.1px),
271
- 'm': ($ct-font-base-size, $ct-font-base-line-height * 1.25, 'regular', 'primary', -0.1px)
275
+ 'xxs': ($ct-font-base-size, $ct-font-base-line-height * 1.25, 'regular', 'primary', 0),
276
+ 'm': ($ct-font-base-size, $ct-font-base-line-height * 1.25, 'regular', 'primary', 0)
272
277
  ),
273
278
  'label-extra-small': (
274
- 'xxs': ($ct-font-base-size * 0.875, $ct-font-base-line-height * 1.25, 'regular', 'primary', -0.1px),
279
+ 'xxs': ($ct-font-base-size * 0.875, $ct-font-base-line-height * 1.25, 'regular', 'primary', 0),
275
280
  'm': ($ct-font-base-size * 0.875, $ct-font-base-line-height * 1.125, 'regular', 'primary', 0)
276
281
  ),
277
282
  // Special elements.
278
283
  'quote': (
279
- 'xxs': ($ct-font-base-size * 1.125, $ct-font-base-line-height * 1.815, 'regular', 'primary', -0.15px),
280
- 'm': ($ct-font-base-size * 1.5, $ct-font-base-size * 2.5, 'regular', 'primary', -0.35px)
284
+ 'xxs': ($ct-font-base-size * 1.125, $ct-font-base-line-height * 1.6875, 'regular', 'primary', 0),
285
+ 'm': ($ct-font-base-size * 1.5, $ct-font-base-line-height * 2.25, 'regular', 'primary', 0)
281
286
  ),
282
287
  );
283
288
 
@@ -0,0 +1,41 @@
1
+ {/* Editorial guidance for the data-vis colour palettes. Specimens render from data-vis.stories.js. */}
2
+
3
+ import { Meta, Canvas } from '@storybook/addon-docs/blocks';
4
+ import * as Stories from './data-vis.stories';
5
+
6
+ <Meta of={Stories} />
7
+
8
+ # Data visualisation colour
9
+
10
+ The data-visualisation palette, anchored on the primary navy and shared across charts. Two palettes carry meaning: categorical for distinct, unordered groups, and sequential for ordered data. Colour encodes meaning – reach for these before adding more colours.
11
+
12
+ ## Categorical
13
+
14
+ Distinct, unordered groups – chart series, named categories. Six fixed, colour-blind-safe colours, navy first.
15
+
16
+ - **Cap at six.** Past that, adjacent colours stop being tellable apart, and colour-vision deficiency makes it worse.
17
+ - **For more groups**, reduce the categories, colour by a meaningful dimension instead, or lean on labels and position.
18
+
19
+ Use the CVD simulation to check the set holds up under the three common colour-vision deficiencies.
20
+
21
+ <Canvas of={Stories.Categorical} />
22
+
23
+ ## Sequential
24
+
25
+ Ordered data – ranks, confidence tiers, time. A single-hue navy ramp from darkest to lightest, with a pale grey reserved for no-data or suppressed values.
26
+
27
+ Use sparingly: adjacent steps do not meet contrast on their own. Always pair the ramp with another cue – data labels, patterns, or position. Three values use Dark/Mid/Light; four add Darkest; five use the full ramp.
28
+
29
+ <Canvas of={Stories.Sequential} />
30
+
31
+ ## Choosing the scheme
32
+
33
+ A chart's `color_by` is the explicit control over how colour is assigned.
34
+
35
+ <Canvas of={Stories.ColourScheme} />
36
+
37
+ ## Accessibility
38
+
39
+ - The categorical set is colour-blind-safe, but colour is never the sole cue – keep labels, legends and position.
40
+ - The sequential ramp is not contrast-safe step-to-step; pair it with data labels or patterns.
41
+ - The CVD toggle on the specimens above simulates deuteranopia, protanopia and tritanopia.
@@ -0,0 +1,80 @@
1
+ import Component from './data-vis.stories.twig';
2
+
3
+ // Specimen data. Values mirror the chart tokens --dga-data-vis-categorical-*
4
+ // (categorical) and --bdga-chart-s* (sequential) in chart.scss. Prose lives in
5
+ // data-vis.mdx; markup in data-vis.stories.twig.
6
+ const CATEGORICAL = [
7
+ { name: 'Navy', note: 'primary anchor', hex: '#1E3C50', rgb: '30, 60, 80' },
8
+ { name: 'Turquoise', note: '', hex: '#28A197', rgb: '40, 161, 151' },
9
+ { name: 'Dark pink', note: '', hex: '#801650', rgb: '128, 22, 80' },
10
+ { name: 'Orange', note: '', hex: '#F46A25', rgb: '244, 106, 37' },
11
+ { name: 'Light purple', note: '', hex: '#A285D1', rgb: '162, 133, 209' },
12
+ { name: 'Dark grey', note: '', hex: '#3D3D3D', rgb: '61, 61, 61' },
13
+ ];
14
+
15
+ const SEQUENTIAL = [
16
+ { name: 'Darkest', note: '', hex: '#001D33', rgb: '0, 29, 51' },
17
+ { name: 'Dark', note: '', hex: '#003C61', rgb: '0, 60, 97' },
18
+ { name: 'Mid', note: '', hex: '#015E8C', rgb: '1, 94, 140' },
19
+ { name: 'Light', note: '', hex: '#5693BD', rgb: '86, 147, 189' },
20
+ { name: 'Lightest', note: '', hex: '#AED0E8', rgb: '174, 208, 232' },
21
+ { name: 'Pale grey', note: 'no data', hex: '#F0EEEE', rgb: '240, 238, 238' },
22
+ ];
23
+
24
+ const COLORBY = [
25
+ { key: 'single', value: 'Default. One navy; distinguish by axis position, label and filter.' },
26
+ { key: 'series', value: 'One categorical colour per Y-series (multi-series charts).' },
27
+ { key: 'category', value: 'One categorical colour per X-position (few categories only).' },
28
+ { key: 'field name', value: 'Colour by that field: the sequential ramp for ordinal values, categorical otherwise.' },
29
+ ];
30
+
31
+ const CVD_FILTER = {
32
+ none: '',
33
+ deutan: 'url(#dv-deutan)',
34
+ protan: 'url(#dv-protan)',
35
+ tritan: 'url(#dv-tritan)',
36
+ };
37
+
38
+ // Render the twig, then wire the CVD toggle (markup stays in twig; this only
39
+ // adds behaviour). A no-op when a specimen has no toggle (e.g. ColourScheme).
40
+ const renderSpecimen = (args) => {
41
+ const wrap = document.createElement('div');
42
+ wrap.innerHTML = Component(args);
43
+ wrap.querySelectorAll('.dv-cvd__btn').forEach((btn) => {
44
+ btn.addEventListener('click', () => {
45
+ wrap.querySelectorAll('.dv-cvd__btn').forEach((b) => {
46
+ b.setAttribute('aria-pressed', b === btn ? 'true' : 'false');
47
+ });
48
+ const filter = CVD_FILTER[btn.dataset.cvd] || '';
49
+ wrap.querySelectorAll('.dv-chip, .dv-ramp').forEach((el) => {
50
+ el.style.filter = filter;
51
+ });
52
+ });
53
+ });
54
+ return wrap;
55
+ };
56
+
57
+ const meta = {
58
+ title: 'Base/Data visualisation/Colour',
59
+ component: Component,
60
+ // digital.gov.au extension - badged DGA in the sidebar (see manager.js).
61
+ tags: ['digitalgovau'],
62
+ parameters: { html: { disable: true } },
63
+ };
64
+
65
+ export default meta;
66
+
67
+ export const Categorical = {
68
+ args: { palette: { categorical: CATEGORICAL } },
69
+ render: renderSpecimen,
70
+ };
71
+
72
+ export const Sequential = {
73
+ args: { palette: { sequential: SEQUENTIAL } },
74
+ render: renderSpecimen,
75
+ };
76
+
77
+ export const ColourScheme = {
78
+ args: { palette: { colorby: COLORBY } },
79
+ render: renderSpecimen,
80
+ };
@@ -0,0 +1,99 @@
1
+ //
2
+ // Base / Data visualisation / Colour - specimen styles.
3
+ //
4
+ // The palette tables use the design-system .ct-table styling; only the swatch
5
+ // chip, sequential ramp, CVD toggle and a couple of cell helpers (no DS
6
+ // equivalent) are styled here. Editorial prose lives in data-vis.mdx; the
7
+ // color_by reference reuses the summary-list component.
8
+ //
9
+
10
+ // Secondary-text grey; CivicTheme's light palette has no caption/muted token.
11
+ $ct-dv-muted: #595959;
12
+
13
+ .dv__filters {
14
+ position: absolute;
15
+ }
16
+
17
+ .dv-cvd {
18
+ display: flex;
19
+ flex-wrap: wrap;
20
+ align-items: center;
21
+ gap: ct-spacing(0.5);
22
+ margin: 0 0 ct-spacing(2);
23
+ }
24
+
25
+ .dv-cvd__legend {
26
+ margin-inline-end: ct-spacing(1);
27
+ color: $ct-dv-muted;
28
+
29
+ @include ct-typography('label-regular');
30
+ }
31
+
32
+ .dv-cvd__btn {
33
+ padding: ct-spacing(0.5) ct-spacing(1.5);
34
+ border: ct-particle(0.125) solid ct-color-light('border');
35
+ border-radius: ct-particle(12.5);
36
+ background: transparent;
37
+ color: inherit;
38
+ cursor: pointer;
39
+
40
+ @include ct-typography('label-regular');
41
+
42
+ &[aria-pressed='true'] {
43
+ border-color: ct-color-light('heading');
44
+ background: ct-color-light('heading');
45
+ color: ct-color-light('background');
46
+ }
47
+ }
48
+
49
+ // The DS table component themes via runtime --ct-table-light-* tokens that the
50
+ // bare Storybook canvas doesn't provide, so the palette tables are styled here
51
+ // with DS scale functions (canvas-safe, system-consistent values).
52
+ .dv-table {
53
+ max-width: ct-particle(80);
54
+ border-collapse: collapse;
55
+
56
+ // Match the ct-table typography convention: text-regular body, label-regular
57
+ // applied to thead (not th) so the UA th bold weight survives as ct renders it.
58
+ @include ct-typography('text-regular');
59
+
60
+ thead {
61
+ @include ct-typography('label-regular');
62
+ }
63
+
64
+ th,
65
+ td {
66
+ padding: ct-spacing(1) ct-spacing(2);
67
+ border-block-end: ct-particle(0.125) solid ct-color-light('border');
68
+ text-align: start;
69
+ vertical-align: middle;
70
+ }
71
+ }
72
+
73
+ .dv-note {
74
+ color: $ct-dv-muted;
75
+ font-weight: 400;
76
+ }
77
+
78
+ .dv-mono {
79
+ font-family: ct-font('mono');
80
+ }
81
+
82
+ .dv-chip {
83
+ display: block;
84
+ width: ct-particle(6);
85
+ height: ct-particle(3);
86
+ border: ct-particle(0.125) solid ct-color-light('border');
87
+ border-radius: ct-particle(0.25);
88
+ transition: filter 0.15s;
89
+ }
90
+
91
+ .dv-ramp {
92
+ height: ct-particle(4);
93
+ max-width: ct-particle(80);
94
+ margin: 0 0 ct-spacing(1);
95
+ border: ct-particle(0.125) solid ct-color-light('border');
96
+ border-radius: ct-particle(0.5);
97
+ background: linear-gradient(to right, #001d33, #003c61, #015e8c, #5693bd, #aed0e8, #f0eeee);
98
+ transition: filter 0.15s;
99
+ }
@@ -0,0 +1,90 @@
1
+ {#
2
+ /**
3
+ * @file
4
+ * Story specimens for Base / Data visualisation / Colour.
5
+ *
6
+ * Renders the palette specimens only - the categorical and sequential tables
7
+ * (Colour / Hex / RGB / Example), the sequential ramp, and the color_by
8
+ * reference via the summary-list component. The palette tables are styled via
9
+ * .dv-table in the SCSS (the DS table component themes through runtime --ct-*
10
+ * tokens that the bare Storybook canvas lacks), with the swatch in the Example
11
+ * cell. Editorial prose lives in data-vis.mdx; the CVD toggle behaviour is
12
+ * wired in data-vis.stories.js. Sections render conditionally on the data
13
+ * passed, so this one template backs the Categorical, Sequential and
14
+ * ColourScheme stories.
15
+ *
16
+ * Props:
17
+ * - palette: [object]
18
+ * - categorical: [array] { name, note, hex, rgb }
19
+ * - sequential: [array] { name, note, hex, rgb }
20
+ * - colorby: [array] { key, value } (passed straight to summary-list)
21
+ */
22
+ #}
23
+ <div class="dv">
24
+ {% if palette.categorical is not empty or palette.sequential is not empty %}
25
+ <svg width="0" height="0" focusable="false" aria-hidden="true" class="dv__filters">
26
+ <filter id="dv-deutan" color-interpolation-filters="linearRGB"><feColorMatrix type="matrix" values="0.367322 0.860646 -0.227968 0 0 0.280085 0.672501 0.047413 0 0 -0.011820 0.042940 0.968881 0 0 0 0 0 1 0"/></filter>
27
+ <filter id="dv-protan" color-interpolation-filters="linearRGB"><feColorMatrix type="matrix" values="0.152286 1.052599 -0.204876 0 0 0.114503 0.786281 0.099216 0 0 -0.003882 -0.048116 1.051998 0 0 0 0 0 1 0"/></filter>
28
+ <filter id="dv-tritan" color-interpolation-filters="linearRGB"><feColorMatrix type="matrix" values="1.255528 -0.076749 -0.178779 0 0 -0.078411 0.930809 0.147602 0 0 0.004733 0.691367 0.303900 0 0 0 0 0 1 0"/></filter>
29
+ </svg>
30
+
31
+ <div class="dv-cvd" role="group" aria-label="Colour vision deficiency simulation">
32
+ <span class="dv-cvd__legend">CVD simulation</span>
33
+ <button type="button" class="dv-cvd__btn" data-cvd="none" aria-pressed="true">Normal</button>
34
+ <button type="button" class="dv-cvd__btn" data-cvd="deutan" aria-pressed="false">Deuteranopia</button>
35
+ <button type="button" class="dv-cvd__btn" data-cvd="protan" aria-pressed="false">Protanopia</button>
36
+ <button type="button" class="dv-cvd__btn" data-cvd="tritan" aria-pressed="false">Tritanopia</button>
37
+ </div>
38
+ {% endif %}
39
+
40
+ {% if palette.categorical is not empty %}
41
+ <table class="dv-table">
42
+ <thead>
43
+ <tr>
44
+ <th scope="col">Colour</th>
45
+ <th scope="col">Hex</th>
46
+ <th scope="col">RGB</th>
47
+ <th scope="col">Example</th>
48
+ </tr>
49
+ </thead>
50
+ <tbody>
51
+ {% for c in palette.categorical %}
52
+ <tr>
53
+ <th scope="row">{{ c.name }}{% if c.note %} <span class="dv-note">({{ c.note }})</span>{% endif %}</th>
54
+ <td><code>{{ c.hex }}</code></td>
55
+ <td class="dv-mono">{{ c.rgb }}</td>
56
+ <td aria-hidden="true"><span class="dv-chip" style="background: {{ c.hex }};"></span></td>
57
+ </tr>
58
+ {% endfor %}
59
+ </tbody>
60
+ </table>
61
+ {% endif %}
62
+
63
+ {% if palette.sequential is not empty %}
64
+ <div class="dv-ramp" aria-hidden="true"></div>
65
+ <table class="dv-table">
66
+ <thead>
67
+ <tr>
68
+ <th scope="col">Colour</th>
69
+ <th scope="col">Hex</th>
70
+ <th scope="col">RGB</th>
71
+ <th scope="col">Example</th>
72
+ </tr>
73
+ </thead>
74
+ <tbody>
75
+ {% for s in palette.sequential %}
76
+ <tr>
77
+ <th scope="row">{{ s.name }}{% if s.note %} <span class="dv-note">({{ s.note }})</span>{% endif %}</th>
78
+ <td><code>{{ s.hex }}</code></td>
79
+ <td class="dv-mono">{{ s.rgb }}</td>
80
+ <td aria-hidden="true"><span class="dv-chip" style="background: {{ s.hex }};"></span></td>
81
+ </tr>
82
+ {% endfor %}
83
+ </tbody>
84
+ </table>
85
+ {% endif %}
86
+
87
+ {% if palette.colorby is not empty %}
88
+ {% include '@atoms/summary-list/summary-list.twig' with { items: palette.colorby } only %}
89
+ {% endif %}
90
+ </div>
@@ -0,0 +1,25 @@
1
+ {/* Editorial guidance aligned with the digital.gov.au design library (dga-dl /src/content/foundations/typography). */}
2
+
3
+ import { Meta, Canvas } from '@storybook/addon-docs/blocks';
4
+ import * as Stories from './fonts.stories';
5
+
6
+ <Meta of={Stories} />
7
+
8
+ # Fonts
9
+
10
+ The font families bundled with the theme.
11
+
12
+ <Canvas of={Stories.Fonts} />
13
+
14
+ ## Families
15
+
16
+ - **Arimo** – the primary family, used for all body, heading, and label text. A neutral sans-serif that is metric-compatible with Arial, so the system fallback occupies the same space while the web font loads and there is no layout shift.
17
+ - **Geist Mono** – the monospace family, used for `code`, `kbd`, `samp`, and `pre`. Reserve it for code and technical identifiers, not for UI text that happens to need alignment.
18
+
19
+ ## Hosting
20
+
21
+ Both families are self-hosted as variable `woff2` files under the theme's assets, licensed under the SIL Open Font License. Self-hosting avoids third-party font-CDN requests, which keeps page loads leaner for users on slow or metered connections.
22
+
23
+ ## Weights
24
+
25
+ Each family is a single variable font spanning weights `400`–`700`. The type styles use Regular `400` for body text, SemiBold `600` for labels, and Bold `700` for headings. See [Typography](?path=/docs/base-typography--docs) for how weights map to each style.
@@ -96,7 +96,7 @@ code {
96
96
  background-color: #f5f5f5;
97
97
  border-radius: 4px;
98
98
  border: 1px solid #e1e1e8;
99
- color: #d63384;
99
+ color: #8a1f4d; // Was #d63384 (~4.1:1 on grey, fails AA); now ~8:1.
100
100
  display: inline-block;
101
101
  font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
102
102
  font-size: 0.9em;