nsw-design-system 2.13.0 → 2.14.3

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 (65) hide show
  1. package/CHANGELOG.md +362 -476
  2. package/README.md +44 -8
  3. package/dist/css/main.css +1 -1
  4. package/dist/js/main.js +145 -14
  5. package/package.json +1 -1
  6. package/src/components/_all.scss +32 -0
  7. package/src/components/accordion/_accordion.scss +54 -11
  8. package/src/components/accordion/accordion.js +59 -12
  9. package/src/components/banner/_banner.scss +63 -28
  10. package/src/components/breadcrumbs/_breadcrumbs.scss +3 -7
  11. package/src/components/button/_button.scss +32 -19
  12. package/src/components/callout/_callout.scss +4 -5
  13. package/src/components/card/_card.scss +203 -23
  14. package/src/components/content-block/_content-block.scss +11 -9
  15. package/src/components/direction-links/_direction-links.scss +6 -5
  16. package/src/components/feature-tile/_feature-tile.scss +9 -14
  17. package/src/components/filters/_filters.scss +25 -19
  18. package/src/components/footer/_footer.scss +35 -32
  19. package/src/components/forms/_forms-prev.scss +45 -46
  20. package/src/components/forms/_forms.scss +73 -47
  21. package/src/components/header/_header.scss +142 -60
  22. package/src/components/hero-banner/_hero-banner.scss +12 -12
  23. package/src/components/hero-search/_hero-search.scss +15 -6
  24. package/src/components/in-page-navigation/_in-page-navigation.scss +3 -2
  25. package/src/components/link-list/_link-list.scss +6 -10
  26. package/src/components/list-item/_list-item.scss +10 -6
  27. package/src/components/main-navigation/_main-navigation.scss +27 -26
  28. package/src/components/masthead/_masthead.scss +70 -0
  29. package/src/components/media/_media.scss +15 -2
  30. package/src/components/notification/_notification.scss +27 -4
  31. package/src/components/pagination/_pagination.scss +10 -3
  32. package/src/components/progress-indicator/_progress-indicator.scss +3 -2
  33. package/src/components/results-bar/_results-bar.scss +1 -0
  34. package/src/components/side-navigation/_side-navigation.scss +12 -11
  35. package/src/components/site-wide-message/_site-wide-message.scss +31 -16
  36. package/src/components/social-bar/_social-bar.scss +2 -1
  37. package/src/components/tab-navigation/_tab-navigation.scss +8 -8
  38. package/src/components/tab-navigation/tab-navigation.js +3 -1
  39. package/src/components/tables/_tables.scss +23 -8
  40. package/src/components/tags/_tags.scss +14 -10
  41. package/src/global/scss/helpers/_all.scss +1 -2
  42. package/src/global/scss/helpers/_colour.scss +85 -0
  43. package/src/global/scss/helpers/_sr-only.scss +1 -2
  44. package/src/global/scss/settings/_palette.scss +68 -0
  45. package/src/global/scss/settings/_settings.scss +216 -192
  46. package/src/global/scss/settings/_theme.scss +78 -0
  47. package/src/global/scss/style/_all.scss +0 -1
  48. package/src/global/scss/style/_base.scss +1 -2
  49. package/src/global/scss/style/_grid.scss +1 -1
  50. package/src/global/scss/style/_icons.scss +27 -51
  51. package/src/global/scss/tools/_buttons.scss +21 -0
  52. package/src/global/scss/tools/_focus.scss +8 -9
  53. package/src/global/scss/tools/_general.scss +16 -42
  54. package/src/global/scss/tools/_links.scss +22 -7
  55. package/src/global/scss/tools/_print.scss +2 -2
  56. package/src/global/scss/tools/_typography.scss +8 -27
  57. package/src/main.scss +6 -2
  58. package/src/styles/_all.scss +3 -0
  59. package/src/styles/section/_section.scss +135 -0
  60. package/src/{global/scss/helpers → styles/spacing}/_spacing.scss +35 -4
  61. package/src/styles/typography/_typography.scss +119 -13
  62. package/src/global/scss/helpers/_section.scss +0 -50
  63. package/src/global/scss/style/_docs.scss +0 -538
  64. package/src/styles/grid/_grid.scss +0 -0
  65. package/src/styles/iconography/_iconography.scss +0 -0
package/README.md CHANGED
@@ -1,23 +1,27 @@
1
1
  # NSW Design System
2
2
 
