nsw-design-system 2.13.0 → 3.0.2

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 (95) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +50 -20
  3. package/dist/css/core.css +2 -0
  4. package/dist/css/main.css +1 -1
  5. package/dist/js/main.js +208 -124
  6. package/package.json +4 -2
  7. package/src/components/_all.scss +27 -0
  8. package/src/components/accordion/_accordion.scss +68 -30
  9. package/src/components/accordion/accordion.js +61 -14
  10. package/src/components/breadcrumbs/_breadcrumbs.scss +34 -43
  11. package/src/components/button/_button.scss +171 -27
  12. package/src/components/callout/_callout.scss +13 -57
  13. package/src/components/card/_card.scss +222 -71
  14. package/src/components/content-block/_content-block.scss +16 -45
  15. package/src/components/filters/_filters.scss +25 -85
  16. package/src/components/filters/filters.js +0 -5
  17. package/src/components/footer/_footer.scss +80 -132
  18. package/src/components/{forms/_forms.scss → form/_form.scss} +122 -75
  19. package/src/components/global-alert/_global-alert.scss +68 -0
  20. package/src/components/{site-wide-message/site-wide-message.js → global-alert/global-alert.js} +3 -3
  21. package/src/components/header/_header.scss +196 -227
  22. package/src/components/hero-banner/_hero-banner.scss +152 -86
  23. package/src/components/hero-search/_hero-search.scss +26 -38
  24. package/src/components/in-page-alert/_in-page-alert.scss +54 -0
  25. package/src/components/in-page-nav/_in-page-nav.scss +22 -0
  26. package/src/components/link-list/_link-list.scss +28 -47
  27. package/src/components/list-item/_list-item.scss +31 -43
  28. package/src/components/main-nav/_main-nav.scss +272 -0
  29. package/src/components/{main-navigation/main-navigation.js → main-nav/main-nav.js} +40 -39
  30. package/src/components/masthead/_masthead.scss +61 -0
  31. package/src/components/media/_media.scss +14 -2
  32. package/src/components/pagination/_pagination.scss +37 -41
  33. package/src/components/progress-indicator/_progress-indicator.scss +11 -11
  34. package/src/components/side-nav/_side-nav.scss +73 -0
  35. package/src/components/table/_table.scss +56 -0
  36. package/src/components/tables/_tables.scss +0 -71
  37. package/src/components/tabs/_tabs.scss +79 -0
  38. package/src/components/{tab-navigation/tab-navigation.js → tabs/tabs.js} +9 -9
  39. package/src/components/tag/_tag.scss +60 -0
  40. package/src/core/_all.scss +6 -0
  41. package/src/core/grid/_grid.scss +117 -0
  42. package/src/core/iconography/_icon.scss +83 -0
  43. package/src/core/layout/_layout.scss +42 -0
  44. package/src/core/section/_section.scss +95 -0
  45. package/src/{global/scss/helpers → core/spacing}/_spacing.scss +27 -4
  46. package/src/core/typography/_typography.scss +266 -0
  47. package/src/global/scss/base/_all.scss +4 -0
  48. package/src/global/scss/base/_functions.scss +44 -0
  49. package/src/global/scss/{style/_base.scss → base/_global.scss} +1 -2
  50. package/src/global/scss/base/_mixins.scss +241 -0
  51. package/src/global/scss/{tools → base}/_print.scss +3 -3
  52. package/src/global/scss/helpers/_all.scss +4 -3
  53. package/src/global/scss/helpers/_colour.scss +86 -0
  54. package/src/global/scss/helpers/_list.scss +21 -0
  55. package/src/global/scss/helpers/_text.scss +9 -0
  56. package/src/global/scss/helpers/_visibility.scss +31 -0
  57. package/src/global/scss/settings/_palette.scss +69 -0
  58. package/src/global/scss/settings/_settings.scss +12 -296
  59. package/src/global/scss/settings/_theme.scss +82 -0
  60. package/src/main.js +8 -11
  61. package/src/main.scss +17 -21
  62. package/dist/assets/svg/sprite.svg +0 -1
  63. package/src/components/banner/_banner.scss +0 -170
  64. package/src/components/direction-links/_direction-links.scss +0 -62
  65. package/src/components/feature-tile/_feature-tile.scss +0 -175
  66. package/src/components/forms/_forms-prev.scss +0 -357
  67. package/src/components/in-page-navigation/_in-page-navigation.scss +0 -26
  68. package/src/components/main-navigation/_main-navigation.scss +0 -405
  69. package/src/components/notification/_notification.scss +0 -69
  70. package/src/components/side-navigation/_side-navigation.scss +0 -85
  71. package/src/components/site-wide-message/_site-wide-message.scss +0 -148
  72. package/src/components/social-bar/_social-bar.scss +0 -27
  73. package/src/components/social-bar/social-bar.js +0 -24
  74. package/src/components/tab-navigation/_tab-navigation.scss +0 -69
  75. package/src/components/tags/_tags.scss +0 -65
  76. package/src/global/scss/helpers/_section.scss +0 -50
  77. package/src/global/scss/helpers/_sr-only.scss +0 -8
  78. package/src/global/scss/style/_all.scss +0 -4
  79. package/src/global/scss/style/_docs.scss +0 -538
  80. package/src/global/scss/style/_grid.scss +0 -171
  81. package/src/global/scss/style/_icons.scss +0 -68
  82. package/src/global/scss/tools/_all.scss +0 -10
  83. package/src/global/scss/tools/_breakpoint.scss +0 -16
  84. package/src/global/scss/tools/_buttons.scss +0 -15
  85. package/src/global/scss/tools/_focus.scss +0 -26
  86. package/src/global/scss/tools/_general.scss +0 -189
  87. package/src/global/scss/tools/_grid.scss +0 -129
  88. package/src/global/scss/tools/_links.scss +0 -18
  89. package/src/global/scss/tools/_spacing.scss +0 -37
  90. package/src/global/scss/tools/_sr-only.scss +0 -21
  91. package/src/global/scss/tools/_typography.scss +0 -90
  92. package/src/styles/grid/_grid.scss +0 -0
  93. package/src/styles/iconography/_iconography.scss +0 -0
  94. package/src/styles/layout/_layout.scss +0 -0
  95. package/src/styles/typography/_typography.scss +0 -219
