nsw-design-system 3.0.4 → 3.2.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 (37) hide show
  1. package/CHANGELOG.md +241 -88
  2. package/README.md +7 -12
  3. package/dist/css/core.css +1 -1
  4. package/dist/css/main.css +1 -1
  5. package/dist/js/main.js +91 -0
  6. package/package.json +1 -1
  7. package/src/components/_all.scss +2 -0
  8. package/src/components/accordion/_accordion.scss +22 -0
  9. package/src/components/breadcrumbs/_breadcrumbs.scss +4 -0
  10. package/src/components/button/_button.scss +46 -43
  11. package/src/components/callout/_callout.scss +4 -0
  12. package/src/components/card/_card.scss +50 -0
  13. package/src/components/content-block/_content-block.scss +4 -0
  14. package/src/components/dialog/_dialog.scss +156 -0
  15. package/src/components/dialog/dialog.js +60 -0
  16. package/src/components/filters/_filters.scss +43 -0
  17. package/src/components/header/_header.scss +15 -4
  18. package/src/components/hero-banner/_hero-banner.scss +59 -25
  19. package/src/components/in-page-alert/_in-page-alert.scss +8 -0
  20. package/src/components/link-list/_link-list.scss +4 -0
  21. package/src/components/media/_media.scss +8 -0
  22. package/src/components/pagination/_pagination.scss +4 -0
  23. package/src/components/side-nav/_side-nav.scss +12 -0
  24. package/src/components/steps/_steps.scss +315 -0
  25. package/src/components/table/_table.scss +4 -0
  26. package/src/components/tabs/_tabs.scss +17 -0
  27. package/src/components/tag/_tag.scss +28 -0
  28. package/src/core/iconography/_icon.scss +4 -0
  29. package/src/core/section/_section.scss +4 -0
  30. package/src/core/typography/_typography.scss +12 -0
  31. package/src/global/scss/base/_mixins.scss +1 -1
  32. package/src/global/scss/helpers/_all.scss +2 -0
  33. package/src/global/scss/helpers/_border.scss +20 -0
  34. package/src/global/scss/helpers/_shadow.scss +3 -0
  35. package/src/global/scss/settings/_theme.scss +3 -0
  36. package/src/main.js +6 -0
  37. package/src/main.scss +2 -0
@@ -54,6 +54,14 @@
54
54
  height: 0;
55
55
  border-bottom: solid 2px var(--nsw-brand-accent);
56
56
  }
57
+
58
+ .nsw-section--invert & {
59
+ color: var(--nsw-text-light);
60
+ }
61
+ }
62
+
63
+ .nsw-section--invert & {
64
+ color: var(--nsw-text-light);
57
65
  }
58
66
  }
59
67
  }
@@ -66,12 +74,21 @@
66
74
 
67
75
  &:focus {
68
76
  @include nsw-focus;
77
+
78
+ .nsw-section--invert & {
79
+ outline-color: var(--nsw-white);
80
+ }
69
81
  }
70
82
 
71
83
  &--flush {
72
84
  padding: 0;
73
85
  }
74
86
 
87
+ &--side-flush {
88
+ padding-left: 0;
89
+ padding-right: 0;
90
+ }
91
+
75
92
  &--no-border {
76
93
  border-bottom: 0;
77
94
  }
@@ -20,28 +20,52 @@
20
20
  outline-width: 3px;
21
21
  }
22
22
 
23
+ .nsw-section--invert & {
24
+ @include link-light;
25
+ border-color: var(--nsw-text-light);
26
+ }
27
+
23
28
  &--checkbox {
24
29
  padding: 0;
25
30
  border: 0;
26
31
  border-radius: 0;
27
32
  position: relative;
28
33
 
34
+ &:hover {
35
+ .nsw-section--invert & {
36
+ background-color: transparent;
37
+ }
38
+ }
39
+
29
40
  input {
30
41
  position: absolute;
31
42
  opacity: 0;
32
43
 
33
44
  &:hover + label {
34
45
  @include nsw-hover;
46
+
47
+ .nsw-section--invert & {
48
+ background-color: var(--nsw-text-hover-light);
49
+ }
35
50
  }
36
51
 
37
52
  &:focus + label {
38
53
  @include nsw-focus;
39
54
  outline-offset: 0;
55
+
56
+ .nsw-section--invert & {
57
+ outline-color: var(--nsw-white);
58
+ }
40
59
  }
41
60
 
42
61
  &:checked + label {
43
62
  background-color: var(--nsw-brand-dark);
44
63
  color: var(--nsw-text-light);
64
+
65
+ .nsw-section--invert & {
66
+ background-color: var(--nsw-white);
67
+ color: var(--nsw-text-dark);
68
+ }
45
69
  }
46
70
  }
47
71
 
@@ -50,6 +74,10 @@
50
74
  border: solid 1px var(--nsw-brand-dark);
51
75
  border-radius: rem(24px);
52
76
  display: inline-block;
77
+
78
+ .nsw-section--invert & {
79
+ border-color: var(--nsw-text-light);
80
+ }
53
81
  }
54
82
  }
55
83
 
@@ -80,4 +80,8 @@ $nsw-icon-angles: (90, 180, 270);
80
80
  justify-content: center;
81
81
  align-items: center;
82
82
  }
83
+
84
+ .nsw-section--invert & {
85
+ @include link-light;
86
+ }
83
87
  }
@@ -92,4 +92,8 @@ $nsw-sections: (
92
92
  color: map-get($variant, color);
93
93
  }
94
94
  }
