nsw-design-system 3.26.2 → 3.27.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.
- package/dist/css/core.css.map +1 -1
- package/dist/css/main.css +2 -2
- package/dist/css/main.css.map +1 -1
- package/dist/js/global/scripts/helpers/utilities.d.ts +1 -1
- package/dist/js/main.js +26 -4
- package/package.json +2 -1
- package/src/components/content-block/_content-block.scss +13 -0
- package/src/components/form/_form.scss +34 -1
- package/src/components/link-list/_link-list.scss +1 -1
- package/src/components/utility-list/_utility-list.scss +26 -0
- package/src/components/utility-list/utility-list.js +3 -3
- package/src/core/typography/_typography.scss +0 -1
- package/src/docs/content/methods/easy-read/_easy-read.scss +345 -0
- package/src/global/scripts/helpers/utilities.js +24 -7
- package/src/global/scss/settings/_settings.scss +3 -0
- package/src/main.scss +1 -0
|
@@ -21,6 +21,6 @@ export function getFocusableElementBySelector(id: any, selectorArr: any): {
|
|
|
21
21
|
export function trapTabKey(event: any, focusObject: any): boolean;
|
|
22
22
|
export function whichTransitionEvent(): any;
|
|
23
23
|
export function validateUrl(raw: any, fallback?: string): string;
|
|
24
|
-
export function popupWindow(url: any, width: any, height: any):
|
|
24
|
+
export function popupWindow(url: any, width: any, height: any): Window | null;
|
|
25
25
|
export function setAriaDisabled(element: any, isDisabled: any, className?: string): void;
|
|
26
26
|
export function isAriaDisabled(element: any): any;
|
package/dist/js/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! NSW Design System v3.
|
|
1
|
+
/*! NSW Design System v3.27.0 | MIT License */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define('NSW', ['exports'], factory) :
|
|
@@ -195,6 +195,28 @@
|
|
|
195
195
|
return fallback;
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
|
+
const popupWindow = (url, width, height) => {
|
|
199
|
+
if (!hasWindow$2 || typeof window.open !== 'function') return null;
|
|
200
|
+
const dialogWidth = Number(width) || 626;
|
|
201
|
+
const dialogHeight = Number(height) || 436;
|
|
202
|
+
let top = 0;
|
|
203
|
+
let left = 0;
|
|
204
|
+
try {
|
|
205
|
+
const topWindow = window.top;
|
|
206
|
+
top = topWindow.outerHeight / 2 + topWindow.screenY - dialogHeight / 2;
|
|
207
|
+
left = topWindow.outerWidth / 2 + topWindow.screenX - dialogWidth / 2;
|
|
208
|
+
} catch (e) {
|
|
209
|
+
top = (window.outerHeight || dialogHeight) / 2 + (window.screenY || 0) - dialogHeight / 2;
|
|
210
|
+
left = (window.outerWidth || dialogWidth) / 2 + (window.screenX || 0) - dialogWidth / 2;
|
|
211
|
+
}
|
|
212
|
+
const popup = window.open(url, 'nsw-share-dialog', `toolbar=no,location=no,directories=no,status=no,
|
|
213
|
+
menubar=no,scrollbars=no,resizable=no,copyhistory=no,
|
|
214
|
+
width=${dialogWidth},height=${dialogHeight},top=${top},left=${left},noopener,noreferrer`);
|
|
215
|
+
|
|
216
|
+
// Explicitly clear opener for browsers that do not fully enforce noopener from features.
|
|
217
|
+
if (popup) popup.opener = null;
|
|
218
|
+
return popup;
|
|
219
|
+
};
|
|
198
220
|
const setAriaDisabled = (element, isDisabled, className = 'disabled') => {
|
|
199
221
|
if (!element) return;
|
|
200
222
|
element.setAttribute('aria-disabled', isDisabled ? 'true' : 'false');
|
|
@@ -7079,7 +7101,7 @@
|
|
|
7079
7101
|
if (social === 'mail') {
|
|
7080
7102
|
window.location.href = url;
|
|
7081
7103
|
} else {
|
|
7082
|
-
|
|
7104
|
+
popupWindow(url, 626, 436);
|
|
7083
7105
|
}
|
|
7084
7106
|
});
|
|
7085
7107
|
}
|
|
@@ -7123,7 +7145,7 @@
|
|
|
7123
7145
|
}
|
|
7124
7146
|
params.forEach(param => {
|
|
7125
7147
|
let paramValue = button.getAttribute(`data-${param}`);
|
|
7126
|
-
if (param === 'hashtags') paramValue = encodeURI(paramValue.replace(/#| /g, ''));
|
|
7148
|
+
if (param === 'hashtags' && paramValue) paramValue = encodeURI(paramValue.replace(/#| /g, ''));
|
|
7127
7149
|
if (paramValue) {
|
|
7128
7150
|
if (social === 'facebook') {
|
|
7129
7151
|
newUrl = `${newUrl}u=${encodeURIComponent(paramValue)}&`;
|
|
@@ -7594,4 +7616,4 @@
|
|
|
7594
7616
|
|
|
7595
7617
|
}));
|
|
7596
7618
|
|
|
7597
|
-
;(function(g){try{g.NSW=g.NSW||{};g.NSW.VERSION="3.
|
|
7619
|
+
;(function(g){try{g.NSW=g.NSW||{};g.NSW.VERSION="3.27.0";}catch(e){} }(typeof globalThis!=='undefined'?globalThis:(typeof window!=='undefined'?window:self)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nsw-design-system",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.27.0",
|
|
4
4
|
"description": "Design system for Digital NSW",
|
|
5
5
|
"main": "dist/js/main.js",
|
|
6
6
|
"types": "dist/js/main.d.ts",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"files": [
|
|
17
17
|
"dist/{css,js}/**/*.{css,d.ts,js,map}",
|
|
18
18
|
"src/{components,patterns,styles,core}/**/*.{scss,js}",
|
|
19
|
+
"src/docs/content/methods/easy-read/_easy-read.scss",
|
|
19
20
|
"src/global/{scripts,scss}/**/*.{scss,js}",
|
|
20
21
|
"src/main.{scss,js}"
|
|
21
22
|
],
|
|
@@ -57,4 +57,17 @@
|
|
|
57
57
|
&__icon {
|
|
58
58
|
margin-bottom: nsw.rem(12px);
|
|
59
59
|
}
|
|
60
|
+
|
|
61
|
+
&__pictogram {
|
|
62
|
+
width: nsw.rem(48px);
|
|
63
|
+
height: nsw.rem(48px);
|
|
64
|
+
|
|
65
|
+
> svg {
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
display: block;
|
|
68
|
+
width: 100%;
|
|
69
|
+
height: 100%;
|
|
70
|
+
padding: nsw.rem(3px);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
60
73
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
&:first-child {
|
|
17
17
|
margin-top: 0;
|
|
18
18
|
}
|
|
19
|
+
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
&__helper {
|
|
@@ -26,7 +27,9 @@
|
|
|
26
27
|
@include nsw.font-size('xs');
|
|
27
28
|
|
|
28
29
|
&--error,
|
|
29
|
-
&--valid
|
|
30
|
+
&--valid,
|
|
31
|
+
&--warning,
|
|
32
|
+
&--info {
|
|
30
33
|
margin-top: nsw.rem(8px);
|
|
31
34
|
padding: nsw.rem(8px);
|
|
32
35
|
font-weight: var(--nsw-font-bold);
|
|
@@ -58,6 +61,36 @@
|
|
|
58
61
|
color: var(--nsw-status-success);
|
|
59
62
|
}
|
|
60
63
|
}
|
|
64
|
+
|
|
65
|
+
&--warning {
|
|
66
|
+
align-items: flex-start;
|
|
67
|
+
font-weight: var(--nsw-font-normal);
|
|
68
|
+
background-color: var(--nsw-status-warning-bg);
|
|
69
|
+
|
|
70
|
+
.nsw-material-icons {
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
color: var(--nsw-status-warning);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
strong {
|
|
76
|
+
font-weight: var(--nsw-font-bold);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&--info {
|
|
81
|
+
align-items: flex-start;
|
|
82
|
+
font-weight: var(--nsw-font-normal);
|
|
83
|
+
background-color: var(--nsw-status-info-bg);
|
|
84
|
+
|
|
85
|
+
.nsw-material-icons {
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
color: var(--nsw-status-info);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
strong {
|
|
91
|
+
font-weight: var(--nsw-font-bold);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
61
94
|
}
|
|
62
95
|
|
|
63
96
|
&__label {
|
|
@@ -95,6 +95,32 @@
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
&__item--link {
|
|
99
|
+
padding: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__link {
|
|
103
|
+
width: 100%;
|
|
104
|
+
padding: nsw.rem(16px);
|
|
105
|
+
display: flex;
|
|
106
|
+
gap: nsw.$grid-gutters;
|
|
107
|
+
align-items: center;
|
|
108
|
+
color: inherit;
|
|
109
|
+
text-decoration: none;
|
|
110
|
+
|
|
111
|
+
&:visited {
|
|
112
|
+
color: inherit;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&:hover {
|
|
116
|
+
outline-width: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&:focus {
|
|
120
|
+
@include nsw.nsw-focus;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
98
124
|
.nsw-toggletip {
|
|
99
125
|
border-bottom: unset;
|
|
100
126
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Toggletip from '../tooltip/toggletip'
|
|
2
2
|
import logger from '../../global/scripts/helpers/logger'
|
|
3
|
-
import { copyToClipboard as writeToClipboard } from '../../global/scripts/helpers/utilities'
|
|
3
|
+
import { copyToClipboard as writeToClipboard, popupWindow } from '../../global/scripts/helpers/utilities'
|
|
4
4
|
|
|
5
5
|
class UtilityList extends Toggletip {
|
|
6
6
|
constructor(element, toggletip = element.querySelector('.js-share')) {
|
|
@@ -36,7 +36,7 @@ class UtilityList extends Toggletip {
|
|
|
36
36
|
if (social === 'mail') {
|
|
37
37
|
window.location.href = url
|
|
38
38
|
} else {
|
|
39
|
-
|
|
39
|
+
popupWindow(url, 626, 436)
|
|
40
40
|
}
|
|
41
41
|
})
|
|
42
42
|
}
|
|
@@ -89,7 +89,7 @@ class UtilityList extends Toggletip {
|
|
|
89
89
|
|
|
90
90
|
params.forEach((param) => {
|
|
91
91
|
let paramValue = button.getAttribute(`data-${param}`)
|
|
92
|
-
if (param === 'hashtags') paramValue = encodeURI(paramValue.replace(/#| /g, ''))
|
|
92
|
+
if (param === 'hashtags' && paramValue) paramValue = encodeURI(paramValue.replace(/#| /g, ''))
|
|
93
93
|
if (paramValue) {
|
|
94
94
|
if (social === 'facebook') {
|
|
95
95
|
newUrl = `${newUrl}u=${encodeURIComponent(paramValue)}&`
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
@use '../../../../global/scss/tools' as nsw;
|
|
2
|
+
|
|
3
|
+
.nsw-easy-read-content {
|
|
4
|
+
font-size: nsw.rem(20px);
|
|
5
|
+
line-height: nsw.rem(32px);
|
|
6
|
+
|
|
7
|
+
p,
|
|
8
|
+
ul,
|
|
9
|
+
ol,
|
|
10
|
+
dl,
|
|
11
|
+
.nsw-intro,
|
|
12
|
+
.nsw-easy-read-block__copy {
|
|
13
|
+
font-size: nsw.rem(20px);
|
|
14
|
+
line-height: nsw.rem(32px);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
h1,
|
|
18
|
+
.nsw-h1 {
|
|
19
|
+
font-size: nsw.rem(44px);
|
|
20
|
+
line-height: nsw.rem(56px);
|
|
21
|
+
|
|
22
|
+
@include nsw.breakpoint('lg') {
|
|
23
|
+
font-size: nsw.rem(60px);
|
|
24
|
+
line-height: nsw.rem(76px);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
h2,
|
|
29
|
+
.nsw-h2 {
|
|
30
|
+
font-size: nsw.rem(36px);
|
|
31
|
+
line-height: nsw.rem(44px);
|
|
32
|
+
|
|
33
|
+
@include nsw.breakpoint('lg') {
|
|
34
|
+
font-size: nsw.rem(40px);
|
|
35
|
+
line-height: nsw.rem(52px);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
h3,
|
|
40
|
+
.nsw-h3 {
|
|
41
|
+
font-size: nsw.rem(28px);
|
|
42
|
+
line-height: nsw.rem(36px);
|
|
43
|
+
|
|
44
|
+
@include nsw.breakpoint('lg') {
|
|
45
|
+
font-size: nsw.rem(32px);
|
|
46
|
+
line-height: nsw.rem(40px);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
h4,
|
|
51
|
+
.nsw-h4,
|
|
52
|
+
.nsw-card__title {
|
|
53
|
+
font-size: nsw.rem(24px);
|
|
54
|
+
font-weight: var(--nsw-font-bold);
|
|
55
|
+
line-height: nsw.rem(32px);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Keep the card API generic and apply the Easy Read proportions and type
|
|
59
|
+
// treatment only when a horizontal card is used in Easy Read content.
|
|
60
|
+
|
|
61
|
+
.nsw-card--horizontal {
|
|
62
|
+
--nsw-easy-read-card-image-width: 33.333%;
|
|
63
|
+
|
|
64
|
+
.nsw-card__copy,
|
|
65
|
+
.nsw-card__tag,
|
|
66
|
+
.nsw-card__date {
|
|
67
|
+
font-size: nsw.rem(20px);
|
|
68
|
+
line-height: nsw.rem(32px);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@include nsw.breakpoint('md') {
|
|
72
|
+
.nsw-card__image {
|
|
73
|
+
flex-basis: var(--nsw-easy-read-card-image-width);
|
|
74
|
+
min-height: nsw.rem(240px);
|
|
75
|
+
max-height: nsw.rem(420px);
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
|
|
78
|
+
img {
|
|
79
|
+
width: 100%;
|
|
80
|
+
height: 100%;
|
|
81
|
+
object-fit: cover;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.nsw-card__content {
|
|
86
|
+
flex-basis: calc(100% - var(--nsw-easy-read-card-image-width));
|
|
87
|
+
justify-content: center;
|
|
88
|
+
padding: nsw.rem(24px) nsw.rem(24px) nsw.rem(72px);
|
|
89
|
+
|
|
90
|
+
> .nsw-material-icons {
|
|
91
|
+
right: auto;
|
|
92
|
+
bottom: nsw.rem(24px);
|
|
93
|
+
left: calc(var(--nsw-easy-read-card-image-width) + #{nsw.rem(24px)});
|
|
94
|
+
transform: none;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@include nsw.breakpoint('lg') {
|
|
100
|
+
.nsw-card__content {
|
|
101
|
+
padding: nsw.rem(32px) nsw.rem(32px) nsw.rem(88px);
|
|
102
|
+
|
|
103
|
+
> .nsw-material-icons {
|
|
104
|
+
bottom: nsw.rem(32px);
|
|
105
|
+
left: calc(var(--nsw-easy-read-card-image-width) + #{nsw.rem(32px)});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
p + p {
|
|
112
|
+
margin-top: nsw.rem(24px);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&__heading-text {
|
|
116
|
+
display: block;
|
|
117
|
+
margin-top: nsw.rem(16px);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&__heading-icon {
|
|
121
|
+
display: block;
|
|
122
|
+
box-sizing: border-box;
|
|
123
|
+
width: nsw.rem(48px);
|
|
124
|
+
height: nsw.rem(48px);
|
|
125
|
+
padding: nsw.rem(3px);
|
|
126
|
+
background-image: url(#{nsw.$nsw-easy-read-icon});
|
|
127
|
+
background-repeat: no-repeat;
|
|
128
|
+
background-position: center;
|
|
129
|
+
background-size: contain;
|
|
130
|
+
background-origin: content-box;
|
|
131
|
+
background-clip: content-box;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&__divider {
|
|
135
|
+
margin: nsw.rem(16px) 0;
|
|
136
|
+
border: 0;
|
|
137
|
+
border-top: 1px solid var(--nsw-grey-04);
|
|
138
|
+
|
|
139
|
+
@include nsw.breakpoint('md') {
|
|
140
|
+
margin: nsw.rem(20px) 0;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&__block-stack {
|
|
145
|
+
margin: nsw.rem(32px) 0;
|
|
146
|
+
|
|
147
|
+
@include nsw.breakpoint('md') {
|
|
148
|
+
margin: nsw.rem(40px) 0;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&__block-item {
|
|
153
|
+
margin: 0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.nsw-easy-read-core-ideas {
|
|
158
|
+
.nsw-content-block__image {
|
|
159
|
+
max-height: nsw.rem(48px);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.nsw-content-block__icon {
|
|
163
|
+
display: flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
justify-content: center;
|
|
166
|
+
width: nsw.rem(48px);
|
|
167
|
+
height: nsw.rem(48px);
|
|
168
|
+
max-width: nsw.rem(48px);
|
|
169
|
+
max-height: nsw.rem(48px);
|
|
170
|
+
padding: nsw.rem(3px);
|
|
171
|
+
box-sizing: border-box;
|
|
172
|
+
|
|
173
|
+
svg {
|
|
174
|
+
display: block;
|
|
175
|
+
width: nsw.rem(42px);
|
|
176
|
+
height: nsw.rem(42px);
|
|
177
|
+
max-width: nsw.rem(42px);
|
|
178
|
+
max-height: nsw.rem(42px);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.nsw-easy-read-block {
|
|
184
|
+
display: grid;
|
|
185
|
+
grid-template-columns: minmax(0, 1fr);
|
|
186
|
+
align-items: center;
|
|
187
|
+
width: 100%;
|
|
188
|
+
border-radius: var(--nsw-border-radius);
|
|
189
|
+
overflow: hidden;
|
|
190
|
+
|
|
191
|
+
@include nsw.breakpoint('md') {
|
|
192
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&__image {
|
|
196
|
+
display: flex;
|
|
197
|
+
align-items: center;
|
|
198
|
+
justify-content: center;
|
|
199
|
+
min-width: 0;
|
|
200
|
+
|
|
201
|
+
img {
|
|
202
|
+
display: block;
|
|
203
|
+
width: 100%;
|
|
204
|
+
height: auto;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&--landscape {
|
|
208
|
+
aspect-ratio: 3 / 2;
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
|
|
211
|
+
img {
|
|
212
|
+
height: 100%;
|
|
213
|
+
object-fit: cover;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&__content {
|
|
219
|
+
min-width: 0;
|
|
220
|
+
padding: nsw.rem(24px) nsw.rem(20px);
|
|
221
|
+
|
|
222
|
+
@include nsw.breakpoint('md') {
|
|
223
|
+
padding: nsw.rem(32px);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
&__title {
|
|
228
|
+
margin: 0;
|
|
229
|
+
font-weight: var(--nsw-font-bold);
|
|
230
|
+
text-wrap: pretty;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&__copy {
|
|
234
|
+
text-wrap: pretty;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&.nsw-section--brand-dark,
|
|
238
|
+
&.nsw-section--invert {
|
|
239
|
+
a {
|
|
240
|
+
@include nsw.link-light;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
&.nsw-section--brand-light,
|
|
245
|
+
&.nsw-section--off-white,
|
|
246
|
+
&.nsw-section--white {
|
|
247
|
+
a {
|
|
248
|
+
@include nsw.link-dark;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.nsw-easy-read-about {
|
|
254
|
+
display: flex;
|
|
255
|
+
flex-direction: row;
|
|
256
|
+
flex-wrap: nowrap;
|
|
257
|
+
|
|
258
|
+
.nsw-callout__content {
|
|
259
|
+
flex: 1 1 auto;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&__pictogram {
|
|
263
|
+
background-image: url(#{nsw.$nsw-easy-read-icon});
|
|
264
|
+
background-repeat: no-repeat;
|
|
265
|
+
background-position: center;
|
|
266
|
+
background-size: contain;
|
|
267
|
+
background-origin: content-box;
|
|
268
|
+
background-clip: content-box;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.nsw-callout__pictogram {
|
|
272
|
+
box-sizing: border-box;
|
|
273
|
+
flex: 0 0 auto;
|
|
274
|
+
width: nsw.rem(48px);
|
|
275
|
+
height: nsw.rem(48px);
|
|
276
|
+
padding: nsw.rem(3px);
|
|
277
|
+
margin-right: nsw.rem(16px);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.nsw-easy-read-downloads {
|
|
282
|
+
h2 {
|
|
283
|
+
margin-top: 0;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
> .nsw-utility-list {
|
|
288
|
+
margin: nsw.rem(24px) 0;
|
|
289
|
+
|
|
290
|
+
@include nsw.breakpoint('lg') {
|
|
291
|
+
margin: nsw.rem(32px) 0;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
+ p {
|
|
295
|
+
margin-top: 0;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.nsw-easy-read-content .nsw-easy-read-metadata {
|
|
302
|
+
div + div {
|
|
303
|
+
margin-top: nsw.rem(4px);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
dt,
|
|
307
|
+
dd {
|
|
308
|
+
display: inline;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
dt {
|
|
312
|
+
font-weight: var(--nsw-font-bold);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
dd {
|
|
316
|
+
margin-left: nsw.rem(4px);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
.nsw-easy-read-category-group {
|
|
322
|
+
+ .nsw-easy-read-category-group {
|
|
323
|
+
margin-top: nsw.rem(32px);
|
|
324
|
+
|
|
325
|
+
@include nsw.breakpoint('md') {
|
|
326
|
+
margin-top: nsw.rem(48px);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
&__image {
|
|
331
|
+
display: block;
|
|
332
|
+
width: 100%;
|
|
333
|
+
aspect-ratio: 4 / 3;
|
|
334
|
+
border-radius: var(--nsw-border-radius);
|
|
335
|
+
object-fit: cover;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
&__content h2 {
|
|
339
|
+
margin-top: nsw.rem(24px);
|
|
340
|
+
|
|
341
|
+
@include nsw.breakpoint('md') {
|
|
342
|
+
margin-top: 0;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
@@ -172,16 +172,33 @@ export const validateUrl = (raw, fallback = 'https://www.google.com/webhp') => {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
export const popupWindow = (url, width, height) => {
|
|
175
|
-
|
|
176
|
-
const x = window.top.outerWidth / 2 + window.top.screenX - (width / 2)
|
|
175
|
+
if (!hasWindow || typeof window.open !== 'function') return null
|
|
177
176
|
|
|
178
|
-
|
|
177
|
+
const dialogWidth = Number(width) || 626
|
|
178
|
+
const dialogHeight = Number(height) || 436
|
|
179
|
+
let top = 0
|
|
180
|
+
let left = 0
|
|
181
|
+
|
|
182
|
+
try {
|
|
183
|
+
const topWindow = window.top
|
|
184
|
+
top = topWindow.outerHeight / 2 + topWindow.screenY - (dialogHeight / 2)
|
|
185
|
+
left = topWindow.outerWidth / 2 + topWindow.screenX - (dialogWidth / 2)
|
|
186
|
+
} catch (e) {
|
|
187
|
+
top = (window.outerHeight || dialogHeight) / 2 + (window.screenY || 0) - (dialogHeight / 2)
|
|
188
|
+
left = (window.outerWidth || dialogWidth) / 2 + (window.screenX || 0) - (dialogWidth / 2)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const popup = window.open(
|
|
179
192
|
url,
|
|
180
|
-
'',
|
|
181
|
-
`toolbar=no,location=no,directories=no,
|
|
182
|
-
menubar=no,
|
|
183
|
-
width=${
|
|
193
|
+
'nsw-share-dialog',
|
|
194
|
+
`toolbar=no,location=no,directories=no,status=no,
|
|
195
|
+
menubar=no,scrollbars=no,resizable=no,copyhistory=no,
|
|
196
|
+
width=${dialogWidth},height=${dialogHeight},top=${top},left=${left},noopener,noreferrer`,
|
|
184
197
|
)
|
|
198
|
+
|
|
199
|
+
// Explicitly clear opener for browsers that do not fully enforce noopener from features.
|
|
200
|
+
if (popup) popup.opener = null
|
|
201
|
+
return popup
|
|
185
202
|
}
|
|
186
203
|
|
|
187
204
|
export const setAriaDisabled = (element, isDisabled, className = 'disabled') => {
|
|
@@ -391,3 +391,6 @@ $nsw-vertical-align: (
|
|
|
391
391
|
valign-middle: middle,
|
|
392
392
|
valign-bottom: bottom,
|
|
393
393
|
);
|
|
394
|
+
|
|
395
|
+
// Easy Read
|
|
396
|
+
$nsw-easy-read-icon: "data:image/svg+xml,%3Csvg width='90' height='83' viewBox='0 0 90 83' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M84.8978 7.6886H88.0476V62.6834H1.95312V7.6886H11.3185' stroke='%23002664' stroke-width='2.3' stroke-linejoin='round'/%3E%3Cpath d='M72.2975 23.437H51.2988' stroke='%23002664' stroke-width='2.3' stroke-linejoin='round'/%3E%3Cpath d='M72.2955 15.1467H51.2969' stroke='%23002664' stroke-width='2.3' stroke-linejoin='round'/%3E%3Cpath d='M72.2975 31.8375H51.2988' stroke='%23002664' stroke-width='2.3' stroke-linejoin='round'/%3E%3Cpath d='M72.2975 40.2363H51.2988' stroke='%23002664' stroke-width='2.3' stroke-linejoin='round'/%3E%3Cpath d='M45 62.5997V5.98801C45 3.67818 46.8899 1.78833 49.1997 1.78833H81.7476V54.2843H49.1997C46.8689 54.2843 45 56.1742 45 58.484V62.5997Z' stroke='%23002664' stroke-width='2.3' stroke-linejoin='round'/%3E%3Cpath d='M44.9996 62.5997V5.98801C44.9996 3.67818 43.1097 1.78833 40.7999 1.78833H22.783V16.5712L8.25195 16.6762V54.3053H40.7999C43.1307 54.3053 44.9996 56.1952 44.9996 58.505V62.6207V62.5997Z' stroke='%23002664' stroke-width='2.3' stroke-linejoin='round'/%3E%3Cpath d='M22.783 1.74609L8.25195 16.655' stroke='%23002664' stroke-width='2.3' stroke-linejoin='round'/%3E%3Cpath d='M0.839844 70.2229H8.48335V71.7558H2.58273V75.3465H7.83239V76.8374H2.58273V80.5121H8.63034V82.066H0.839844V70.2229Z' fill='%23002664'/%3E%3Cpath d='M14.4048 70.2229H16.3367L20.5994 82.066H18.8355L17.7226 78.9582H13.0189L11.906 82.066H10.1211L14.4048 70.2229ZM17.2606 77.3834L15.3498 71.9448L13.4389 77.3834H17.2396H17.2606Z' fill='%23002664'/%3E%3Cpath d='M24.4217 81.8563C23.7287 81.6043 23.1618 81.2263 22.6998 80.7014C22.2378 80.1974 21.9649 79.5674 21.8809 78.8535H23.7077C23.8547 79.4625 24.1697 79.9454 24.6947 80.2814C25.2196 80.6174 25.8496 80.7854 26.5846 80.7854C27.1095 80.7854 27.5715 80.7224 27.9915 80.5754C28.4114 80.4284 28.7474 80.2184 28.9784 79.9454C29.2304 79.6724 29.3354 79.3365 29.3354 78.9795C29.3354 78.4965 29.1674 78.0976 28.8104 77.7826C28.4534 77.4676 27.9495 77.2576 27.2985 77.1106L25.0517 76.6067C24.1487 76.4177 23.4558 76.0607 22.9518 75.5568C22.4478 75.0318 22.2168 74.3598 22.2168 73.5409C22.2168 72.848 22.4058 72.26 22.7838 71.735C23.1618 71.2101 23.6657 70.7901 24.3167 70.5171C24.9677 70.2232 25.7026 70.0762 26.5426 70.0762C27.4665 70.0762 28.2854 70.2232 28.9364 70.5381C29.6084 70.8531 30.1123 71.2731 30.4483 71.798C30.7843 72.323 30.9733 72.911 30.9733 73.5409H29.1884C29.1254 72.827 28.8524 72.323 28.3694 71.987C27.9075 71.672 27.2985 71.5041 26.5426 71.5041C26.1016 71.5041 25.6816 71.5881 25.3036 71.735C24.9257 71.882 24.6317 72.092 24.4007 72.386C24.1697 72.659 24.0647 72.995 24.0647 73.3939C24.0647 73.6669 24.1277 73.9189 24.2327 74.1079C24.3377 74.2969 24.5477 74.4858 24.8207 74.6328C25.0937 74.7798 25.4716 74.9058 25.9756 75.0318L28.1805 75.5358C29.3144 75.7667 30.0703 76.2077 30.5113 76.8377C30.9313 77.4676 31.1413 78.1816 31.1413 78.9795C31.1413 79.5884 30.9523 80.1554 30.5953 80.6384C30.2173 81.1423 29.6924 81.5203 29.0204 81.8143C28.3274 82.1083 27.5295 82.2552 26.6056 82.2552C25.8286 82.2552 25.0937 82.1293 24.4217 81.8773V81.8563Z' fill='%23002664'/%3E%3Cpath d='M37.6081 77.0475V82.0661H35.8652V77.0265L31.8125 70.202H33.7234L36.7472 75.4726L39.729 70.202H41.6399L37.6081 77.0265V77.0475Z' fill='%23002664'/%3E%3Cpath d='M53.7972 82.0659L51.6974 77.1103H48.7155V82.0659H46.9727V70.2228H51.6764C52.9573 70.2228 53.9442 70.5168 54.5952 71.1047C55.2461 71.6927 55.5821 72.5116 55.5821 73.5405C55.5821 75.1154 54.8261 76.2073 53.3352 76.8163L55.6241 82.0659H53.7762H53.7972ZM51.1934 75.6824C52.0123 75.6824 52.6633 75.5144 53.1043 75.1364C53.5452 74.7584 53.7762 74.2755 53.7762 73.6035C53.7762 72.9316 53.5662 72.4696 53.1673 72.1126C52.7683 71.7767 52.2013 71.5877 51.4874 71.5877H48.7155V75.6614H51.1934V75.6824Z' fill='%23002664'/%3E%3Cpath d='M58.1445 70.2227H65.788V71.7555H59.8874V75.3463H65.1371V76.8372H59.8874V80.5119H65.935V82.0657H58.1445V70.2227Z' fill='%23002664'/%3E%3Cpath d='M71.7095 70.2228H73.6414L77.9041 82.0659H76.1402L75.0273 78.9581H70.3236L69.2107 82.0659H67.4258L71.7095 70.2228ZM74.5653 77.3832L72.6544 71.9446L70.7436 77.3832H74.5443H74.5653Z' fill='%23002664'/%3E%3Cpath d='M82.9867 70.2438C85.1076 70.2858 86.6615 70.7897 87.6694 71.7767C88.6773 72.7636 89.1603 74.1915 89.1603 76.0813C89.1603 77.9712 88.6353 79.5251 87.6064 80.533C86.5565 81.5409 84.9816 82.0659 82.8817 82.0659H80.0469V70.2228C81.3488 70.2228 82.3567 70.2228 83.0077 70.2228L82.9867 70.2438ZM82.8817 80.596C84.2886 80.596 85.3805 80.239 86.1575 79.5251C86.9344 78.8111 87.3124 77.6772 87.3124 76.0813C87.3124 74.4855 86.9344 73.3935 86.1995 72.7216C85.4645 72.0496 84.3726 71.6927 82.9237 71.6927H81.8108V80.596H82.8817Z' fill='%23002664'/%3E%3Cpath d='M37.0104 23.4374H16.0117V40.2361H37.0104V23.4374Z' stroke='%23002664' stroke-width='2.3' stroke-linejoin='round'/%3E%3C/svg%3E%0A";
|
package/src/main.scss
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@use 'global/scss/helpers/all' as helpers;
|
|
4
4
|
@use 'core/all' as core;
|
|
5
5
|
@use 'components/all' as components;
|
|
6
|
+
@use 'docs/content/methods/easy-read/easy-read';
|
|
6
7
|
@use 'components/accordion/accordion';
|
|
7
8
|
@use 'components/back-to-top/back-to-top';
|
|
8
9
|
@use 'components/date-input/date-input';
|