nsw-design-system 3.2.4 → 3.3.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.
@@ -1,38 +1,107 @@
1
+ import { uniqueId } from '../../global/scripts/helpers/utilities'
2
+
1
3
  class Filters {
2
4
  constructor(element) {
3
5
  this.filters = element
6
+ this.filtersWrapper = element.querySelector('.nsw-filters__wrapper')
4
7
  this.openButton = element.querySelector('.nsw-filters__controls button')
5
- this.closeButtons = element.querySelectorAll('.nsw-filters__back button')
6
- this.all = element.querySelectorAll('.nsw-filters__all')
7
- this.allBlocks = Array.prototype.slice.call(this.all)
8
+ this.openButtonIcons = this.openButton ? this.openButton.querySelectorAll('span') : null
9
+ this.selectedCount = element.querySelector('.js-filters--count')
10
+ this.openButtonText = this.selectedCount ? this.selectedCount.querySelector('span:not(.nsw-material-icons)') : null
11
+ this.buttonLabel = this.openButtonText ? this.openButtonText.innerText : null
12
+ this.closeButton = element.querySelector('.nsw-filters__back button')
13
+ this.acceptButton = element.querySelector('.nsw-filters__accept button')
14
+ this.clearButton = element.querySelector('.nsw-filters__cancel button')
8
15
  this.showMoreButtons = Array.prototype.slice.call(element.querySelectorAll('.nsw-filters__more'))
16
+ this.accordionButtons = element.querySelectorAll('.nsw-filters__item-button')
17
+ this.showAll = element.querySelectorAll('.nsw-filters__all')
18
+ this.showAllBlocks = Array.prototype.slice.call(this.showAll)
19
+ this.filtersItems = element.querySelectorAll('.nsw-filters__item')
20
+ /* eslint-disable max-len */
21
+ this.focusableEls = this.filtersWrapper.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])')
22
+ this.checkIcon = '<span class="material-icons nsw-material-icons" focusable="false" aria-hidden="true">check_circle</span>'
23
+ this.arrowIcon = '<span class="material-icons nsw-material-icons" focusable="false" aria-hidden="true">keyboard_arrow_right</span>'
24
+ /* eslint-ensable max-len */
9
25
  this.showEvent = (e) => this.showFilters(e)
10
26
  this.hideEvent = (e) => this.hideFilters(e)
11
27
  this.showMoreEvent = (e) => this.showMore(e)
28
+ this.toggleEvent = (e) => this.toggleAccordion(e)
29
+ this.resetEvent = (e) => this.clearAllFilters(e)
12
30
  this.body = document.body
31
+ this.buttons = []
32
+ this.content = []
33
+ this.selected = []
13
34
  }
14
35
 
15
36
  init() {
37
+ this.setUpDom()
16
38
  this.controls()
39
+ this.selectedItems()
17
40
  }
18
41
 
