nsw-design-system 3.0.2 → 3.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 (36) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/README.md +7 -1
  3. package/dist/css/core.css +1 -1
  4. package/dist/css/main.css +1 -1
  5. package/package.json +2 -3
  6. package/src/components/_all.scss +1 -0
  7. package/src/components/accordion/_accordion.scss +22 -0
  8. package/src/components/breadcrumbs/_breadcrumbs.scss +4 -0
  9. package/src/components/button/_button.scss +57 -44
  10. package/src/components/callout/_callout.scss +4 -34
  11. package/src/components/card/_card.scss +56 -6
  12. package/src/components/content-block/_content-block.scss +4 -0
  13. package/src/components/filters/_filters.scss +51 -4
  14. package/src/components/header/_header.scss +39 -4
  15. package/src/components/hero-banner/_hero-banner.scss +60 -26
  16. package/src/components/hero-search/_hero-search.scss +1 -1
  17. package/src/components/in-page-alert/_in-page-alert.scss +22 -2
  18. package/src/components/in-page-nav/_in-page-nav.scss +1 -1
  19. package/src/components/link-list/_link-list.scss +4 -0
  20. package/src/components/media/_media.scss +8 -0
  21. package/src/components/pagination/_pagination.scss +4 -0
  22. package/src/components/side-nav/_side-nav.scss +12 -0
  23. package/src/components/steps/_steps.scss +315 -0
  24. package/src/components/table/_table.scss +4 -0
  25. package/src/components/tabs/_tabs.scss +18 -1
  26. package/src/components/tag/_tag.scss +28 -0
  27. package/src/core/iconography/_icon.scss +4 -0
  28. package/src/core/section/_section.scss +4 -0
  29. package/src/core/typography/_typography.scss +71 -1
  30. package/src/global/scss/base/_mixins.scss +1 -1
  31. package/src/global/scss/helpers/_all.scss +2 -0
  32. package/src/global/scss/helpers/_border.scss +20 -0
  33. package/src/global/scss/helpers/_shadow.scss +3 -0
  34. package/src/global/scss/settings/_palette.scss +1 -1
  35. package/src/global/scss/settings/_theme.scss +3 -0
  36. package/src/main.scss +1 -0
@@ -1,7 +1,7 @@
1
1
  .nsw-in-page-nav {
2
2
  @include component-spacing();
3
3
  padding: rem(16px);
4
- border-left: solid 4px var(--nsw-brand-accent);
4
+ border-left: solid 2px var(--nsw-brand-accent);
5
5
 
6
6
  &__title {
7
7
  @include font-size(md);
@@ -50,6 +50,10 @@
50
50
  .nsw-material-icons {
51
51
  text-decoration: none;
52
52
  }
53
+
54
+ .nsw-section--invert & {
55
+ color: var(--nsw-text-light);
56
+ }
53
57
  }
54
58
 
55
59
  .nsw-material-icons {
@@ -2,6 +2,10 @@
2
2
  width: 100%;
3
3
  margin: rem(16px) auto;
4
4
 
5
+ .nsw-section--invert & {
6
+ color: var(--nsw-text-dark);
7
+ }
8
+
5
9
  @include breakpoint('md') {
6
10
  margin-top: rem(32px);
7
11
  margin-bottom: rem(32px);
@@ -107,6 +111,10 @@
107
111
  padding-left: 0;
108
112
  padding-right: 0;
109
113
  padding-bottom: 0;
114
+
115
+ .nsw-section--invert & {
116
+ color: var(--nsw-text-light);
117
+ }
110
118
  }
111
119
  }
112
120
  }
@@ -51,6 +51,10 @@
51
51
  height: 2px;
52
52
  background-color: var(--nsw-brand-accent);
53
53
  }
54
+
55
+ .nsw-section--invert & {
56
+ color: var(--nsw-text-light);
57
+ }
54
58
  }
55
59
  }
56
60
  }
@@ -53,12 +53,24 @@
53
53
 
54
54
  &.current {
55
55
  background-color: var(--nsw-off-white);
56
+
57
+ .nsw-section--invert & {
58
+ background-color: var(--nsw-text-hover-light);
59
+ }
60
+ }
61
+
62
+ .nsw-section--invert & {
63
+ color: var(--nsw-text-light);
56
64
  }
57
65
  }
58
66
 
