@defra/flood-webchat 0.0.1-beta.52 → 0.0.1-beta.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/flood-webchat",
3
- "version": "0.0.1-beta.52",
3
+ "version": "0.0.1-beta.54",
4
4
  "description": "",
5
5
  "main": "dist/server.js",
6
6
  "browser": "dist/client.js",
@@ -0,0 +1,77 @@
1
+ // stylelint-disable selector-max-id
2
+ #wc-availability {
3
+ margin-bottom: govuk-spacing(4);
4
+ }
5
+ // stylelint-enable selector-max-id
6
+
7
+ .wc-availability__inner {
8
+ max-width: 960px;
9
+ margin-left: auto;
10
+ margin-right: auto;
11
+ }
12
+
13
+ .wc-availability--fixed {
14
+ position: fixed;
15
+ bottom: 0;
16
+ left: 0;
17
+ right: 0;
18
+ padding-left: 15px;
19
+ padding-right: 15px;
20
+ border: 1px solid transparent;
21
+ @media (forced-colors: active) {
22
+ border-color: currentColor;
23
+ }
24
+
25
+ @include mq ($from: 'tablet') {
26
+ padding-left: 30px;
27
+ padding-right: 30px;
28
+ }
29
+
30
+ background-color: govuk-colour('light-grey');
31
+
32
+ .wc-availability__link {
33
+ margin-top: 10px;
34
+ margin-bottom: 10px;
35
+ }
36
+ }
37
+
38
+ .wc-availability__link {
39
+ @extend %govuk-link;
40
+ display: inline-block;
41
+ @include govuk-font($size: 19);
42
+ margin-right: 5px;
43
+
44
+ &:visited:not(:hover):not(:focus) {
45
+ color: govuk-colour('blue');
46
+ }
47
+
48
+ .govuk-visually-hidden, .wc-availability__unseen {
49
+ pointer-events: none;
50
+ }
51
+
52
+ &:hover:not(:focus):not(:active) .wc-availability__unseen {
53
+ background-color: govuk-colour('dark-blue');
54
+ }
55
+ }
56
+
57
+ .wc-availability__unseen {
58
+ display: inline-block;
59
+ position: relative;
60
+ border: 1px solid transparent;
61
+ @media (forced-colors: active) {
62
+ border-color: currentColor;
63
+ }
64
+ border-radius: 10px;
65
+ background-color: govuk-colour('black');
66
+ color: govuk-colour('white');
67
+ font-weight: bold;
68
+ font-size: 14px;
69
+ padding: 0 6px;
70
+ margin-left: 5px;
71
+
72
+ @include mq ($from: tablet) {
73
+ top: -1px;
74
+ padding-left: 7px;
75
+ padding-right: 7px;
76
+ }
77
+ }
@@ -0,0 +1,259 @@
1
+ @keyframes blink {
2
+ 50% {
3
+ fill: transparent
4
+ }
5
+ }
6
+
7
+ .wc-status {
8
+ display: flex;
9
+ position: relative;
10
+ padding: 15px;
11
+ @include mq ($from: tablet) {
12
+ padding: 10px;
13
+ }
14
+
15
+ &::after {
16
+ position: absolute;
17
+ content: "";
18
+ bottom: 0;
19
+ left: 15px;
20
+ right: 15px;
21
+ height: 0;
22
+ border-bottom: 1px solid $govuk-border-colour;
23
+ @include mq ($from: tablet) {
24
+ left: 10px;
25
+ right: 10px;
26
+ }
27
+ }
28
+
29
+ &__availability {
30
+ font-size: 16px;
31
+ margin-bottom: 0;
32
+ }
33
+
34
+ &__link{
35
+ @extend %wc-link-button;
36
+ margin-left: auto;
37
+
38
+ &:link {
39
+ color: govuk-colour('black');
40
+ }
41
+ }
42
+ }
43
+
44
+ .wc-body[tabindex="0"]:focus-visible {
45
+ outline: 3px solid transparent;
46
+ outline-offset: -2px;
47
+ box-shadow:
48
+ inset 0 0 0 2px $govuk-focus-colour,
49
+ inset 0 0 0 4px govuk-colour('black'),
50
+ 0 0 0 1px $govuk-focus-colour;
51
+ }
52
+
53
+ .wc-chat {
54
+ @extend %govuk-body-s;
55
+ line-height: 1.25;
56
+ font-size: 14px;
57
+ overflow: auto;
58
+ list-style: none;
59
+ padding: 0;
60
+
61
+ &__message {
62
+ margin: 5px 15px 0;
63
+ max-width: 80%;
64
+ width: fit-content;
65
+
66
+ &.inbound {
67
+ margin-left: auto;
68
+ }
69
+
70
+ @include mq ($from: tablet) {
71
+ margin-left: 10px;
72
+ margin-right: 10px;
73
+ }
74
+
75
+ &:first-child {
76
+ padding-top: 15px;
77
+ }
78
+ }
79
+
80
+ &__from {
81
+ line-height: 1.25;
82
+ color: govuk-colour('dark-grey');
83
+ margin-top: 2px;
84
+ margin-bottom: 2px;
85
+
86
+ .inbound {
87
+ display: block;
88
+ text-align: right;
89
+ }
90
+ }
91
+
92
+ &__text {
93
+ font-size: 16px;
94
+ padding: 10px 12.5px;
95
+ margin-bottom: 0;
96
+ display: inline-block;
97
+ border: 1px solid transparent;
98
+ overflow-wrap: anywhere;
99
+
100
+ @media (forced-colors: active) {
101
+ border-color: currentColor;
102
+ }
103
+
104
+ &.inbound {
105
+ color: govuk-colour('white');
106
+ background-color: govuk-colour('blue');
107
+ border-radius: 10px 0 10px 10px;
108
+
109
+ .govuk-link:link,
110
+ .govuk-link:visited {
111
+ color: govuk-colour('white');
112
+ }
113
+
114
+ .govuk-link:focus {
115
+ color: govuk-colour('black');
116
+ }
117
+ }
118
+
119
+ &.outbound {
120
+ background-color: govuk-colour('light-grey');
121
+ border-radius: 0 10px 10px;
122
+ }
123
+
124
+ svg {
125
+ display: block;
126
+ color: govuk-colour('dark-grey');
127
+ }
128
+
129
+ @media (forced-colors: active) {
130
+ svg {
131
+ color: currentColor;
132
+ }
133
+ }
134
+
135
+
136
+ svg circle {
137
+ animation: 1s blink infinite;
138
+ fill: currentColor;
139
+
140
+ &:nth-child(2) {
141
+ animation-delay: 250ms
142
+ }
143
+
144
+ &:nth-child(3) {
145
+ animation-delay: 500ms
146
+ }
147
+ }
148
+ }
149
+ }
150
+
151
+ .wc-form {
152
+ position: relative;
153
+ display: flex;
154
+ flex-wrap: nowrap;
155
+ align-items: baseline;
156
+ border-top: 1px solid govuk-colour('black');
157
+ border-bottom: 1px solid govuk-colour('black');
158
+
159
+ &__label {
160
+ position: absolute;
161
+ pointer-events: none;
162
+ font-size: 16px;
163
+ line-height: 20px;
164
+ margin: 20px;
165
+ @include mq ($from: tablet) {
166
+ margin: 18px 18px 19px;
167
+ }
168
+ left: 0;
169
+ bottom: 0;
170
+ color: $govuk-secondary-text-colour;
171
+ z-index: 3;
172
+ }
173
+
174
+ &__textarea {
175
+ @extend %govuk-body-s;
176
+ box-sizing: border-box;
177
+ min-height: auto;
178
+ font-size: 16px;
179
+ line-height: 20px;
180
+ max-height: 120px;
181
+ flex: 1 1 auto;
182
+ align-self: flex-end;
183
+ margin: 20px;
184
+ @include mq ($from: tablet) {
185
+ margin: 18px 18px 19px;
186
+ }
187
+ padding: 0;
188
+ border: 0;
189
+ height: 20px;
190
+ resize: none;
191
+ overflow-x: hidden;
192
+ overscroll-behavior: contain;
193
+
194
+ &:focus {
195
+ outline: none;
196
+ box-shadow: none;
197
+ z-index: 2;
198
+ }
199
+ }
200
+
201
+ &__button {
202
+ margin: 10px 15px 12px 0;
203
+ @include mq ($from: tablet) {
204
+ margin-right: 10px;
205
+ }
206
+ font-size: 16px;
207
+ position: relative;
208
+ flex: 0 0 auto;
209
+ align-self: flex-end;
210
+ display: flex;
211
+ flex-direction: row;
212
+ flex-wrap: nowrap;
213
+ align-items: center;
214
+ width: auto;
215
+ cursor: pointer;
216
+ }
217
+
218
+ &.wc-focus-within::after {
219
+ @include focus($glow: 5px, $strong: 2px, $background: 0, $inset: 0);
220
+ left: 4px;
221
+ right: 4px;
222
+ top: 4px;
223
+ bottom: 4px;
224
+ }
225
+ }
226
+
227
+ .wc-body:focus-visible + .wc-footer .wc-form {
228
+ border-top: 1px solid transparent;
229
+ }
230
+
231
+ .wc-footer {
232
+ position: relative;
233
+ flex: 0 0 0;
234
+
235
+ &__settings {
236
+ @include govuk-responsive-padding(2);
237
+
238
+ display: flex;
239
+ flex-direction: row;
240
+
241
+ &-link {
242
+ @extend %wc-link-button;
243
+
244
+ &:first-child {
245
+ margin-right: govuk-spacing(3);
246
+ }
247
+
248
+ &:link {
249
+ color: govuk-colour('black');
250
+ }
251
+ }
252
+ }
253
+
254
+ &__input {
255
+ @include govuk-responsive-padding(2);
256
+
257
+ border-top: 1px solid govuk-colour('black');
258
+ }
259
+ }
@@ -0,0 +1,112 @@
1
+ .wc-panel {
2
+ display: flex;
3
+ position: fixed;
4
+ flex-wrap: nowrap;
5
+ z-index: 999;
6
+ top: 0;
7
+ right: 0;
8
+ bottom: 0;
9
+ left: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ -webkit-overflow-scrolling: touch;
13
+ touch-action: pan-x pan-y;
14
+ background-color: #ffffff;
15
+ @include mq ($from: tablet) {
16
+ top: auto;
17
+ left: auto;
18
+ width: 400px;
19
+ height: 540px;
20
+ margin-right: 10px;
21
+ margin-bottom: 10px;
22
+ }
23
+
24
+ &:focus {
25
+ outline: none;
26
+ }
27
+
28
+ &:focus.wc-focus-visible::after {
29
+ @include focus($glow: 5px, $strong: 2px, $background: 0, $inset: 0);
30
+ left: 4px;
31
+ right: 4px;
32
+ top: 4px;
33
+ bottom: 4px;
34
+ }
35
+
36
+ &__inner {
37
+ position: relative;
38
+ flex: 0 0 100%;
39
+ display: flex;
40
+ flex-wrap: nowrap;
41
+ flex-direction: column;
42
+ background-color: transparent;
43
+ border: 0;
44
+ outline: 0;
45
+ @include mq ($from: tablet) {
46
+ border: 1px solid govuk-colour('black');
47
+ }
48
+ box-sizing: border-box;
49
+ }
50
+ }
51
+
52
+ .wc-header {
53
+ display: flex;
54
+ flex-direction: row;
55
+ align-items: center;
56
+ background-color: govuk-colour('black');
57
+ border-bottom: 1px solid govuk-colour('black');
58
+ padding: 3px;
59
+
60
+ &__link {
61
+ margin: 0 govuk-spacing(2);
62
+ }
63
+
64
+ &__title {
65
+ @extend %govuk-heading-s;
66
+ font-size: 19px;
67
+ padding: 0 0 0 10px;
68
+ @include mq ($from: tablet) {
69
+ padding-left: 7px;
70
+ }
71
+ color: govuk-colour('white');
72
+ margin-bottom: 0;
73
+ }
74
+
75
+ &__close,
76
+ &__hide,
77
+ &__back {
78
+ display: flex;
79
+ justify-content: center;
80
+ color: govuk-colour('white');
81
+ background: none;
82
+ border: 0;
83
+ padding: 7px;
84
+ margin: 0 0 0 auto;
85
+ cursor: pointer;
86
+
87
+ &:focus {
88
+ outline: 3px solid $govuk-focus-colour;
89
+ }
90
+ }
91
+
92
+ &__back {
93
+ margin: 0;
94
+ display: flex;
95
+
96
+ @include mq ($from: 'tablet') {
97
+ display: none
98
+ }
99
+ }
100
+ }
101
+
102
+ .wc-body {
103
+ font-size: 16px;
104
+ flex: 1;
105
+ position: relative;
106
+ overflow-y: auto;
107
+ overscroll-behavior: contain;
108
+ }
109
+
110
+ .wc-content {
111
+ padding: 20px 15px;
112
+ }
@@ -0,0 +1,33 @@
1
+ %wc-link-button {
2
+ @extend %govuk-link;
3
+ position: relative;
4
+ display: inline-block;
5
+ font-size: 16px;
6
+ color: govuk-colour('black');
7
+
8
+ &:hover {
9
+ color: govuk-colour('black');
10
+ }
11
+
12
+ &:visited:not(:hover):not(:focus) {
13
+ color: govuk-colour('black');
14
+ }
15
+
16
+ &:active {
17
+ color: govuk-colour('black');
18
+ }
19
+
20
+ &:focus {
21
+ box-shadow: none;
22
+ background-color: transparent;
23
+ text-decoration: underline;
24
+ color: govuk-colour('black');
25
+ }
26
+
27
+ &:focus-visible {
28
+ background-color: $govuk-focus-colour;
29
+ box-shadow: 0 -2px $govuk-focus-colour, 0 4px govuk-colour('black');
30
+ text-decoration: none;
31
+ color: govuk-colour('black');
32
+ }
33
+ }
@@ -0,0 +1,101 @@
1
+ .wc-heading {
2
+ @extend %govuk-heading-m;
3
+ font-size: 19px;
4
+ margin-bottom: 15px;
5
+ }
6
+
7
+ .wc-list {
8
+ @extend %govuk-list;
9
+ @extend %govuk-list--bullet;
10
+ font-size: 16px;
11
+ line-height: 1.25;
12
+ }
13
+
14
+ .wc-body p {
15
+ font-size: 16px;
16
+ line-height: 1.25;
17
+ margin-bottom: 15px;
18
+ @extend %govuk-body-s;
19
+ }
20
+
21
+ .wc-body .govuk-error-message {
22
+ color: govuk-colour('red');
23
+ font-weight: 700;
24
+ }
25
+
26
+ .wc-link,
27
+ .wc-button,
28
+ .govuk-button-group .wc-button,
29
+ .govuk-button-group .wc-link {
30
+ font-size: 16px;
31
+ }
32
+
33
+ .wc-button[aria-disabled="true"] {
34
+ cursor: not-allowed;
35
+ opacity: 0.5;
36
+ }
37
+
38
+ .wc-label {
39
+ font-size: 16px;
40
+ line-height: 1.25;
41
+ }
42
+
43
+ .wc-form-group {
44
+ margin-bottom: 15px;
45
+ }
46
+
47
+ .wc-hint {
48
+ font-size: 16px;
49
+ line-height: 1.25;
50
+ }
51
+
52
+ .wc-inset-text {
53
+ margin: 0 0 20px;
54
+ padding: 5px 5px 5px 15px;
55
+ font-size: 16px;
56
+ border-left-width: 5px;
57
+ }
58
+
59
+ .wc-error-summary__title {
60
+ font-size: 19px;
61
+ line-height: 1.25;
62
+ margin-bottom: 15px;
63
+ }
64
+
65
+ .wc-error-summary__list,
66
+ .wc-error-message {
67
+ font-size: 16px;
68
+ line-height: 1.25;
69
+ }
70
+
71
+ .wc-input, .wc-textarea {
72
+ font-size: 16px;
73
+ line-height: 1.25;
74
+ }
75
+
76
+ .wc-back-link {
77
+ font-size: 16px;
78
+ line-height: 1.25;
79
+ margin: 0 0 25px;
80
+ }
81
+
82
+ // stylelint-disable declaration-no-important
83
+ .wc-live {
84
+ position: absolute !important;
85
+ width: 1px !important;
86
+ height: 1px !important;
87
+ margin: 0 !important;
88
+ padding: 0 !important;
89
+ overflow: hidden !important;
90
+ clip: rect(0 0 0 0) !important;
91
+ -webkit-clip-path: inset(50%) !important;
92
+ clip-path: inset(50%) !important;
93
+ border: 0 !important;
94
+ white-space: nowrap !important;
95
+
96
+ &::before,
97
+ &::after {
98
+ content: ' ';
99
+ }
100
+ }
101
+ // stylelint-enable declaration-no-important
@@ -0,0 +1,33 @@
1
+ // Check there is ot already similar functinality in GOV.UK Frontend
2
+
3
+ @mixin defra-visually-hidden() {
4
+ position: absolute;
5
+ width: 1px;
6
+ height: 1px;
7
+ margin: 0;
8
+ padding: 0;
9
+ overflow: hidden;
10
+ clip: rect(0 0 0 0);
11
+ -webkit-clip-path: inset(50%);
12
+ clip-path: inset(50%);
13
+ border: 0;
14
+ white-space: nowrap;
15
+ }
16
+
17
+ // Map specific mixins
18
+ @mixin focus($glow: 8px, $strong: 5px, $background: 2px, $inset: 0) {
19
+ position:absolute;
20
+ content:'';
21
+ left: 5px;
22
+ right: 5px;
23
+ top: 5px;
24
+ bottom: 5px;
25
+ box-shadow:
26
+ 0 0 0 $background #ffffff,
27
+ inset 0 0 0 $inset govuk-colour('black'),
28
+ 0 0 0 $strong govuk-colour('black'),
29
+ 0 0 0 $glow $govuk-focus-colour;
30
+ outline: 3px solid transparent;
31
+ pointer-events: none;
32
+ z-index: 99;
33
+ }
@@ -0,0 +1,25 @@
1
+ .wc-u-html {
2
+ @include mq ($until: tablet) {
3
+ height: 100vh;
4
+ overflow: hidden;
5
+ }
6
+ }
7
+
8
+ .wc-u-body {
9
+ @include mq ($until: tablet) {
10
+ position: fixed;
11
+ overflow: hidden;
12
+ top:0;
13
+ right:0;
14
+ bottom:0;
15
+ left:0;
16
+ }
17
+ }
18
+
19
+ .wc-u-hidden {
20
+ visibility: hidden;
21
+ }
22
+
23
+ .wc-u-scroll-padding {
24
+ scroll-padding-bottom: calc(2rem + 20px);
25
+ }
package/webpack.prod.mjs DELETED
@@ -1,7 +0,0 @@
1
- import { merge } from 'webpack-merge'
2
-
3
- import common from './webpack.config.mjs'
4
-
5
- export default merge(common, {
6
- mode: 'production'
7
- })