3
- [![npm version](https://badge.fury.io/js/nsw-design-system.svg)](https://badge.fury.io/js/nsw-design-system)
4
3
  [![](https://data.jsdelivr.com/v1/package/npm/nsw-design-system/badge)](https://www.jsdelivr.com/package/npm/nsw-design-system)
5
4
  [![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/b183fe4d/nsw-design-system)
6
5
 
6
+ > You are looking at an old version (<2.14.0) of the design system. There is a new version 3 [here](https://github.com/digitalnsw/nsw-design-system).
7
+
7
8
  NSW Design system is a collection of reusable UI components used on the NSW government websites.
8
9
 
9
10
  See live examples of NSW Digital Design system components and guidance on how to use them on you website at [NSW Design System](https://nswdesignsystem.surge.sh).
10
11
 
12
+
11
13
  ## Using the design system
12
14
 
13
15
  How you use the NSW Design System depends on your team's capabilities. We recommend using `npm` but also provided in a CDN, and a downloadable starter kit which includes all the compiled assets.
14
16
 
15
17
  1. [Installing with NPM](#installing-with-npm)
16
- 2. [Using JSDelivr CDN](#using-jsdelivr-cdn)
17
- 3. [Download starter kit](#download-starter-kit)
18
+ 2. [Import styles](#importing-all-styles)
19
+ 3. [Adding the font and icons](#adding-the-font-and-the-icons)
20
+ 4. [Importing javascript into your project](#importing-javascript-into-your-project)
21
+ 5. [Using JSDelivr CDN](#using-jsdelivr-cdn)
22
+ 6. [Download starter kit](#download-starter-kit)
18
23
 
19
24
  ### Installing with NPM
20
- `npm` is a package manager for Node-based projects. We recommend `npm` packages because it makes it easy to update and install the design system from the command line.
21
25
  1. Install `Node/npm`.
22
26
 
23
27
  - More information can be found via the nodejs [Installation guides](https://nodejs.org/en/download/)
@@ -25,27 +29,59 @@ How you use the NSW Design System depends on your team's capabilities. We recomm
25
29
  2. Generate a `package.json` file using the `npm init` command in the terminal. You will be prompted to enter several pieces of information, like the name of your application, version, description etc.
26
30
 
27
31
  4. Add `nsw-design-system` to your project’s `package.json`:
28
- - `npm install --save nsw-design-system`
32
+ - `npm install --save nsw-design-system@2`
29
33
 
30
34
  The NSW Design System is now installed as a dependancy of your project, check out how to [import styles](#importing-styles-into-your-project) and [javascript](#importing-javascript-into-your-project) in to your project build.
31
35
 
32
36
 
33
- ### Importing styles into your project
37
+ ### Option 1: Import all styles
34
38
  The NSW Design System styles need to be added to the main Sass file in your project.
35
39
  Use the below snippet to import the NSW Design System (ideally placed before any other imports or sass):
36
40
  ```
37
41
  @import 'node_modules/nsw-design-system/src/main';
38
42
  ```
39
43
 
44
+ ### Option 2: Import core and certain components
45
+ The core library includes the design system's base theme, typography, mixins and helper functions. You can import this and take advantage of our variables and helpers.
46
+
47
+ In your own main Sass file, you can import NSW Design System’s core library.
48
+
49
+ ```
50
+ // Core libraries
51
+ @import 'node_modules/nsw-design-system/src/global/scss/settings/settings';
52
+ @import 'node_modules/nsw-design-system/src/global/scss/tools/all';
53
+ @import 'node_modules/nsw-design-system/src/global/scss/helpers/all';
54
+ @import 'node_modules/nsw-design-system/src/global/scss/style/all';
55
+ @import 'node_modules/nsw-design-system/src/styles/section/section';
56
+ @import 'node_modules/nsw-design-system/src/styles/spacing/spacing';
57
+ @import 'node_modules/nsw-design-system/src/styles/typography/typography';
58
+
59
+ ```
60
+
61
+ You can choose to import components as you need it. In the same file, import the Sass files of each component
62
+
63
+ ```
64
+ // Components
65
+ @import 'node_modules/nsw-design-system/src/components/accordion/accordion';
66
+ @import 'node_modules/nsw-design-system/src/components/card/card';
67
+ @import 'node_modules/nsw-design-system/src/components/notification/notification';
68
+ ```
69
+
70
+ With this setup you can also start theming with a few sets of variable changes.
71
+
40
72
  #### Adding the font and the icons
41
73
  In your main html document add this line of code inside the `<head>` tag. Make sure that it's placed before the NSW Design System styles import.
42
74
  ```
43
75
  <link href="https://fonts.googleapis.com/css?family=Montserrat:400,600&display=swap" rel="stylesheet">
44
76
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
45
77
  ```
46
-
78
+ Another way is to import it in css:
79
+ ```
80
+ @import url('https://fonts.googleapis.com/css?family=Montserrat:400,600&display=swap');
81
+ @import url('https://fonts.googleapis.com/icon?family=Material+Icons');
82
+ ```
47
83
  ### Importing javascript into your project
48
- Some of the NSW Design System components require javascript to provide advanced functionality. To ensure the page is ready for javascript to run, include the follow scripts tags at the end of the html document.
84
+ Some NSW Design System components require javascript to provide advanced functionality. To ensure the page is ready for javascript to run, include the follow scripts tags at the end of the html document.
49
85
  ```
50
86
  <script src="path/to/main.js"></script>
51
87
  <script>window.NSW.initSite()</script>