59
67
  &__header {
60
68
  border-bottom: solid 2px var(--nsw-brand-dark);
61
69
 
70
+ .nsw-section--invert & {
71
+ border-color: var(--nsw-brand-light);
72
+ }
73
+
62
74
  a {
63
75
  font-weight: var(--nsw-font-bold);
64
76
  padding: rem(8px) 0;
@@ -0,0 +1,315 @@
1
+ .nsw-steps {
2
+ @include component-spacing();
3
+ counter-reset: step;
4
+
5
+ &__item {
6
+ position: relative;
7
+
8
+ &:last-child {
9
+ .nsw-steps__content {
10
+ padding-bottom: 0;
11
+
12
+ &::before {
13
+ bottom: 0;
14
+ }
15
+ }
16
+ }
17
+
18
+ &::before {
19
+ content: '';
20
+ position: absolute;
21
+ top: rem(1px);
22
+ left: 0;
23
+ width: rem(32px);
24
+ height: rem(32px);
25
+ border: rem(4px) solid var(--nsw-brand-accent);
26
+ border-radius: 100%;
27
+
28
+ @include breakpoint('lg') {
29
+ width: rem(48px);
30
+ height: rem(48px);
31
+ top: rem(-4px);
32
+ }
33
+ }
34
+
35
+ &::after {
36
+ @include font-size('md');
37
+ counter-increment: step;
38
+ content: counter(step);
39
+ position: absolute;
40
+ top: rem(1px);
41
+ left: 0;
42
+ width: rem(32px);
43
+ height: rem(32px);
44
+ display: flex;
45
+ justify-content: center;
46
+ align-items: center;
47
+ color: var(--nsw-brand-accent);
48
+ font-weight: var(--nsw-font-bold);
49
+ visibility: hidden;
50
+
51
+ @include breakpoint('lg') {
52
+ width: rem(48px);
53
+ height: rem(48px);
54
+ top: rem(-4px);
55
+ }
56
+ }
57
+
58
+ &--fill {
59
+ &::before {
60
+ background-color: var(--nsw-brand-accent);
61
+ }
62
+
63
+ &::after {
64
+ color: var(--nsw-text-light);
65
+ }
66
+
67
+ .nsw-steps--dark & {
68
+ &::before {
69
+ background-color: var(--nsw-brand-dark);
70
+ }
71
+ }
72
+
73
+ .nsw-steps--light & {
74
+ &::before {
75
+ background-color: var(--nsw-brand-light);
76
+ }
77
+ }
78
+
79
+ .nsw-steps--supplementary & {
80
+ &::before {
81
+ background-color: var(--nsw-brand-supplementary);
82
+ }
83
+ }
84
+ }
85
+ }
86
+
87
+ &__content {
88
+ position: relative;
89
+ padding: 0 0 rem(24px) rem(48px);
90
+
91
+ @include breakpoint('lg') {
92
+ padding: 0 0 rem(32px) rem(72px);
93
+ }
94
+
95
+ &::before {
96
+ content: '';
97
+ position: absolute;
98
+ top: rem(33px);
99
+ bottom: rem(-1px);
100
+ left: rem(14px);
101
+ width: rem(4px);
102
+ background-color: var(--nsw-brand-accent);
103
+
104
+ @include breakpoint('lg') {
105
+ top: rem(44px);
106
+ left: rem(22px);
107
+ bottom: rem(4px);
108
+ }
109
+ }
110
+ }
111
+
112
+ &--dark {
113
+ .nsw-steps__item {
114
+ &::before {
115
+ border-color: var(--nsw-brand-dark);
116
+ }
117
+
118
+ &::after {
119
+ color: var(--nsw-brand-dark);
120
+ }
121
+
122
+ &--fill {
123
+ &::after {
124
+ color: var(--nsw-text-light);
125
+ }
126
+ }
127
+ }
128
+
129
+ .nsw-steps__content {
130
+ &::before {
131
+ background-color: var(--nsw-brand-dark);
132
+ }
133
+ }
134
+ }
135
+
136
+ &--light {
137
+ .nsw-steps__item {
138
+ &::before {
139
+ border-color: var(--nsw-brand-light);
140
+ }
141
+
142
+ &::after {
143
+ color: var(--nsw-brand-light);
144
+ }
145
+
146
+ &--fill {
147
+ &::after {
148
+ color: var(--nsw-text-dark);
149
+ }
150
+ }
151
+ }
152
+
153
+ .nsw-steps__content {
154
+ &::before {
155
+ background-color: var(--nsw-brand-light);
156
+ }
157
+ }
158
+ }
159
+
160
+ &--supplementary {
161
+ .nsw-steps__item {
162
+ &::before {
163
+ border-color: var(--nsw-brand-supplementary);
164
+ }
165
+
166
+ &::after {
167
+ color: var(--nsw-brand-supplementary);
168
+ }
169
+
170
+ &--fill {
171
+ &::after {
172
+ color: var(--nsw-text-light);
173
+ }
174
+ }
175
+ }
176
+
177
+ .nsw-steps__content {
178
+ &::before {
179
+ background-color: var(--nsw-brand-supplementary);
180
+ }
181
+ }
182
+ }
183
+
184
+ &--counters {
185
+ .nsw-steps__item {
186
+ &::after {
187
+ visibility: visible;
188
+ }
189
+ }
190
+ }
191
+
192
+ &--fill {
193
+ .nsw-steps__item {
194
+ &::before {
195
+ background-color: var(--nsw-brand-accent);
196
+ }
197
+
198
+ &::after {
199
+ color: var(--nsw-text-light);
200
+ }
201
+ }
202
+
203
+ &.nsw-steps--dark {
204
+ .nsw-steps__item {
205
+ &::before {
206
+ background-color: var(--nsw-brand-dark);
207
+ }
208
+ }
209
+ }
210
+
211
+ &.nsw-steps--light {
212
+ .nsw-steps__item {
213
+ &::before {
214
+ background-color: var(--nsw-brand-light);
215
+ }
216
+
217
+ &::after {
218
+ color: var(--nsw-text-dark);
219
+ }
220
+ }
221
+ }
222
+
223
+ &.nsw-steps--supplementary {
224
+ .nsw-steps__item {
225
+ &::before {
226
+ background-color: var(--nsw-brand-supplementary);
227
+ }
228
+ }
229
+ }
230
+ }
231
+
232
+ &--medium {
233
+ .nsw-steps__item {
234
+ &::before {
235
+ top: rem(-2px);
236
+
237
+ @include breakpoint('lg') {
238
+ width: rem(40px);
239
+ height: rem(40px);
240
+ top: rem(-4px);
241
+ }
242
+ }
243
+
244
+ &::after {
245
+ top: rem(-2px);
246
+
247
+ @include breakpoint('lg') {
248
+ font-size: var(--nsw-font-size-md-mobile);
249
+ width: rem(40px);
250
+ height: rem(40px);
251
+ top: rem(-4px);
252
+ }
253
+ }
254
+ }
255
+
256
+ .nsw-steps__content {
257
+ @include breakpoint('lg') {
258
+ padding-left: rem(64px);
259
+ }
260
+
261
+ &::before {
262
+ top: rem(30px);
263
+ bottom: rem(2px);
264
+
265
+ @include breakpoint('lg') {
266
+ top: rem(36px);
267
+ bottom: rem(4px);
268
+ left: rem(18px);
269
+ }
270
+ }
271
+ }
272
+ }
273
+
274
+ &--small {
275
+ .nsw-steps__item {
276
+ &::before {
277
+ top: rem(-4px);
278
+
279
+ @include breakpoint('lg') {
280
+ width: rem(32px);
281
+ height: rem(32px);
282
+ top: rem(-2px);
283
+ }
284
+ }
285
+
286
+ &::after {
287
+ top: rem(-4px);
288
+
289
+ @include breakpoint('lg') {
290
+ font-size: var(--nsw-font-size-md-mobile);
291
+ width: rem(32px);
292
+ height: rem(32px);
293
+ top: rem(-2px);
294
+ }
295
+ }
296
+ }
297
+
298
+ .nsw-steps__content {
299
+ @include breakpoint('lg') {
300
+ padding-left: rem(56px);
301
+ }
302
+
303
+ &::before {
304
+ top: rem(28px);
305
+ bottom: rem(4px);
306
+
307
+ @include breakpoint('lg') {
308
+ top: rem(30px);
309
+ bottom: rem(2px);
310
+ left: rem(14px);
311
+ }
312
+ }
313
+ }
314
+ }
315
+ }
@@ -35,6 +35,10 @@ $nsw-vertical-align: (
35
35
 
36
36
  tbody tr:nth-of-type(even) {
37
37
  background-color: var(--nsw-off-white);
38
+
39
+ .nsw-section--invert & {
40
+ background-color: var(--nsw-text-hover-light);
41
+ }
38
42
  }
39
43
  }
40
44
 
@@ -52,8 +52,16 @@
52
52
  left: 0;
53
53
  width: 100%;
54
54
  height: 0;
55
- border-bottom: solid 4px var(--nsw-brand-accent);
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
  }
@@ -62,7 +62,7 @@ blockquote {
62
62
  margin-left: 0;
63
63
  margin-right: 0;
64
64
  margin-bottom: 0;
65
- border-left: solid 6px var(--nsw-brand-accent);
65
+ border-left: solid 2px var(--nsw-brand-accent);
66
66
  padding: rem(20px) rem(24px);
67
67
 
68
68
  @include breakpoint('md') {
@@ -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 {
@@ -264,3 +276,61 @@ a {
264
276
  padding-top: rem($grid-gutters*2);
265
277
  }
266
278
  }
279
+
280
+ :root {
281
+ --nsw-font-size-xxs: var(--nsw-font-size-xxs-mobile);
282
+ --nsw-font-height-xxs: var(--nsw-font-height-xxs-mobile);
283
+
284
+ @include breakpoint($nsw-font-size-reponsive-breakpoint) {
285
+ --nsw-font-size-xxs: var(--nsw-font-size-xxs-desktop);
286
+ --nsw-font-height-xxs: var(--nsw-font-height-xxs-desktop);
287
+ }
288
+
289
+ --nsw-font-size-xs: var(--nsw-font-size-xs-mobile);
290
+ --nsw-font-height-xs: var(--nsw-font-height-xs-mobile);
291
+
292
+ @include breakpoint($nsw-font-size-reponsive-breakpoint) {
293
+ --nsw-font-size-xs: var(--nsw-font-size-xs-desktop);
294
+ --nsw-font-height-xs: var(--nsw-font-height-xs-desktop);
295
+ }
296
+
297
+ --nsw-font-size-sm: var(--nsw-font-size-sm-mobile);
298
+ --nsw-font-height-sm: var(--nsw-font-height-sm-mobile);
299
+
300
+ @include breakpoint($nsw-font-size-reponsive-breakpoint) {
301
+ --nsw-font-size-sm: var(--nsw-font-size-sm-desktop);
302
+ --nsw-font-height-sm: var(--nsw-font-height-sm-desktop);
303
+ }
304
+
305
+ --nsw-font-size-md: var(--nsw-font-size-md-mobile);
306
+ --nsw-font-height-md: var(--nsw-font-height-md-mobile);
307
+
308
+ @include breakpoint($nsw-font-size-reponsive-breakpoint) {
309
+ --nsw-font-size-md: var(--nsw-font-size-md-desktop);
310
+ --nsw-font-height-md: var(--nsw-font-height-md-desktop);
311
+ }
312
+
313
+ --nsw-font-size-lg: var(--nsw-font-size-lg-mobile);
314
+ --nsw-font-height-lg: var(--nsw-font-height-lg-mobile);
315
+
316
+ @include breakpoint($nsw-font-size-reponsive-breakpoint) {
317
+ --nsw-font-size-lg: var(--nsw-font-size-lg-desktop);
318
+ --nsw-font-height-lg: var(--nsw-font-height-lg-desktop);
319
+ }
320
+
321
+ --nsw-font-size-xl: var(--nsw-font-size-xl-mobile);
322
+ --nsw-font-height-xl: var(--nsw-font-height-xl-mobile);
323
+
324
+ @include breakpoint($nsw-font-size-reponsive-breakpoint) {
325
+ --nsw-font-size-xl: var(--nsw-font-size-xl-desktop);
326
+ --nsw-font-height-xl: var(--nsw-font-height-xl-desktop);
327
+ }
328
+
329
+ --nsw-font-size-xxl: var(--nsw-font-size-xxl-mobile);
330
+ --nsw-font-height-xxl: var(--nsw-font-height-xxl-mobile);
331
+
332
+ @include breakpoint($nsw-font-size-reponsive-breakpoint) {
333
+ --nsw-font-size-xxl: var(--nsw-font-size-xxl-desktop);
334
+ --nsw-font-height-xxl: var(--nsw-font-height-xxl-desktop);
335
+ }
336
+ }
@@ -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
+ }
@@ -32,7 +32,7 @@
32
32
  --nsw-palette-red-01: #630019;
33
33
  --nsw-palette-red-02: #d7153a;
34
34
  --nsw-palette-red-03: #ffb8c1;
35
- --nsw-palette-red-04: #f3e2e6;
35
+ --nsw-palette-red-04: #ffe6ea;
36
36
 
37
37
  --nsw-palette-orange-01: #941b00;
38
38
  --nsw-palette-orange-02: #f3631b;
@@ -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.scss CHANGED
@@ -31,6 +31,7 @@
31
31
  @import 'components/progress-indicator/progress-indicator';
32
32
  @import 'components/results-bar/results-bar';
33
33
  @import 'components/side-nav/side-nav';
34
+ @import 'components/steps/steps';
34
35
  @import 'components/table/table';
35
36
  @import 'components/tabs/tabs';
36
37
  @import 'components/tag/tag';