@@ -0,0 +1,68 @@
1
+ .nsw-global-alert {
2
+ padding: rem(24px) 0;
3
+ background-color: var(--nsw-status-info);
4
+ color: var(--nsw-text-light);
5
+
6
+ .nsw-icon-button {
7
+ position: absolute;
8
+ top: rem(-8px);
9
+ right: rem(4px);
10
+ color: var(--nsw-text-light);
11
+
12
+ &:hover {
13
+ @include nsw-hover;
14
+ background-color: var(--nsw-text-hover-light);
15
+ }
16
+
17
+ &:focus {
18
+ @include nsw-focus($color: var(--nsw-text-light));
19
+ }
20
+ }
21
+
22
+ &__wrapper {
23
+ @include container;
24
+ position: relative;
25
+ }
26
+
27
+ &__title {
28
+ @include font-size('md');
29
+ font-weight: var(--nsw-font-bold);
30
+ }
31
+
32
+ &__content {
33
+ margin-right: rem(36px);
34
+
35
+ a {
36
+ @include link-light;
37
+ }
38
+ }
39
+
40
+ .nsw-button {
41
+ margin-right: 0;
42
+ }
43
+
44
+ &--critical {
45
+ background-color: var(--nsw-status-error);
46
+ }
47
+
48
+ &--light {
49
+ background-color: var(--nsw-status-info-bg);
50
+ color: var(--nsw-text-dark);
51
+
52
+ .nsw-global-alert__content a {
53
+ @include link-dark;
54
+ }
55
+
56
+ .nsw-icon-button {
57
+ color: var(--nsw-brand-dark);
58
+
59
+ &:hover {
60
+ background-color: var(--nsw-text-hover);
61
+ }
62
+
63
+ &:focus {
64
+ outline-color: var(--nsw-focus);
65
+ }
66
+ }
67
+ }
68
+ }
@@ -1,7 +1,7 @@
1
- class SitewideMessage {
1
+ class GlobalAlert {
2
2
  constructor(element) {
3
3
  this.messageElement = element
4
- this.closeButton = element.querySelector('.nsw-sitewide-message__close')
4
+ this.closeButton = element.querySelector('.js-close-alert')
5
5
  this.closeMessageEvent = (e) => this.closeMessage(e)
6
6
  }
7
7
 
@@ -18,4 +18,4 @@ class SitewideMessage {
18
18
  }
19
19
  }
20
20
 
21
- export default SitewideMessage
21
+ export default GlobalAlert
@@ -1,65 +1,15 @@
1
- .nsw-skipto {
2
- @include font-stack;
3
- position: absolute;
4
- top: 0;
5
- left: 0;
6
- width: 100%;
7
-
8
- &__link {
9
- @include nsw-spacing(padding, xs md);
10
- @include z-index('middle');
11
- background-color: $nsw-primary-blue;
12
- color: $white;
13
- transform: translateY(-101%);
14
- display: block;
15
- text-align: center;
16
- width: 100%;
17
- position: absolute;
18
- top: 0;
19
- left: 0;
20
- text-decoration: none;
21
-
22
- &:focus,
23
- &:active {
24
- transform: translateY(0);
25
- outline: none;
26
-
27
- span {
28
- @include nsw-focus($color: $white);
29
- }
30
- }
31
-
32
- @include breakpoint('lg') {
33
- text-align: left;
34
- }
35
- }
36
- }
37
-
38
- .nsw-infobar,
39
- .nsw-masthead {
40
- @include font-stack;
41
- @include nsw-spacing(padding, sm none);
42
- background-color: $nsw-primary-blue;
43
- color: $white;
44
-
45
- p {
46
- margin: 0;
47
- font-size: rem(12px);
48
- }
49
- }
50
-
51
1
  .nsw-header {
52
- background-color: $white;
2
+ background-color: var(--nsw-white);
53
3
  position: relative;
54
- border-bottom: solid 1px $light20;
4
+ border-bottom: solid 1px var(--nsw-grey-04);
55
5
 
56
- @include breakpoint('lg') {
6
+ @include breakpoint($nsw-desktop-breakpoint) {
57
7
  border-bottom: 0;
58
8
  }
59
9
 
60
10
  &--simple {
61
- @include breakpoint('lg') {
62
- border-bottom: solid 1px $light40;
11
+ @include breakpoint($nsw-desktop-breakpoint) {
12
+ border-bottom: solid 1px var(--nsw-grey-04);
63
13
  }
64
14
  }
65
15
 
@@ -68,240 +18,259 @@
68
18
  position: relative;
69
19
  }
70
20
 
71
- &__wrapper {
72
- @include nsw-spacing(padding, sm none);
73
- display: flex;
74
- flex-direction: row;
75
- justify-content: space-between;
76
- align-content: center;
77
- align-items: center;
78
- height: rem(72px);
21
+ &__inner {
22
+ position: relative;
79
23
 
80
- @include breakpoint('lg') {
81
- justify-content: unset;
82
- height: rem(94px);
24
+ @include breakpoint($nsw-desktop-breakpoint) {
25
+ display: flex;
83
26
  }
84
27
  }
85
28
 
86
- &__center {
87
- order: 2;
29
+ &__menu,
30
+ &__search {
31
+ button {
32
+ @include font-size('xxs');
33
+ font-weight: var(--nsw-font-bold);
34
+ border-radius: var(--nsw-border-radius);
35
+ color: var(--nsw-brand-dark);
36
+ width: rem(48px);
37
+ height: rem(48px);
38
+ background: none;
39
+ border: 0;
40
+ padding: 0;
41
+ text-align: center;
42
+ position: relative;
43
+ display: flex;
44
+ flex-direction: column;
45
+ align-items: center;
46
+ justify-content: center;
47
+
48
+ &:hover {
49
+ @include nsw-hover;
50
+ }
88
51
 
89
- @include breakpoint('lg') {
90
- order: 0;
52
+ &:focus {
53
+ @include nsw-focus;
54
+ }
55
+
56
+ .nsw-material-icons {
57
+ font-size: rem(map-get($nsw-icon-sizes, 24));
58
+ }
91
59
  }
92
- }
93
60
 
94
- &__left {
95
- order: 1;
96
- margin-left: rem(-6px);
97
61
  }
98
62
 
99
- &__right {
100
- order: 3;
101
- margin-right: rem(-4px);
63
+ &__menu {
64
+ position: absolute;
65
+ top: rem(12px);
66
+ left: rem(-6px);
102
67
 
103
- @include breakpoint('lg') {
104
- margin-left: auto;
105
- margin-right: 0;
68
+ button {
69
+ @include breakpoint($nsw-desktop-breakpoint) {
70
+ display: none;
71
+ }
106
72
  }
107
73
  }
108
74
 
109
- &__logo-link {
110
- display: block;
75
+ &__search {
76
+ position: absolute;
77
+ top: rem(12px);
78
+ right: rem(-4px);
111
79
 
112
- &:focus {
113
- @include nsw-focus;
80
+ @include breakpoint($nsw-desktop-breakpoint) {
81
+ right: 0;
82
+ top: 50%;
83
+ margin-top: rem(-24px);
114
84
  }
115
85
 
116
- .nsw-header__logo {
117
- width: rem(141px);
118
- height: rem(46px);
86
+ button {
87
+ @include breakpoint($nsw-desktop-breakpoint) {
88
+ > span:last-child {
89
+ @include sr-only;
90
+ }
119
91
 
120
- @include breakpoint('lg') {
121
- width: rem(168px);
122
- height: rem(55px);
92
+ .nsw-material-icons {
93
+ font-size: rem(map-get($nsw-icon-sizes, 36));
94
+ }
123
95
  }
124
96
  }
125
97
  }
126
98
 
127
- &__logo-image {
99
+ &__main {
100
+ @include breakpoint($nsw-desktop-breakpoint) {
101
+ position: relative;
102
+ display: flex;
103
+ justify-content: flex-start;
104
+ align-items: center;
105
+ margin: rem(12px) rem(72px) rem(12px) 0;
106
+
107
+ &:focus-within {
108
+ @include nsw-focus;
109
+ }
110
+ }
111
+ }
112
+
113
+ &__waratah {
114
+ padding: rem(12px) rem(48px);
128
115
  display: flex;
116
+ justify-content: center;
117
+
118
+ @include breakpoint($nsw-desktop-breakpoint) {
119
+ padding: 0;
120
+ }
129
121
 
130
122
  svg {
123
+ height: rem(48px);
131
124
  display: block;
125
+
126
+ @include breakpoint($nsw-desktop-breakpoint) {
127
+ height: rem(76px);
128
+ }
132
129
  }
133
- }
134
- }
135
130
 
136
- .nsw-header-btn {
137
- @include border-radius;
138
- color: $nsw-primary-blue;
139
- width: rem(48px);
140
- height: rem(48px);
141
- background: none;
142
- border: 0;
143
- padding: 0;
144
- text-align: center;
145
- position: relative;
146
- display: flex;
147
- flex-direction: column;
148
- align-items: center;
149
- justify-content: center;
131
+ a {
132
+ display: flex;
133
+ color: var(--nsw-brand-dark);
134
+ text-decoration: none;
135
+ align-items: center;
150
136
 
151
- &:hover {
152
- @include nsw-hover;
153
- }
137
+ &:hover {
138
+ background: transparent;
139
+ outline-width: 0;
140
+ }
154
141
 
155
- &:focus {
156
- @include nsw-focus;
157
- }
142
+ &:focus {
143
+ outline-width: 3px;
158
144
 
159
- &__icon {
160
- position: relative;
161
- font-size: rem(22px);
162
- line-height: rem(18px);
163
- top: -1px;
164
-
165
- &.nsw-icon {
166
- height: rem(16px);
167
- width: rem(16px);
168
- margin: 1px 0;
169
- }
170
- }
145
+ @include breakpoint($nsw-desktop-breakpoint) {
146
+ outline: none;
147
+ }
148
+ }
171
149
 
172
- &__sub {
173
- @include font-stack('heading');
174
- font-size: rem(12px);
175
- }
176
- }
150
+ @include breakpoint($nsw-desktop-breakpoint) {
151
+ @include pseudo-clickable-block;
152
+ }
177
153
 
178
- .nsw-header-btn--menu {
179
- @include breakpoint('lg') {
180
- display: none;
181
- }
182
- }
154
+ svg:not(:first-child) {
155
+ margin-left: rem(24px);
183
156
 
184
- .nsw-header-btn--search {
185
- @include breakpoint('lg') {
186
- .nsw-header-btn__sub {
187
- @include sr-only;
157
+ @include breakpoint($nsw-desktop-breakpoint) {
158
+ margin-left: rem(48px);
159
+ }
160
+ }
188
161
  }
162
+ }
189
163
 
190
- .nsw-header-btn__icon {
191
- font-size: rem(34px);
164
+ &__name {
165
+ padding: rem(12px) 0;
166
+ color: var(--nsw-brand-dark);
192
167
 
193
- &.nsw-icon {
194
- width: rem(24px);
195
- height: rem(24px);
196
- margin-bottom: 0;
197
- }
168
+ @include breakpoint($nsw-desktop-breakpoint) {
169
+ padding: 0;
170
+ margin-left: rem(32px);
198
171
  }
199
172
  }
200
- }
201
173
 
202
- .nsw-search {
203
- &__area {
204
- @include break-out(absolute);
205
- background: $light10;
206
- top: 0;
174
+ &__title {
175
+ @include font-size('lg');
176
+ font-weight: var(--nsw-font-bold);
177
+ color: var(--nsw-brand-dark);
178
+ display: flex;
179
+ align-items: center;
207
180
 
208
- @include breakpoint('lg') {
209
- @include break-out-reset;
210
- position: absolute;
211
- width: rem(394px);
212
- right: rem(16px);
213
- top: 50%;
214
- transform: translateY(-50%);
181
+ .nsw-tag {
182
+ margin-left: rem(24px);
215
183
  }
216
184
  }
217
185
 
218
- &__input {
219
- @include font-stack;
220
- @include font-size('md');
221
- background: none;
222
- padding: rem(8px) rem(72px) rem(8px) rem(16px);
223
- color: $dark80;
224
- width: 100%;
225
- appearance: none;
226
- border: 0;
227
- height: rem(72px);
228
-
229
- &:focus {
230
- @include nsw-focus($offset: false);
186
+ &__description {
187
+ @include font-size('xs');
188
+ color: var(--nsw-brand-dark);
189
+ }
190
+
191
+ &__logo {
192
+ display: flex;
193
+ justify-content: center;
194
+
195
+ @include breakpoint($nsw-desktop-breakpoint) {
196
+ padding-left: rem(16px);
197
+ justify-content: flex-start;
231
198
  }
232
199
 
233
- @include breakpoint('lg') {
234
- @include nsw-spacing(padding, none md);
235
- @include border-radius;
236
- height: rem(50px);
237
- padding: 0 rem(16px);
200
+ svg {
201
+ height: rem(48px);
202
+ display: block;
203
+
204
+ @include breakpoint($nsw-desktop-breakpoint) {
205
+ height: rem(76px);
206
+ }
238
207
  }
239
208
  }
240
-
241
- &__submit {
209
+
210
+ &__search-area {
242
211
  position: absolute;
243
212
  top: 0;
213
+ left: 0;
244
214
  right: 0;
245
- height: rem(50px);
246
- width: rem(50px);
247
- border: 0;
248
- appearance: none;
249
- background: none;
250
- cursor: pointer;
251
- }
252
215
 
253
- &__search-icon {
254
- position: absolute;
255
- top: 50%;
256
- transform: translateY(-50%);
257
- font-size: rem(34px);
258
- right: rem(7px);
259
- margin-top: -1px;
260
- display: none;
261
-
262
- @include breakpoint('lg') {
263
- display: inline-block;
216
+ @include breakpoint($nsw-desktop-breakpoint) {
217
+ width: rem(394px);
218
+ left: auto;
219
+ right: rem(16px);
220
+ top: 50%;
221
+ transform: translateY(-50%);
264
222
  }
265
223
 
266
- &.nsw-icon {
267
- width: rem(24px);
268
- height: rem(24px);
269
- right: rem(12px);
270
- margin-top: 0;
224
+ button {
225
+ position: absolute;
226
+ right: 0;
227
+ top: 0;
228
+ bottom: 0;
271
229
  }
272
- }
273
230
 
274
- &__close-btn {
275
- width: rem(48px);
276
- height: rem(48px);
277
- background: none;
278
- border: 0;
279
- padding: 0;
280
- text-align: center;
281
- position: absolute;
282
- top: 50%;
283
- transform: translateY(-50%);
284
- right: rem(16px);
231
+ > button {
232
+ border-radius: 0;
285
233
 
286
- &:hover {
287
- @include nsw-hover;
234
+ @include breakpoint($nsw-desktop-breakpoint) {
235
+ display: none;
236
+ }
288
237
  }
289
238
 
290
- &:focus {
291
- @include nsw-focus;
292
- }
239
+ form {
240
+ button {
241
+ display: none;
242
+ padding: 0;
243
+ width: rem(48px);
293
244
 
294
- @include breakpoint('lg') {
295
- display: none;
245
+ @include breakpoint($nsw-desktop-breakpoint) {
246
+ display: flex;
247
+ }
248
+ }
249
+
250
+ .nsw-material-icons {
251
+ font-size: rem(map-get($nsw-icon-sizes, 36));
252
+ }
296
253
  }
297
- }
298
254
 
299
- &__close-icon {
300
- font-size: rem(40px);
255
+ input {
256
+ @include font-size('md');
257
+ background: var(--nsw-off-white);
258
+ padding: rem(8px) rem(72px) rem(8px) rem(16px);
259
+ color: var(--nsw-text-dark);
260
+ width: 100%;
261
+ appearance: none;
262
+ border: 0;
263
+ height: rem(72px);
264
+
265
+ &:focus {
266
+ @include nsw-focus($offset: false);
267
+ }
301
268
 
302
- &.nsw-icon {
303
- width: rem(24px);
304
- height: rem(24px);
269
+ @include breakpoint($nsw-desktop-breakpoint) {
270
+ border-radius: var(--nsw-border-radius);
271
+ height: rem(48px);
272
+ padding: 0 rem(16px);
273
+ }
305
274
  }
306
275
  }
307
276
  }