19
- controls() {
20
- this.openButton.addEventListener('click', this.showEvent, false)
42
+ setUpDom() {
43
+ this.filters.classList.add('ready')
44
+
45
+ if (this.openButton) {
46
+ if (this.openButtonIcons.length < 3) {
47
+ this.openButton.insertAdjacentHTML('beforeend', this.arrowIcon)
48
+ }
49
+ }
50
+
51
+ this.accordionButtons.forEach((button) => {
52
+ const buttonElem = button
53
+ const uID = uniqueId('collapsed')
54
+ buttonElem.setAttribute('type', 'button')
55
+ buttonElem.setAttribute('aria-expanded', 'false')
56
+ buttonElem.setAttribute('aria-controls', uID)
21
57
 
22
- this.closeButtons.forEach((element) => {
23
- element.addEventListener('click', this.hideEvent, false)
58
+ const contentElem = buttonElem.nextElementSibling
59
+ contentElem.id = buttonElem.getAttribute('aria-controls')
60
+ contentElem.hidden = true
61
+
62
+ this.content.push(contentElem)
63
+ this.buttons.push(buttonElem)
24
64
  })
65
+ }
66
+
67
+ controls() {
68
+ if (this.openButton) {
69
+ this.openButton.addEventListener('click', this.showEvent, false)
70
+ }
25
71
 
26
- this.all.forEach((element) => {
72
+ if (this.acceptButton) {
73
+ this.acceptButton.disabled = true
74
+ }
75
+
76
+ if (this.closeButton) {
77
+ this.closeButton.addEventListener('click', this.hideEvent, false)
78
+ }
79
+
80
+ this.showAll.forEach((element) => {
27
81
  const showMoreButton = element.nextElementSibling
28
82
  showMoreButton.addEventListener('click', this.showMoreEvent, false)
29
83
  })
84
+
85
+ if (this.buttons) {
86
+ this.buttons.forEach((element) => {
87
+ element.addEventListener('click', this.toggleEvent, false)
88
+ })
89
+ }
90
+
91
+ if (this.clearButton) {
92
+ this.clearButton.addEventListener('click', this.resetEvent, false)
93
+ }
30
94
  }
31
95
 
32
96
  showFilters(e) {
33
97
  e.preventDefault()
34
- this.filters.classList.add('active')
35
- this.body.classList.add('filters-open')
98
+ if (this.filters.classList.contains('nsw-filters--down')) {
99
+ this.filters.classList.toggle('active')
100
+ } else {
101
+ this.trapFocus(this.filtersWrapper)
102
+ this.filters.classList.add('active')
103
+ this.body.classList.add('filters-open')
104
+ }
36
105
  }
37
106
 
38
107
  hideFilters(e) {
@@ -45,10 +114,249 @@ class Filters {
45
114
  e.preventDefault()
46
115
  const currentShowMore = e.target
47
116
  const currentIndex = this.showMoreButtons.indexOf(currentShowMore)
48
- const currentAll = this.allBlocks[currentIndex]
117
+ const currentAll = this.showAllBlocks[currentIndex]
49
118
  currentAll.classList.remove('hidden')
50
119
  currentShowMore.classList.add('hidden')
51
120
  }
121
+
122
+ getTargetContent(element) {
123
+ const currentIndex = this.buttons.indexOf(element)
124
+ return this.content[currentIndex]
125
+ }
126
+
127
+ setAccordionState(element, state) {
128
+ const targetContent = this.getTargetContent(element)
129
+
130
+ if (state === 'open') {
131
+ element.classList.add('active')
132
+ element.setAttribute('aria-expanded', 'true')
133
+ targetContent.hidden = false
134
+ } else if (state === 'close') {
135
+ element.classList.remove('active')
136
+ element.setAttribute('aria-expanded', 'false')
137
+ targetContent.hidden = true
138
+ }
139
+ }
140
+
141
+ toggleAccordion(e) {
142
+ const { currentTarget } = e
143
+ const targetContent = this.getTargetContent(currentTarget)
144
+ const isHidden = targetContent.hidden
145
+
146
+ if ((isHidden)) {
147
+ this.setAccordionState(currentTarget, 'open')
148
+ } else {
149
+ this.setAccordionState(currentTarget, 'close')
150
+ }
151
+ }
152
+
153
+ trapFocus(element) {
154
+ const firstFocusableEl = this.focusableEls[0]
155
+ const lastFocusableEl = this.focusableEls[this.focusableEls.length - 1]
156
+ const KEYCODE_TAB = 9
157
+
158
+ element.addEventListener('keydown', (e) => {
159
+ const isTabPressed = (e.key === 'Tab' || e.keyCode === KEYCODE_TAB)
160
+
161
+ if (!isTabPressed) { return }
162
+
163
+ if (e.shiftKey) {
164
+ if (document.activeElement === firstFocusableEl) {
165
+ e.preventDefault()
166
+ lastFocusableEl.focus()
167
+ }
168
+ } else if (document.activeElement === lastFocusableEl) {
169
+ e.preventDefault()
170
+ firstFocusableEl.focus()
171
+ }
172
+ })
173
+ }
174
+
175
+ toggleAccept(array) {
176
+ if (this.acceptButton) {
177
+ if (array.length > 0) {
178
+ this.acceptButton.disabled = false
179
+ } else {
180
+ this.acceptButton.disabled = true
181
+ }
182
+ }
183
+ }
184
+
185
+ toggleSelectedState(array) {
186
+ if (array.length > 0) {
187
+ this.openButton.parentElement.classList.add('active')
188
+ } else {
189
+ this.openButton.parentElement.classList.remove('active')
190
+ }
191
+ }
192
+
193
+ resultsCount(array, buttonText) {
194
+ if (this.openButtonText) {
195
+ if (array.length > 0) {
196
+ this.openButtonText.innerText = `${buttonText} (${array.length})`
197
+ } else {
198
+ this.openButtonText.innerText = `${buttonText}`
199
+ }
200
+ }
201
+ }
202
+
203
+ updateDom() {
204
+ this.resultsCount(this.selected, this.buttonLabel)
205
+ this.toggleAccept(this.selected)
206
+ this.toggleSelectedState(this.selected)
207
+ }
208
+
209
+ static getEventType(type) {
210
+ if (type === 'text') {
211
+ return 'input'
212
+ }
213
+ return 'change'
214
+ }
215
+
216
+ static getCondition(element) {
217
+ if (element.type === 'text' || element.type === 'select-one') {
218
+ return element.value !== ''
219
+ }
220
+ return element.checked
221
+ }
222
+
223
+ static singleCount(element, index, id) {
224
+ const isSingleCount = element.closest('.js-filters--single-count')
225
+ if (!isSingleCount) {
226
+ return { uniqueID: `${id}-${index}`, singleID: `${id}-${index}`, isSingleCount }
227
+ }
228
+ return { uniqueID: `${id}`, singleID: `${id}-${index}`, isSingleCount }
229
+ }
230
+
231
+ updateCount(options) {
232
+ const id = uniqueId()
233
+ const GroupArray = []
234
+ if (options.array.length > 0) {
235
+ options.array.forEach((element, index) => {
236
+ const getEventType = this.constructor.getEventType(element.type)
237
+ const { uniqueID, singleID, isSingleCount } = this.constructor.singleCount(element, index, id)
238
+
239
+ if (this.constructor.getCondition(element)) {
240
+ this.selected.push(uniqueID)
241
+ if (isSingleCount) {
242
+ GroupArray.push(singleID)
243
+ }
244
+ this.updateDom()
245
+ }
246
+ element.addEventListener(getEventType, () => {
247
+ const selectedIndex = this.selected.indexOf(uniqueID)
248
+ const singleSelectedIndex = GroupArray.indexOf(singleID)
249
+ if (this.constructor.getCondition(element)) {
250
+ if (!this.selected.includes(uniqueID)) {
251
+ this.selected.push(uniqueID)
252
+ }
253
+ if (isSingleCount && !GroupArray.includes(singleID)) {
254
+ GroupArray.push(singleID)
255
+ }
256
+ this.updateDom()
257
+ } else {
258
+ if (isSingleCount && singleSelectedIndex !== -1) {
259
+ GroupArray.splice(singleSelectedIndex, 1)
260
+ }
261
+ if (!isSingleCount && selectedIndex !== -1) {
262
+ this.selected.splice(selectedIndex, 1)
263
+ } else if (GroupArray.length <= 0) {
264
+ this.selected.splice(selectedIndex, 1)
265
+ }
266
+ this.updateDom()
267
+ }
268
+ })
269
+ })
270
+ }
271
+ }
272
+
273
+ updateStatus(options) {
274
+ const id = uniqueId()
275
+ const text = options.title
276
+ const GroupArray = []
277
+ if (options.array.length > 0) {
278
+ const labelText = (text) ? text.textContent : null
279
+ options.array.forEach((element, index) => {
280
+ const getEventType = this.constructor.getEventType(element.type)
281
+ const { singleID } = this.constructor.singleCount(element, index, id)
282
+ if (this.constructor.getCondition(element)) {
283
+ if (text) {
284
+ text.textContent = labelText
285
+ text.innerHTML = `${text.textContent} ${this.checkIcon}`
286
+ }
287
+ }
288
+ element.addEventListener(getEventType, () => {
289
+ if (this.constructor.getCondition(element)) {
290
+ if (!GroupArray.includes(singleID)) {
291
+ GroupArray.push(singleID)
292
+ }
293
+ } else if (GroupArray.indexOf(singleID) !== -1) {
294
+ GroupArray.splice(GroupArray.indexOf(singleID), 1)
295
+ }
296
+ if (text) {
297
+ if (GroupArray.length > 0) {
298
+ text.textContent = labelText
299
+ text.innerHTML = `${text.textContent} ${this.checkIcon}`
300
+ } else {
301
+ text.textContent = labelText
302
+ }
303
+ }
304
+ })
305
+ })
306
+ }
307
+ }
308
+
309
+ selectedItems() {
310
+ this.filtersItems.forEach((filter) => {
311
+ const button = filter.querySelector('.nsw-filters__item-name')
312
+ const content = filter.querySelector('.nsw-filters__item-content')
313
+ const text = content ? content.querySelectorAll('input[type="text"]') : null
314
+ const selects = content ? content.querySelectorAll('select') : null
315
+ const checkboxes = content ? content.querySelectorAll('input[type="checkbox"]') : null
316
+
317
+ if (!content) return
318
+
319
+ this.updateCount({ array: text, title: button })
320
+ this.updateCount({ array: selects, title: button })
321
+ this.updateCount({ array: checkboxes, title: button })
322
+ this.updateStatus({ array: text, title: button })
323
+ this.updateStatus({ array: selects, title: button })
324
+ this.updateStatus({ array: checkboxes, title: button })
325
+ })
326
+ }
327
+
328
+ clearAllFilters(e) {
329
+ e.preventDefault()
330
+ this.filtersItems.forEach((filter) => {
331
+ const button = filter.querySelector('.nsw-filters__item-name')
332
+ const buttonCheck = button ? button.querySelector('span.nsw-material-icons') : null
333
+ const content = filter.querySelector('.nsw-filters__item-content')
334
+ const text = content.querySelectorAll('input[type="text"]')
335
+ const selects = content.querySelectorAll('select')
336
+ const checkboxes = content.querySelectorAll('input[type="checkbox"]')
337
+ const allFields = [...text, ...selects, ...checkboxes]
338
+
339
+ if (!content) return
340
+
341
+ if (allFields.length > 0) {
342
+ allFields.forEach((input) => {
343
+ const field = input
344
+ if (this.constructor.getCondition(field) && (field.type === 'text' || field.type === 'select-one')) {
345
+ field.value = ''
346
+ } else {
347
+ field.checked = false
348
+ }
349
+ })
350
+ }
351
+
352
+ if (buttonCheck) {
353
+ buttonCheck.remove()
354
+ }
355
+
356
+ this.selected = []
357
+ this.updateDom()
358
+ })
359
+ }
52
360
  }
53
361
 
54
362
  export default Filters
@@ -250,6 +250,7 @@ $nsw-form-tick: '<svg fill="#ffffff" version="1.1" xmlns="http://www.w3.org/2000
250
250
  font-weight: var(--nsw-font-normal);
251
251
 
252
252
  &:hover {
253
+ @include nsw-hover;
253
254
  outline-width: 0;
254
255
  }
255
256
 
@@ -36,6 +36,7 @@
36
36
  text-decoration: none;
37
37
 
38
38
  &:hover {
39
+ @include nsw-hover;
39
40
  outline-width: 0;
40
41
  }
41
42
 
@@ -64,7 +64,7 @@
64
64
 
65
65
  &:hover {
66
66
  .nsw-list-item__title a {
67
- @include nsw-hover;
67
+ @include nsw-link-hover;
68
68
  }
69
69
  }
70
70
 
@@ -123,6 +123,10 @@
123
123
  justify-content: space-between;
124
124
  flex-wrap: nowrap;
125
125
 
126
+ &:hover {
127
+ @include nsw-hover;
128
+ }
129
+
126
130
  .nsw-material-icons {
127
131
  color: var(--nsw-brand-dark);
128
132
  margin-right: rem(-8px);
@@ -25,8 +25,10 @@
25
25
  padding: rem(4px);
26
26
  min-width: rem(30px);
27
27
  border-radius: var(--nsw-border-radius);
28
+ color: var(--nsw-brand-dark);
28
29
 
29
30
  &:hover {
31
+ @include nsw-hover;
30
32
  outline-width: 0;
31
33
  }
32
34
 
@@ -44,6 +44,7 @@
44
44
  padding: rem(16px);
45
45
 
46
46
  &:hover {
47
+ @include nsw-hover;
47
48
  outline-width: 0;
48
49
  }
49
50
 
@@ -34,6 +34,7 @@
34
34
  height: 100%;
35
35
 
36
36
  &:hover {
37
+ @include nsw-hover;
37
38
  outline-width: 0;
38
39
  }
39
40
 
@@ -95,7 +95,11 @@ class Tabs {
95
95
  this.tabPanel[selectedTabIndex].hidden = true
96
96
  this.selectedTab = clickedTab
97
97
  if (!clickedTab.classList.contains('js-tabs-fixed')) {
98
- this.selectedTab.scrollIntoView()
98
+ clickedTab.scrollIntoView({
99
+ behavior: 'smooth',
100
+ block: 'nearest',
101
+ inline: 'nearest',
102
+ })
99
103
  }
100
104
  }
101
105
  }
@@ -13,6 +13,7 @@
13
13
  }
14
14
 
15
15
  &:hover {
16
+ @include nsw-hover;
16
17
  outline-width: 0;
17
18
  }
18
19
 
@@ -34,6 +34,11 @@
34
34
  background-color: var(--nsw-text-hover);
35
35
  }
36
36
 
37
+ // Default text link hover state
38
+ @mixin nsw-link-hover {
39
+ background-color: var(--nsw-text-link-hover);
40
+ }
41
+
37
42
  // A block to click around the link
38
43
  @mixin pseudo-clickable-block {
39
44
  &::after {
@@ -98,12 +103,12 @@
98
103
  //Links
99
104
  @mixin link() {
100
105
  font-weight: var(--nsw-font-bold);
101
- color: var(--nsw-brand-dark);
106
+ color: var(--nsw-text-link);
102
107
  text-decoration: underline;
103
108
 
104
109
  &:hover {
105
- @include nsw-hover;
106
- outline: 2px solid var(--nsw-text-hover);
110
+ @include nsw-link-hover;
111
+ outline: 2px solid var(--nsw-text-link-hover);
107
112
  }
108
113
 
109
114
  &:focus {
@@ -116,11 +121,11 @@
116
121
  }
117
122
 
118
123
  @mixin link-dark() {
119
- color: var(--nsw-brand-dark);
124
+ color: var(--nsw-text-link);
120
125
 
121
126
  &:hover {
122
- background-color: var(--nsw-text-hover);
123
- outline-color: var(--nsw-text-hover);
127
+ background-color: var(--nsw-text-link-hover);
128
+ outline-color: var(--nsw-text-link-hover);
124
129
  }
125
130
 
126
131
  &:focus {
@@ -4,60 +4,118 @@
4
4
  --nsw-palette-grey-03: #cdd3d6;
5
5
  --nsw-palette-grey-04: #ebebeb;
6
6
 
7
+ --nsw-palette-grey-01-rgb: 34, 39, 43;
8
+ --nsw-palette-grey-02-rgb: 73, 80, 84;
9
+ --nsw-palette-grey-03-rgb: 205, 211, 214;
10
+ --nsw-palette-grey-04-rgb: 235, 235, 235;
11
+
7
12
  --nsw-palette-green-01: #004000;
8
13
  --nsw-palette-green-02: #00aa45;
9
14
  --nsw-palette-green-03: #a8edb3;
10
15
  --nsw-palette-green-04: #dbfadf;
11
16
 
17
+ --nsw-palette-green-01-rgb: 0, 64, 0;
18
+ --nsw-palette-green-02-rgb: 0, 170, 69;
19
+ --nsw-palette-green-03-rgb: 168, 237, 179;
20
+ --nsw-palette-green-04-rgb: 219, 250, 223;
21
+
12
22
  --nsw-palette-teal-01: #0b3f47;
13
23
  --nsw-palette-teal-02: #2e808e;
14
24
  --nsw-palette-teal-03: #8cdbe5;
15
25
  --nsw-palette-teal-04: #d1eeea;
16
26
 
27
+ --nsw-palette-teal-01-rgb: 11, 63, 71;
28
+ --nsw-palette-teal-02-rgb: 46, 128, 142;
29
+ --nsw-palette-teal-03-rgb: 140, 219, 229;
30
+ --nsw-palette-teal-04-rgb: 209, 238, 234;
31
+
17
32
  --nsw-palette-blue-01: #002664;
18
33
  --nsw-palette-blue-02: #146cfd;
19
34
  --nsw-palette-blue-03: #8ce0ff;
20
35
  --nsw-palette-blue-04: #cbedfd;
21
36
 
37
+ --nsw-palette-blue-01-rgb: 0, 38, 100;
38
+ --nsw-palette-blue-02-rgb: 20, 108, 253;
39
+ --nsw-palette-blue-03-rgb: 140, 224, 255;
40
+ --nsw-palette-blue-04-rgb: 203, 237, 253;
41
+
22
42
  --nsw-palette-purple-01: #441170;
23
43
  --nsw-palette-purple-02: #8055f1;
24
44
  --nsw-palette-purple-03: #cebfff;
25
45
  --nsw-palette-purple-04: #e6e1fd;
26
46
 
47
+ --nsw-palette-purple-01-rgb: 68, 17, 112;
48
+ --nsw-palette-purple-02-rgb: 128, 85, 241;
49
+ --nsw-palette-purple-03-rgb: 206, 191, 255;
50
+ --nsw-palette-purple-04-rgb: 230, 225, 253;
51
+
27
52
  --nsw-palette-pink-01: #65004d;
28
53
  --nsw-palette-pink-02: #d912ae;
29
54
  --nsw-palette-pink-03: #f4b5e6;
30
55
  --nsw-palette-pink-04: #fddef2;
31
56
 
57
+ --nsw-palette-pink-01-rgb: 101, 0, 77;
58
+ --nsw-palette-pink-02-rgb: 217, 18, 174;
59
+ --nsw-palette-pink-03-rgb: 244, 181, 230;
60
+ --nsw-palette-pink-04-rgb: 253, 222, 242;
61
+
32
62
  --nsw-palette-red-01: #630019;
33
63
  --nsw-palette-red-02: #d7153a;
34
64
  --nsw-palette-red-03: #ffb8c1;
35
65
  --nsw-palette-red-04: #ffe6ea;
36
66
 
67
+ --nsw-palette-red-01-rgb: 99, 0, 25;
68
+ --nsw-palette-red-02-rgb: 215, 21, 58;
69
+ --nsw-palette-red-03-rgb: 255, 184, 193;
70
+ --nsw-palette-red-04-rgb: 255, 230, 234;
71
+
37
72
  --nsw-palette-orange-01: #941b00;
38
73
  --nsw-palette-orange-02: #f3631b;
39
74
  --nsw-palette-orange-03: #ffce99;
40
75
  --nsw-palette-orange-04: #fdeddf;
41
76
 
77
+ --nsw-palette-orange-01-rgb: 148, 27, 0;
78
+ --nsw-palette-orange-02-rgb: 243, 99, 27;
79
+ --nsw-palette-orange-03-rgb: 255, 206, 153;
80
+ --nsw-palette-orange-04-rgb: 253, 237, 223;
81
+
42
82
  --nsw-palette-yellow-01: #694800;
43
83
  --nsw-palette-yellow-02: #faaf05;
44
84
  --nsw-palette-yellow-03: #fde79a;
45
85
  --nsw-palette-yellow-04: #fff4cf;
46
86
 
87
+ --nsw-palette-yellow-01-rgb: 105, 72, 0;
88
+ --nsw-palette-yellow-02-rgb: 250, 175, 5;
89
+ --nsw-palette-yellow-03-rgb: 253, 231, 154;
90
+ --nsw-palette-yellow-04-rgb: 255, 244, 207;
91
+
47
92
  --nsw-palette-brown-01: #523719;
48
93
  --nsw-palette-brown-02: #b68d5d;
49
94
  --nsw-palette-brown-03: #e8d0b5;
50
95
  --nsw-palette-brown-04: #ede3d7;
51
96
 
97
+ --nsw-palette-brown-01-rgb: 82, 55, 25;
98
+ --nsw-palette-brown-02-rgb: 182, 141, 93;
99
+ --nsw-palette-brown-03-rgb: 232, 208, 181;
100
+ --nsw-palette-brown-04-rgb: 237, 227, 215;
101
+
52
102
  --nsw-palette-black: #000000;
53
103
  --nsw-palette-white: #ffffff;
54
104
  --nsw-palette-off-white: #f2f2f2;
55
105
 
106
+ --nsw-palette-black-rgb: 0, 0, 0;
107
+ --nsw-palette-white-rgb: 255, 255, 255;
108
+ --nsw-palette-off-white-rgb: 242, 242, 242;
109
+
56
110
  --nsw-palette-focus: #0085b3;
57
- --nsw-palette-hover: #{rgba(#0085b3, 0.2)};
58
- --nsw-palette-hover-light: #{rgba(#ffffff, 0.2)};
59
111
  --nsw-palette-visited: #551a8b;
60
112
 
113
+ --nsw-palette-focus-rgb: 0, 133, 179;
114
+ --nsw-palette-visited-rgb: 85, 26, 139;
115
+
116
+ --nsw-palette-hover: rgba(var(--nsw-palette-focus-rgb), 0.2);
117
+ --nsw-palette-hover-light: rgba(var(--nsw-palette-white-rgb), 0.2);
118
+
61
119
  --nsw-palette-info-blue: #2e5299;
62
120
  --nsw-palette-info-blue-bg: #eaedf4;
63
121
  --nsw-palette-success-green: #00a908;
@@ -66,4 +124,13 @@
66
124
  --nsw-palette-warning-orange-bg: #fbeee5;
67
125
  --nsw-palette-error-red: #b81237;
68
126
  --nsw-palette-error-red-bg: #f7e7eb;
127
+
128
+ --nsw-palette-info-blue-rgb: 46, 82, 153;
129
+ --nsw-palette-info-blue-bg-rgb: 234, 237, 244;
130
+ --nsw-palette-success-green-rgb: 0, 169, 8;
131
+ --nsw-palette-success-green-bg-rgb: 229, 246, 230;
132
+ --nsw-palette-warning-orange-rgb: 220, 88, 0;
133
+ --nsw-palette-warning-orange-bg-rgb: 251, 238, 229;
134
+ --nsw-palette-error-red-rgb: 184, 18, 55;
135
+ --nsw-palette-error-red-bg-rgb: 247, 231, 235;
69
136
  }
@@ -7,10 +7,15 @@
7
7
 
8
8
  --nsw-text-dark: var(--nsw-palette-grey-01);
9
9
  --nsw-text-light: var(--nsw-palette-white);
10
- --nsw-focus: var(--nsw-palette-focus);
11
- --nsw-text-hover: var(--nsw-palette-hover);
12
- --nsw-text-hover-light: var(--nsw-palette-hover-light);
10
+
11
+ --nsw-text-hover: rgba(var(--nsw-palette-blue-01-rgb), 0.1);
12
+ --nsw-text-hover-light: rgba(var(--nsw-palette-white-rgb), 0.1);
13
+
14
+ --nsw-text-link: var(--nsw-palette-blue-01);
15
+ --nsw-text-link-hover: rgba(var(--nsw-palette-blue-01-rgb), 0.1);
16
+
13
17
  --nsw-text-visited: var(--nsw-palette-visited);
18
+ --nsw-focus: var(--nsw-palette-focus);
14
19
 
15
20
  --nsw-black: var(--nsw-palette-black);
16
21
  --nsw-white: var(--nsw-palette-white);
@@ -29,8 +34,8 @@
29
34
  --nsw-status-error: var(--nsw-palette-error-red);
30
35
  --nsw-status-error-bg: var(--nsw-palette-error-red-bg);
31
36
 
32
- --nsw-black-rgb: 0, 0, 0;
33
- --nsw-white-rgb: 255, 255, 255;
37
+ --nsw-black-rgb: var(--nsw-palette-black-rgb);
38
+ --nsw-white-rgb: var(--nsw-palette-white-rgb);
34
39
 
35
40
  /* Font */
36
41
  --nsw-font-family: 'Public Sans', sans-serif;