@defra/flood-webchat 0.0.1-alpha.7 → 0.0.1-alpha.8

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/main.scss CHANGED
@@ -1,751 +1,3 @@
1
-
2
- // Tools
3
- @import "./src/style/mixins";
4
-
5
- // Objects
6
- @import "demo/client/buttons";
7
-
8
- .js-enabled[data-wc-unsupported] {
9
- display: none;
10
- }
11
-
12
- .wc-html {
13
- @include mq ($until: tablet) {
14
- height: 100vh;
15
- overflow: hidden;
16
- }
17
- }
18
-
19
- .wc-body {
20
- @include mq ($until: tablet) {
21
- position: fixed;
22
- overflow: hidden;
23
- inset:0;
24
- }
25
- }
26
-
27
- .wc-scroll-padding {
28
- scroll-padding-bottom: calc(2rem + 20px);
29
- }
30
-
31
- .wc-hidden {
32
- visibility: hidden;
33
- }
34
-
35
- .wc-live {
36
- @extend .govuk-visually-hidden;
37
- }
38
-
39
- .wc {
40
- display: none;
41
- position: fixed;
42
- flex-wrap: nowrap;
43
- z-index: 999;
44
- inset: 0;
45
- padding: 0;
46
- box-sizing: border-box;
47
-
48
- // overflow: auto;
49
- -webkit-overflow-scrolling: touch;
50
- touch-action: pan-x pan-y;
51
- background-color: govuk-colour('white');
52
-
53
- @include mq ($from: tablet) {
54
- top: auto;
55
- left: auto;
56
- width: 400px;
57
- height: 540px;
58
-
59
- // padding: 10px;
60
- margin-right: 10px;
61
- margin-bottom: 10px;
62
- }
63
-
64
- &:focus {
65
- outline: none;
66
- }
67
-
68
- &:focus.wc-focus-visible::after {
69
- @include wc-focus($glow: 5px, $strong: 2px, $background: 0, $inset: 0);
70
-
71
- inset: 4px;
72
- }
73
- }
74
-
75
- .wc--open {
76
- display: flex;
77
- }
78
-
79
- .wc__inner {
80
- position: relative;
81
- flex: 0 0 100%;
82
- display: flex;
83
- flex-flow: column nowrap;
84
-
85
- // background-color: white;
86
- background-color: transparent;
87
- border: 0;
88
- outline: 0;
89
-
90
- @include mq ($from: tablet) {
91
- border: 1px solid govuk-colour('black');
92
- }
93
-
94
- box-sizing: border-box;
95
- }
96
-
97
- .wc__header {
98
- flex: 0 0 0;
99
- }
100
-
101
- .wc__body {
102
- flex: 1 1 auto;
103
- overflow-y: auto;
104
- overscroll-behavior: contain;
105
- position: relative;
106
-
107
- &:focus {
108
- outline: none;
109
- }
110
-
111
- &:focus.wc-focus-visible {
112
- outline: 3px solid transparent;
113
- outline-offset: -2px;
114
- box-shadow:
115
- inset 0 0 0 2px $govuk-focus-colour,
116
- inset 0 0 0 4px govuk-colour('black'),
117
- 0 0 0 1px $govuk-focus-colour;
118
-
119
- // z-index: 2;
120
- }
121
-
122
- &:focus.wc-focus-visible + .wc__footer .wc-message {
123
- border-top: 1px solid transparent;
124
- }
125
- }
126
-
127
- .wc__footer {
128
- flex: 0 0 0;
129
- position: relative;
130
- }
131
-
132
- .wc-settings {
133
- padding-left: 5px;
134
- padding-right: 5px;
135
- }
136
-
137
- .wc-visibility-hidden {
138
- @include mq ($until: tablet) {
139
- visibility: hidden;
140
- }
141
- }
142
-
143
- // Header
144
- .wc-header {
145
- display: flex;
146
- flex-flow: row nowrap;
147
- align-items: center;
148
- background-color: govuk-colour('black');
149
- border-bottom: 1px solid govuk-colour('black');
150
- padding: 3px;
151
- }
152
-
153
- .wc-status {
154
- position: relative;
155
- display: flex;
156
- flex-direction: row;
157
- justify-content: space-between;
158
- padding: 15px;
159
- align-items: center;
160
-
161
- &::after {
162
- position: absolute;
163
- content: '';
164
- bottom: 0;
165
- left: 15px;
166
- right: 15px;
167
- height: 0;
168
- border-bottom: 1px solid govuk-colour('mid-grey');
169
- }
170
-
171
- @include mq ($from: tablet) {
172
- padding: 10px;
173
-
174
- &::after {
175
- left: 10px;
176
- right: 10px;
177
- }
178
- }
179
- }
180
-
181
- .wc-status__content {
182
- @extend .govuk-body;
183
-
184
- flex: 1 1 auto;
185
- margin: 0;
186
- font-size: 16px;
187
- line-height: 1.3158;
188
- }
189
-
190
- .wc-status__button {
191
- flex: 0 0 auto;
192
- }
193
-
194
- .wc-status__meta {
195
- display: block;
196
- font-size: 16px;
197
- color: govuk-colour('dark-grey');
198
- }
199
-
200
- // Pre and post chat
201
- .wc-content {
202
- padding: 20px 15px;
203
-
204
- .govuk-form-group {
205
- margin-bottom: 15px;
206
- }
207
-
208
- .govuk-label,
209
- .govuk-fieldset__legend,
210
- .wc-hint {
211
- font-size: 16px;
212
- }
213
-
214
- .govuk-label + p {
215
- margin-bottom: 10px;
216
- }
217
-
218
- .wc-message__textbox {
219
- margin-bottom: 5px !important;
220
- }
221
-
222
- .wc-textarea-question {
223
- resize: none;
224
- }
225
-
226
- .wc-textarea--error {
227
- @extend .govuk-textarea--error;
228
- }
229
-
230
- p, ul {
231
- font-size: 16px;
232
- margin-bottom: 15px;
233
- }
234
-
235
- .govuk-heading-m,
236
- .govuk-error-summary__title {
237
- @include mq ($from: 'tablet') {
238
- font-size: 19px;
239
- margin-bottom: 15px;
240
- }
241
- }
242
-
243
- .govuk-checkboxes label {
244
- @include mq ($from: 'tablet') {
245
- font-size: 16px;
246
- }
247
- }
248
- }
249
-
250
- // Message list
251
- .wc-list {
252
- @extend .govuk-list;
253
-
254
- display: flex;
255
- flex-flow: column nowrap;
256
- font-size: 16px;
257
- line-height: 20px;
258
- margin: 0;
259
- padding: 0;
260
- position: relative;
261
-
262
- // z-index: -1;
263
- .govuk-heading-m {
264
- @include mq ($from: 'tablet') {
265
- font-size: 18px;
266
- margin-bottom: 15px;
267
- }
268
- }
269
-
270
- > li {
271
- margin-bottom: 0;
272
- }
273
-
274
- &__item {
275
- display: block;
276
- flex: 0 0 auto;
277
- max-width: 75%;
278
- margin: 0 15px;
279
- padding: 5px 0 0;
280
-
281
- @include mq ($from: 'tablet') {
282
- margin-left: 10px;
283
- margin-right: 10px;
284
- }
285
- }
286
-
287
- &__item-inner {
288
- display: inline-block;
289
- padding: 10px 12.5px;
290
- background-color: govuk-colour('light-grey');
291
- border-radius: 10px;
292
- word-break: break-word;
293
- white-space: pre-line;
294
- backface-visibility: hidden;
295
- }
296
-
297
- @keyframes blink {
298
- 50% {
299
- fill: transparent
300
- }
301
- }
302
-
303
- &__item-inner svg {
304
- display: block;
305
- color: govuk-colour('dark-grey');
306
-
307
- circle {
308
- animation: 1s blink infinite;
309
- fill: currentcolor;
310
- }
311
-
312
- circle:nth-child(2) {
313
- animation-delay: 250ms
314
- }
315
-
316
- circle:nth-child(3) {
317
- animation-delay: 500ms
318
- }
319
- }
320
-
321
- &__item:first-child {
322
- padding-top: 15px;
323
- }
324
-
325
- &__item:last-child {
326
- padding-bottom: 15px;
327
- }
328
-
329
- &__item--inbound {
330
- align-self: flex-end;
331
- }
332
-
333
- &__item--outbound {
334
- align-self: flex-start;
335
- }
336
-
337
- &__item--inbound &__item-inner {
338
- background-color: govuk-colour('blue');
339
- color: govuk-colour('white');
340
- border-top-right-radius: 0;
341
-
342
- a:not(:focus), a:visited:not(:focus) {
343
- color: govuk-colour('white');
344
- }
345
- }
346
-
347
- &__item--outbound &__item-inner {
348
- border-top-left-radius: 0;
349
- }
350
-
351
- &__item-meta {
352
- display: block;
353
-
354
- @include govuk-font($size: 14);
355
-
356
- color: $govuk-secondary-text-colour;
357
- font-size: 14px;
358
- margin-top: 2px;
359
- margin-bottom: 2px;
360
- }
361
-
362
- &__item--inbound &__item-meta {
363
- text-align: right;
364
- }
365
- }
366
-
367
- .wc-title {
368
- @extend .govuk-heading-s;
369
-
370
- margin: 0 0 0 7px;
371
- font-size: 19px;
372
- flex: 1 1 auto;
373
- position: relative;
374
- color: govuk-colour('white');
375
- }
376
-
377
- .wc-back-link {
378
- @extend .govuk-back-link;
379
-
380
- margin: 0 0 30px;
381
- }
382
-
383
- .wc-inset-text {
384
- @extend .govuk-inset-text;
385
-
386
- font-size: 16px;
387
- border-left-width: 5px;
388
- padding-top: 5px;
389
- padding-bottom: 5px;
390
- margin-top: 20px;
391
- margin-bottom: 30px;
392
- }
393
-
394
- .wc-back-btn,
395
- .wc-hide-btn,
396
- .wc-close-btn {
397
- display: block;
398
- flex: 0 0 auto;
399
-
400
- // align-self: flex-end;
401
- font-size: 16px;
402
- color: govuk-colour('white');
403
- background-color: transparent;;
404
- border: 0 solid transparent;
405
- padding: 7px;
406
- margin: 0 0 0 auto;
407
- cursor: pointer;
408
-
409
- &:focus {
410
- outline: none;
411
- }
412
-
413
- &:focus.wc-focus-visible {
414
- outline: 3px solid $govuk-focus-colour;
415
- }
416
-
417
- svg {
418
- position: relative;
419
- color: govuk-colour('white');
420
- vertical-align: middle;
421
- pointer-events: none;
422
- }
423
- }
424
-
425
- .wc-back-btn {
426
- margin-right: -7px;
427
-
428
- @include mq ($from: 'tablet') {
429
- display: none;
430
- }
431
- }
432
-
433
- .wc-hide-btn,
434
- .wc-close-btn {
435
- @include mq ($until: 'tablet') {
436
- display: none;
437
- }
438
- }
439
-
440
- .wc-start-btn,
441
- .wc-submit-btn,
442
- .wc-confirm-end-btn,
443
- .wc-submit-feedback-btn,
444
- .wc-feedback-btn {
445
- @extend .govuk-button;
446
-
447
- font-size: 16px;
448
-
449
- &:focus:not(:active):not(:hover) {
450
- background-color: govuk-colour('green');
451
- border-color: govuk-colour('green');
452
- color: govuk-colour('white');
453
- }
454
-
455
- &:focus:not(:active):hover {
456
- border-color: transparent;
457
- box-shadow: 0 2px 0 govuk-colour('black');
458
- }
459
-
460
- &.wc-focus-visible:focus:not(:active) {
461
- border-color: $govuk-focus-colour;
462
- color: govuk-colour('black');
463
- background-color: $govuk-focus-colour;
464
- box-shadow: 0 2px 0 govuk-colour('black');
465
- }
466
- }
467
-
468
- .wc-message {
469
- position: relative;
470
- display: flex;
471
- flex-wrap: nowrap;
472
- align-items: baseline;
473
- border-top: 1px solid govuk-colour('black');
474
- border-bottom: 1px solid govuk-colour('black');
475
-
476
- &.wc-focus-visible::after {
477
- @include wc-focus($glow: 5px, $strong: 2px, $background: 0, $inset: 0);
478
-
479
- inset: 4px;
480
- }
481
-
482
- &__label {
483
- position: absolute;
484
- pointer-events: none;
485
-
486
- @extend .govuk-body;
487
-
488
- font-size: 16px;
489
- line-height: 20px;
490
- margin: 20px;
491
-
492
- @include mq ($from: 'tablet') {
493
- margin: 18px 18px 19px;
494
- }
495
-
496
- left: 0;
497
- bottom: 0;
498
- color: govuk-colour('dark-grey');
499
- z-index: 3;
500
- }
501
-
502
- &__label--hidden {
503
- @extend .govuk-visually-hidden;
504
- }
505
-
506
- &__textbox {
507
- @extend .govuk-textarea;
508
-
509
- box-sizing: border-box;
510
- min-height: auto;
511
- font-size: 16px;
512
- line-height: 20px;
513
- max-height: 120px;
514
- flex: 1 1 auto;
515
- align-self: flex-end;
516
- margin: 20px;
517
-
518
- @include mq ($from: 'tablet') {
519
- margin: 18px 18px 19px;
520
- }
521
-
522
- padding: 0;
523
- border: 0;
524
- height: 20px;
525
- resize: none;
526
- overflow-x: hidden;
527
- overscroll-behavior: contain;
528
-
529
- &:focus {
530
- outline: none;
531
- box-shadow: none;
532
- z-index: 2;
533
- }
534
- }
535
-
536
- &__send {
537
- @extend .govuk-button;
538
-
539
- margin: 10px 15px 12px 0;
540
-
541
- @include mq ($from: 'tablet') {
542
- margin-right: 10px;
543
- }
544
-
545
- font-size: 16px;
546
- position: relative;
547
- flex: 0 0 auto;
548
- align-self: flex-end;
549
- display: flex;
550
- flex-flow: row nowrap;
551
- align-items: center;
552
- width: auto;
553
- cursor: pointer;
554
-
555
- svg {
556
- display: block;
557
- color: govuk-colour('white');
558
- pointer-events: none;
559
- margin-left: 5px;
560
- }
561
- }
562
- }
563
-
564
- .wc-credit {
565
- display: none;
566
-
567
- @include govuk-font($size: 14);
568
-
569
- color: $govuk-secondary-text-colour;
570
- padding: 0 10px 5px;
571
- }
572
-
573
- .wc-end-btn,
574
- .wc-transcript-btn,
575
- .wc-audio-btn,
576
- .wc-settings-btn {
577
- display: inline-block;
578
- color: $govuk-text-colour !important;
579
- margin: 10px 5px;
580
- }
581
-
582
- .wc-audio-btn span {
583
- pointer-events: none;
584
- }
585
-
586
- .wc-end-btn {
587
- font-size: 16px;
588
- margin: 0;
589
- width: auto;
590
- }
591
-
592
- .wc-link__inner {
593
- max-width: 960px;
594
- margin-left: auto;
595
- margin-right: auto;
596
- }
597
-
598
- .wc-link--fixed {
599
- position: fixed;
600
- bottom: 0;
601
- left: 0;
602
- right: 0;
603
- padding-left: 15px;
604
- padding-right: 15px;
605
-
606
- @include mq ($from: 'tablet') {
607
- padding-left: 30px;
608
- padding-right: 30px;
609
- }
610
-
611
- background-color: govuk-colour('light-grey');
612
-
613
- .wc-open-btn {
614
- margin-top: 10px;
615
- margin-bottom: 10px;
616
- }
617
- }
618
-
619
- .wc-link--hidden {
620
- display:none;
621
- }
622
-
623
- .wc-open-btn {
624
- @extend .defra-link-icon;
625
-
626
- margin-bottom: 0;
627
-
628
- &:visited {
629
- color: $govuk-link-colour;
630
- }
631
-
632
- span {
633
- pointer-events: none;
634
- }
635
-
636
- svg {
637
- @include mq ($from: 'tablet') {
638
- top: 3px;
639
- }
640
-
641
- color: govuk-colour('black');
642
- pointer-events: none;
643
- }
644
-
645
- &:focus {
646
- box-shadow: none;
647
- background-color: transparent;
648
- text-decoration: underline;
649
- color: $govuk-focus-colour;
650
- }
651
-
652
- &:hover:not(:focus):not(:active) {
653
- color: $govuk-link-hover-colour;
654
-
655
- svg {
656
- color: govuk-colour('dark-blue');
657
- }
658
-
659
- .wc-open-btn__unseen {
660
- background-color: govuk-colour('dark-blue');
661
- }
662
- }
663
-
664
- &__unseen {
665
- display: inline-block;
666
- position: relative;
667
- border-radius: 10px;
668
- background-color: govuk-colour('black');
669
- color: govuk-colour('white');
670
- font-weight: bold;
671
- font-size: 14px;
672
- padding: 0 6px;
673
- margin-left: 5px;
674
-
675
- @include mq ($from: tablet) {
676
- top: -1px;
677
- padding-left: 7px;
678
- padding-right: 7px;
679
- }
680
- }
681
- }
682
-
683
- .wc-timeout {
684
- text-align: center;
685
- padding-bottom: 20px;
686
-
687
- &__inner {
688
- margin: 5px 10px;
689
- border-top: 1px solid govuk-colour('mid-grey');
690
- }
691
-
692
- &__message {
693
- position: relative;
694
- display: inline-block;
695
- margin: auto;
696
- background-color: govuk-colour('white');
697
- padding: 0 5px;
698
- top: -11px;
699
-
700
- @include govuk-font($size: 14);
701
-
702
- color: $govuk-secondary-text-colour;
703
- font-size: 14px;
704
- }
705
- }
706
-
707
- .wc-cancel-timeout-btn {
708
- @extend .defra-button-secondary;
709
- }
710
-
711
- // Overides
712
- .wc .govuk-character-count {
713
- margin-bottom: 0;
714
- }
715
-
716
- .wc .govuk-error-summary {
717
- margin-bottom: 30px;
718
- }
719
-
720
- .wc .govuk-error-summary__list {
721
- margin-bottom: 0;
722
-
723
- li:last-child {
724
- margin-bottom: 0;
725
- }
726
- }
727
-
728
- // Keyboard only focus helper
729
- .wc [hidden] {
730
- display: none !important;
731
- }
732
-
733
- [data-wc-focus-visible] {
734
- &:focus {
735
- box-shadow: none;
736
- background-color: transparent;
737
- text-decoration: underline;
738
- color: $govuk-link-colour;
739
- }
740
-
741
- &:active {
742
- color: govuk-colour('black');
743
- }
744
-
745
- &.wc-focus-visible:focus {
746
- background-color: $govuk-focus-colour;
747
- box-shadow: 0 -2px $govuk-focus-colour, 0 4px govuk-colour('black');
748
- text-decoration: none;
749
- color: govuk-colour('black');
750
- }
1
+ .defra-webchat-example {
2
+ color: blue;
751
3
  }