95
+
96
+ &--invert {
97
+ color: var(--nsw-text-light);
98
+ }
95
99
  }
@@ -90,6 +90,10 @@ table {
90
90
  text-align: left;
91
91
  vertical-align: baseline;
92
92
  border-bottom: solid 1px var(--nsw-grey-01);
93
+
94
+ .nsw-section--invert & {
95
+ border-color: var(--nsw-white);
96
+ }
93
97
  }
94
98
 
95
99
  th,
@@ -100,6 +104,10 @@ table {
100
104
 
101
105
  thead {
102
106
  border-bottom: solid 2px var(--nsw-grey-01);
107
+
108
+ .nsw-section--invert & {
109
+ border-color: var(--nsw-white);
110
+ }
103
111
  }
104
112
  }
105
113
 
@@ -196,6 +204,10 @@ h6,
196
204
 
197
205
  a {
198
206
  @include link;
207
+
208
+ .nsw-section--invert & {
209
+ @include link-light();
210
+ }
199
211
  }
200
212
 
201
213
  .nsw-link {
@@ -163,7 +163,7 @@
163
163
  // Font-size mixin - returns the font size for mobile and desktop based of the values in $font-sizes map
164
164
  @mixin font-size($size) {
165
165
  @if $size != 'xxs' and $size != 'xs' and $size != 'sm' and $size != 'md' and $size != 'lg' and $size != 'xl' and $size != 'xxl' {
166
- @error 'NSW-DS font-size mixin allows the following values for $sizes: xs, sm, md, lg, xl, xxl, xxxl. You have used "#{$size}"';
166
+ @error 'NSW-DS font-size mixin allows the following values for $sizes: xxs, xs, sm, md, lg, xl, xxl. You have used "#{$size}"';
167
167
  }
168
168
 
169
169
  @if $size {
@@ -1,4 +1,6 @@
1
+ @import 'border';
1
2
  @import 'colour';
2
3
  @import 'list';
4
+ @import 'shadow';
3
5
  @import 'text';
4
6
  @import 'visibility';
@@ -0,0 +1,20 @@
1
+ $nsw-helper-border-sizes: (2, 4, 6);
2
+ $nsw-helper-border-sides: ('left', 'right', 'top', 'bottom');
3
+
4
+ /* stylelint-disable declaration-no-important */
5
+
6
+ .nsw-border {
7
+ @each $size in $nsw-helper-border-sizes {
8
+ &--#{"" + $size} {
9
+ border: #{$size+'px'} solid var(--nsw-brand-accent) !important;
10
+ }
11
+
12
+ @each $side in $nsw-helper-border-sides {
13
+ &--#{"" + $side}-#{"" + $size} {
14
+ border-#{"" + $side}: #{$size+'px'} solid var(--nsw-brand-accent) !important;
15
+ }
16
+ }
17
+ }
18
+ }
19
+
20
+ /* stylelint-enable declaration-no-important */
@@ -0,0 +1,3 @@
1
+ .nsw-box-shadow {
2
+ box-shadow: var(--nsw-box-shadow);
3
+ }
@@ -77,6 +77,9 @@
77
77
  /* Borders */
78
78
  --nsw-border-radius: #{rem(4px)};
79
79
 
80
+ /* Shadows */
81
+ --nsw-box-shadow: 0 #{rem(4px)} #{rem(12px)} 0 rgba(var(--nsw-black-rgb), 0.15);
82
+
80
83
  /* Maximum width of container */
81
84
  --nsw-container-width: #{rem(1200px)};
82
85
  }
package/src/main.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import SiteSearch from './components/header/header'
2
2
  import Navigation from './components/main-nav/main-nav'
3
3
  import Accordion from './components/accordion/accordion'
4
+ import Dialog from './components/dialog/dialog'
4
5
  import Filters from './components/filters/filters'
5
6
  import Tabs from './components/tabs/tabs'
6
7
  import GlobalAlert from './components/global-alert/global-alert'
@@ -30,6 +31,7 @@ function initSite() {
30
31
  const openSearchButton = document.querySelectorAll('.js-open-search')
31
32
  const closeSearchButton = document.querySelectorAll('.js-close-search')
32
33
  const accordions = document.querySelectorAll('.js-accordion')
34
+ const dialogs = document.querySelectorAll('.js-dialog')
33
35
  const filters = document.querySelectorAll('.js-filters')
34
36
  const tabs = document.querySelectorAll('.js-tabs')
35
37
  const globalAlert = document.querySelectorAll('.js-global-alert')
@@ -49,6 +51,10 @@ function initSite() {
49
51
  new Accordion(element).init()
50
52
  })
51
53
 
54
+ dialogs.forEach((element) => {
55
+ new Dialog(element).init()
56
+ })
57
+
52
58
  if (filters) {
53
59
  filters.forEach((element) => {
54
60
  new Filters(element).init()
package/src/main.scss CHANGED
@@ -8,6 +8,7 @@
8
8
  @import 'core/all';
9
9
 
10
10
  @import 'components/accordion/accordion';
11
+ @import 'components/dialog/dialog';
11
12
  @import 'components/breadcrumbs/breadcrumbs';
12
13
  @import 'components/button/button';
13
14
  @import 'components/callout/callout';
@@ -31,6 +32,7 @@
31
32
  @import 'components/progress-indicator/progress-indicator';
32
33
  @import 'components/results-bar/results-bar';
33
34
  @import 'components/side-nav/side-nav';
35
+ @import 'components/steps/steps';
34
36
  @import 'components/table/table';
35
37
  @import 'components/tabs/tabs';
36
38
  @import 'components/tag/tag';