@iamproperty/components 2.7.9 → 2.9.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.
Files changed (138) hide show
  1. package/README.md +136 -136
  2. package/assets/css/core.min.css +1 -1
  3. package/assets/css/core.min.css.map +1 -1
  4. package/assets/css/email.min.css +1 -1
  5. package/assets/css/email.min.css.map +1 -1
  6. package/assets/css/error.min.css +1 -1
  7. package/assets/css/error.min.css.map +1 -1
  8. package/assets/css/style.min.css +1 -1
  9. package/assets/css/style.min.css.map +1 -1
  10. package/assets/js/modules/accordion.js +32 -36
  11. package/assets/js/modules/alert.js +56 -56
  12. package/assets/js/modules/carousel.js +101 -101
  13. package/assets/js/modules/chart.js +216 -216
  14. package/assets/js/modules/drawer.js +15 -15
  15. package/assets/js/modules/form.js +158 -158
  16. package/assets/js/modules/helpers.js +119 -119
  17. package/assets/js/modules/modal.js +89 -89
  18. package/assets/js/modules/nav.js +26 -26
  19. package/assets/js/modules/table.js +584 -584
  20. package/assets/js/modules/testimonial.js +82 -82
  21. package/assets/js/modules/youtubevideo.js +145 -145
  22. package/assets/js/scripts.bundle.js +163 -94
  23. package/assets/js/scripts.bundle.js.map +1 -1
  24. package/assets/js/scripts.bundle.min.js +2 -2
  25. package/assets/js/scripts.bundle.min.js.map +1 -1
  26. package/assets/sass/_components.scss +14 -14
  27. package/assets/sass/_corefiles.scss +40 -40
  28. package/assets/sass/_fonts.scss +16 -16
  29. package/assets/sass/_forms.scss +9 -9
  30. package/assets/sass/_func.scss +12 -10
  31. package/assets/sass/_functions/functions.scss +141 -141
  32. package/assets/sass/_functions/mixins.scss +170 -170
  33. package/assets/sass/_functions/utilities.scss +250 -250
  34. package/assets/sass/_functions/variables.scss +466 -462
  35. package/assets/sass/_print.scss +61 -61
  36. package/assets/sass/components/accordion.scss +197 -197
  37. package/assets/sass/components/alert.scss +98 -98
  38. package/assets/sass/components/cardDeck.scss +107 -107
  39. package/assets/sass/components/carousel.scss +234 -234
  40. package/assets/sass/components/charts.scss +569 -569
  41. package/assets/sass/components/drawer.scss +46 -46
  42. package/assets/sass/components/header.scss +63 -63
  43. package/assets/sass/components/modal.scss +136 -136
  44. package/assets/sass/components/nav.scss +916 -820
  45. package/assets/sass/components/property-searchbar.scss +143 -143
  46. package/assets/sass/components/snapshot.scss +70 -70
  47. package/assets/sass/components/stepper.scss +164 -164
  48. package/assets/sass/components/tabs.scss +87 -87
  49. package/assets/sass/components/testimonial.scss +132 -132
  50. package/assets/sass/components/timeline.scss +95 -95
  51. package/assets/sass/core.scss +6 -6
  52. package/assets/sass/elements/buttons.scss +209 -209
  53. package/assets/sass/elements/card.scss +177 -177
  54. package/assets/sass/elements/container.scss +225 -225
  55. package/assets/sass/elements/forms.scss +194 -194
  56. package/assets/sass/elements/links.scss +96 -96
  57. package/assets/sass/elements/lists.scss +112 -112
  58. package/assets/sass/elements/panel.scss +161 -161
  59. package/assets/sass/elements/tables.scss +290 -290
  60. package/assets/sass/elements/tooltips.scss +84 -84
  61. package/assets/sass/elements/type.scss +136 -136
  62. package/assets/sass/email.scss +65 -65
  63. package/assets/sass/error.scss +4 -4
  64. package/assets/sass/foundations/brand.scss +72 -72
  65. package/assets/sass/foundations/circles.scss +74 -74
  66. package/assets/sass/foundations/icons.scss +72 -72
  67. package/assets/sass/foundations/media.scss +50 -50
  68. package/assets/sass/foundations/reboot.scss +130 -130
  69. package/assets/sass/foundations/root.scss +106 -104
  70. package/assets/sass/main.scss +7 -7
  71. package/assets/svg/icons.svg +598 -588
  72. package/assets/svg/logo.svg +42 -42
  73. package/assets/{js/main.js → ts/main.ts} +68 -78
  74. package/assets/ts/modules/accordion.ts +43 -0
  75. package/dist/components.common.js +113 -89
  76. package/dist/components.common.js.map +1 -1
  77. package/dist/components.css +1 -1
  78. package/dist/components.css.map +1 -1
  79. package/dist/components.umd.js +147 -123
  80. package/dist/components.umd.js.map +1 -1
  81. package/dist/components.umd.min.js +1 -1
  82. package/dist/components.umd.min.js.map +1 -1
  83. package/package.json +108 -103
  84. package/src/components/Accordion/Accordion.vue +22 -22
  85. package/src/components/Accordion/AccordionItem.vue +52 -52
  86. package/src/components/Accordion/README.md +34 -34
  87. package/src/components/Alert/Alert.vue +39 -39
  88. package/src/components/Alert/README.md +28 -28
  89. package/src/components/Banner/Banner.vue +38 -38
  90. package/src/components/Banner/README.md +23 -23
  91. package/src/components/CardDeck/CardDeck.vue +77 -77
  92. package/src/components/CardDeck/README.md +24 -24
  93. package/src/components/Carousel/Carousel.vue +85 -85
  94. package/src/components/Carousel/README.md +19 -19
  95. package/src/components/Chart/Chart.vue +88 -88
  96. package/src/components/Chart/README.md +17 -17
  97. package/src/components/Drawer/Drawer.vue +53 -53
  98. package/src/components/Drawer/README.md +22 -22
  99. package/src/components/Header/Header.vue +38 -38
  100. package/src/components/Header/README.md +27 -27
  101. package/src/components/Modal/Modal.vue +43 -43
  102. package/src/components/Modal/README.md +19 -19
  103. package/src/components/Nav/Nav.vue +212 -189
  104. package/src/components/Nav/README.md +22 -22
  105. package/src/components/NoteFeed/NoteFeed.vue +79 -79
  106. package/src/components/NoteFeed/README.md +16 -16
  107. package/src/components/PropertySearchbar/PropertySearchbar.vue +204 -204
  108. package/src/components/PropertySearchbar/README.md +25 -25
  109. package/src/components/Snapshot/README.md +20 -20
  110. package/src/components/Snapshot/Snapshot.vue +32 -32
  111. package/src/components/Stepper/README.md +32 -32
  112. package/src/components/Stepper/Step.vue +28 -28
  113. package/src/components/Stepper/Stepper.vue +33 -33
  114. package/src/components/Tabs/README.md +27 -27
  115. package/src/components/Tabs/Tab.vue +26 -26
  116. package/src/components/Tabs/Tabs.vue +75 -75
  117. package/src/components/Testimonial/README.md +25 -25
  118. package/src/components/Testimonial/Testimonial.vue +60 -60
  119. package/src/components/Timeline/README.md +18 -18
  120. package/src/components/Timeline/Timeline.vue +24 -24
  121. package/src/elements/Card/Card.vue +113 -113
  122. package/src/elements/Card/README.md +24 -24
  123. package/src/elements/FileUploads/FileUploads.vue +48 -48
  124. package/src/elements/FileUploads/README.md +24 -24
  125. package/src/elements/Input/Input.vue +268 -268
  126. package/src/elements/Input/README.md +19 -19
  127. package/src/elements/Table/README.md +62 -62
  128. package/src/elements/Table/Table.vue +126 -129
  129. package/src/foundations/Icon/Icon.vue +24 -24
  130. package/src/foundations/Icon/README.md +11 -11
  131. package/src/foundations/Logo/Logo.vue +39 -39
  132. package/src/foundations/Logo/README.md +20 -20
  133. package/src/foundations/YoutubeVideo/README.md +11 -11
  134. package/src/foundations/YoutubeVideo/YoutubeVideo.vue +24 -24
  135. package/src/helpers/strings.js +12 -12
  136. package/src/index.js +27 -27
  137. package/assets/.DS_Store +0 -0
  138. package/src/.DS_Store +0 -0
@@ -1,569 +1,569 @@
1
- @use "../_func" as *;
2
-
3
- // #region Chart Colours
4
- $chart-colors: ();
5
- $chart-colors: map-merge((
6
- 1: --colour-primary,
7
- 2: --colour-secondary,
8
- 3: --colour-info,
9
- 4: --colour-warning,
10
- 5: --colour-dark,
11
- 6: --colour-light,
12
- 7: --colour-primary,
13
- 8: --colour-secondary,
14
- 9: --colour-info,
15
- 10: --colour-warning,
16
- ), $chart-colors);
17
-
18
- :root {
19
-
20
- @each $index, $value in $chart-colors {
21
- --colour-chart-#{$index}: var(#{$value});
22
- }
23
- }
24
-
25
- @media screen and (prefers-color-scheme: dark) {
26
- :root {
27
- --colour-chart-1: var(--colour-dark);
28
- --colour-chart-5: var(--colour-light);
29
- --colour-chart-6: var(--colour-dark);
30
- --colour-chart-7: var(--colour-secondary);
31
- }
32
- }
33
- // #endregion
34
-
35
- // #region Apply colours
36
- @for $i from 1 to 10 {
37
-
38
- .chart__key .key:not(:first-child):nth-child(#{$i+1}):before,
39
- .chart:not(.chart--none):not(.chart--pie) table tbody tr td:not(:first-child):nth-child(#{$i+1}) {
40
- background: var(#{'--colour-chart-'+$i});
41
- }
42
- .chart.chart--line:not(.chart--none):not(.chart--pie) .line:nth-child(#{$i}) {
43
- stroke: var(#{'--colour-chart-'+$i});
44
- z-index: #{10 - $i};
45
- }
46
- .chart.chart--pie .pie path:nth-child(#{$i}) {
47
- fill: var(#{'--colour-chart-'+$i});
48
- }
49
- }
50
- // #endregion
51
-
52
- // #region caption
53
- .chart__wrapper {
54
- figcaption {
55
- font-size: 1rem;
56
- margin-bottom: 2rem;
57
- display: block;
58
- }
59
- }
60
- // #endregion
61
-
62
- // #region Chart key
63
- .chart__key {
64
-
65
- padding-bottom: 2rem;
66
- margin-bottom: 0;
67
-
68
- &:before {
69
- content: "Key: ";
70
- display: inline-block;
71
- padding-right: 1.5rem;
72
- margin-bottom: 1rem;
73
- width: 100%;
74
-
75
- @include media-breakpoint-up(sm) {
76
-
77
- width: auto;
78
- }
79
- }
80
-
81
- .key {
82
- display: inline-block;
83
- padding-right: 1.5rem;
84
- margin-bottom: 1rem;
85
-
86
- &:before {
87
- content: "";
88
- height: 1em;
89
- width: 1em;
90
- margin-right: 0.25em;
91
- background: red;
92
- display: inline-block;
93
- vertical-align: middle;
94
- margin-bottom: 0.2em;
95
- }
96
-
97
- &:first-child {
98
- display: none;
99
- }
100
- }
101
- }
102
- // #endregion
103
-
104
- // #region Default bar chart (Also applies to line chart)
105
- .chart:not(.chart--none):not(.chart--pie) {
106
-
107
- --label-size: #{rem(12)};
108
- --chart-ratio: 56.25%;
109
-
110
- @include media-breakpoint-up(sm) {
111
-
112
- --chart-ratio: 42.86%; // 21:9 ratio
113
- }
114
-
115
- @include media-breakpoint-up(md) {
116
-
117
- --label-size: #{rem(14)};
118
- }
119
-
120
- display: flex;
121
- position: relative;
122
- margin-bottom: 2rem;
123
-
124
- .chart__yaxis {
125
- margin-bottom: 2rem;
126
- display: flex;
127
- flex-direction: column-reverse;
128
- width: 0;
129
-
130
- .axis__point {
131
-
132
- bottom: var(--percent);
133
- position: relative;
134
- height: 0;
135
- white-space: nowrap;
136
-
137
- &:not(:last-child){
138
- display: none;
139
- }
140
-
141
- span {
142
- display: block;
143
- transform: translate(0,-50%);
144
- padding-right: 0.25rem;
145
- text-align: right;
146
- font-size: var(--label-size);
147
- }
148
-
149
- &:last-child span {
150
-
151
- transform: translate(0,-100%);
152
- }
153
- }
154
-
155
- @include media-breakpoint-up(sm) {
156
-
157
- width: auto;
158
-
159
- .axis__point {
160
-
161
- &:not(:last-child){
162
- display: block;
163
- }
164
-
165
- &:last-child span {
166
-
167
- transform: translate(0,-50%);
168
- }
169
- }
170
- }
171
- }
172
-
173
- .chart__guidelines {
174
-
175
- position: absolute;
176
- top: 0;
177
- left: 0;
178
- width: 100%;
179
- height: calc(100% - 2rem);
180
- margin-bottom: 2rem;
181
- z-index: var(--index-below);
182
- display: flex;
183
- flex-direction: column-reverse;
184
-
185
- .guideline {
186
-
187
- bottom: var(--percent);
188
- position: absolute;
189
- right: 0;
190
- width: 100%;
191
- height: 0px;
192
- margin-bottom: -1px;
193
- border-bottom: 1px dashed #eeeeee;
194
- }
195
-
196
- [data-value="0"] {
197
- border-bottom: 1px solid var(--colour-primary);
198
-
199
- &:not(:first-child){
200
-
201
- border-bottom: 1px dashed var(--colour-primary);
202
- }
203
- }
204
- }
205
-
206
- .table__wrapper {
207
-
208
- padding-bottom: 2rem;
209
- padding-right: 0;
210
- margin: 0;
211
- overflow-x: visible;
212
- position: relative;
213
-
214
- table{
215
- overflow: visible;
216
- }
217
- }
218
-
219
- table {
220
- display: block;
221
- width: 100%;
222
- padding-top: var(--chart-ratio); // 16:9 ratio
223
- position: relative;
224
- margin-bottom: 0;
225
- //border-bottom: 1px solid black;
226
-
227
- thead {
228
- display: none;
229
- }
230
-
231
- tbody {
232
-
233
- display: flex;
234
- position: absolute;
235
- width: 100%;
236
- height: 100%;
237
- top: 0;
238
- left: 0;
239
- flex-direction: row;
240
- border: none;
241
- }
242
-
243
- tbody tr {
244
- display: flex;
245
- flex-direction: row;
246
- justify-content: center;
247
- align-items: flex-end;
248
- border: none;
249
- width: 100%;
250
- height: 100%;
251
- position: relative;
252
- padding: 0 5%;
253
-
254
- td:first-child {
255
- position: absolute;
256
- top: 100%;
257
- left: 50%;
258
- transform: translate(-50%,0);
259
- width: auto;
260
- padding: 0;
261
- white-space: nowrap;
262
- max-width: 120%;
263
- overflow: hidden;
264
- text-overflow: ellipsis;
265
- font-size: var(--label-size);
266
- display: none;
267
-
268
- @include media-breakpoint-up(md) {
269
- display: block;
270
- max-width: 95%;
271
- }
272
- }
273
-
274
- &:first-child td:first-child,
275
- &:last-child td:first-child {
276
-
277
- display: block;
278
- }
279
-
280
- td:not(:first-child) {
281
- height: 100%;
282
- height: var(--percent, 0%);
283
- bottom: var(--bottom,0%);
284
- width: 50%;
285
- max-width: 10rem;
286
- position: relative;
287
- background: green;
288
- padding: 0;
289
-
290
- &[data-label]:before {
291
- display: none;
292
- }
293
-
294
- span {
295
- position: absolute;
296
- bottom: 100%;
297
- left: 50%;
298
- font-size: var(--label-size);
299
- line-height: 1.2;
300
- transform: translate(-50%,0);
301
- background: var(--colour-info);
302
- opacity: 0;
303
- pointer-events: none;
304
- padding: 0.5rem;
305
- border-radius: 0.5rem;
306
- margin-bottom: 0.25rem;
307
- color: white;
308
- white-space: pre;
309
- text-align: center;
310
-
311
- &::before {
312
- content: attr(data-group) '\A' attr(data-label) ': ';
313
- }
314
- }
315
-
316
- &:hover span {
317
- opacity: 1;
318
- z-index: var(--index-above);
319
- }
320
- }
321
-
322
- &:first-child td:not(:first-child) span {
323
-
324
- left: -20%;
325
- transform: translate(0%,0);
326
- }
327
-
328
- &:last-child td:not(:first-child) span {
329
-
330
- left: 120%;
331
- transform: translate(-100%,0);
332
- }
333
-
334
- @include media-breakpoint-up(sm) {
335
-
336
- &:first-child td:not(:first-child) span,
337
- &:last-child td:not(:first-child) span {
338
-
339
- left: 50%;
340
- transform: translate(-50%,0);
341
- }
342
- }
343
-
344
- td:first-child {
345
- &[data-label]:before {
346
- display: none;
347
- }
348
- }
349
- }
350
- }
351
-
352
- .line,
353
- .pie {
354
- display: none;
355
- }
356
- }
357
- // #endregion
358
-
359
- // #region Stacked bar chart
360
- .chart:not(.chart--none):not(.chart--pie).chart--stacked {
361
- table tbody tr {
362
- flex-direction: column-reverse;
363
- justify-content: flex-start;
364
- align-items: center;
365
- }
366
- }
367
- // #endregion
368
-
369
- // #region Line chart
370
- .chart.chart--line:not(.chart--none):not(.chart--pie) {
371
-
372
- --line-thickness: 1px;
373
-
374
- @include media-breakpoint-up(sm) {
375
-
376
- --line-thickness: 0.8px;
377
- }
378
- @include media-breakpoint-up(md) {
379
-
380
- --line-thickness: 0.5px;
381
- }
382
-
383
- table tbody {
384
- justify-content: space-between;
385
-
386
- tr {
387
- width: 4rem;
388
- margin-left: -2rem;
389
- margin-right: -2rem;
390
- padding: 0;
391
-
392
-
393
- &:first-child td:first-child {
394
-
395
- transform: translate(0,0);
396
- display: block;
397
- }
398
- &:last-child td:first-child {
399
-
400
- left: 100%;
401
- transform: translate(-100%,0);
402
- display: block;
403
- }
404
-
405
- td:first-child {
406
- left: 50%!important;
407
- }
408
-
409
- td:not(:first-child) {
410
- position: absolute;
411
- left: 50%;
412
- bottom: var(--percent);
413
- height: 6px;
414
- width: 6px;
415
- margin-bottom: -3px;
416
- margin-left: -3px;
417
- border-radius: 3px;
418
- opacity: 0;
419
-
420
- &:hover {
421
- opacity: 1;
422
- }
423
- }
424
-
425
- &:hover {
426
- &:before {
427
- content: "";
428
- border-left: 1px dashed #eeeeee;
429
-
430
- height: 100%;
431
- width: 0;
432
- position: absolute;
433
- top: 0;
434
- left: 50%;
435
- height: 100%;
436
- margin-left: -1px;
437
- z-index: var(--index-below);
438
- }
439
- }
440
- }
441
- }
442
-
443
- .line {
444
- display: block;
445
- position: absolute;
446
- top: 0;
447
- left: 0;
448
- stroke-width: var(--line-thickness);
449
- width: 100%;
450
- height: calc(100% - 2rem);
451
- pointer-events: none;
452
- z-index: var(--index-below)
453
- }
454
-
455
- .pie {
456
- display: none;
457
- }
458
- }
459
- // #endregion
460
-
461
- // #region Pie chart
462
- .chart.chart--pie {
463
-
464
- margin-bottom: 2rem;
465
-
466
- .chart__yaxis,
467
- .line {
468
- display: none;
469
- }
470
- .table__wrapper {
471
- display: none;
472
- }
473
-
474
- .pies {
475
- display: flex;
476
- flex-direction: row;
477
- flex-wrap: wrap;
478
- gap: 2rem;
479
- }
480
-
481
- .pie {
482
- position: relative;
483
- width: 100%;
484
- aspect-ratio: 1 / 1;
485
- min-width: rem(200);
486
- flex: 1 1 auto;
487
- display: inline-block;
488
-
489
- @include media-breakpoint-up(sm) {
490
-
491
- max-width: calc(33.333% - 1.4rem);
492
- }
493
- @include media-breakpoint-up(md) {
494
-
495
- max-width: calc(25% - 1.5rem);
496
- }
497
-
498
-
499
- &:first-child {
500
- margin-left: 0;
501
- }
502
- &:last-child {
503
- margin-right: 0;
504
- }
505
- }
506
-
507
- .pie svg {
508
- width: 100%;
509
- height: 100%;
510
-
511
- path:hover {
512
- transform: scale(1.05);
513
- }
514
- }
515
-
516
- .pie foreignObject {
517
- background: var(--bs-body-bg);
518
- border-radius: 50%;
519
- z-index: var(--index-focus);
520
- pointer-events: none;
521
- display: none;
522
- padding: 1rem;
523
-
524
- div {
525
- display: flex;
526
- justify-content: center;
527
- align-items: center;
528
- height: 100%;
529
- }
530
- span {
531
- text-align: center;
532
- display: block;
533
- }
534
- }
535
-
536
- .pie {
537
- foreignObject:nth-of-type(1) {
538
- display: block;
539
- }
540
- path:hover ~ foreignObject:nth-of-type(1) {
541
- display: none;
542
- }
543
- path:nth-child(1):hover ~ foreignObject:nth-of-type(2),
544
- path:nth-child(2):hover ~ foreignObject:nth-of-type(3),
545
- path:nth-child(3):hover ~ foreignObject:nth-of-type(4),
546
- path:nth-child(4):hover ~ foreignObject:nth-of-type(5),
547
- path:nth-child(5):hover ~ foreignObject:nth-of-type(6),
548
- path:nth-child(6):hover ~ foreignObject:nth-of-type(7),
549
- path:nth-child(7):hover ~ foreignObject:nth-of-type(8),
550
- path:nth-child(8):hover ~ foreignObject:nth-of-type(9){
551
- display: block;
552
- }
553
- }
554
- }
555
- // #endregion
556
-
557
- // #region Reverted back into a table
558
- .chart__key.chart__key--none{
559
- display: none;
560
- }
561
- .chart.chart--none {
562
-
563
- .chart__yaxis,
564
- .line,
565
- .pie {
566
- display: none;
567
- }
568
- }
569
- // #endregion
1
+ @use "../_func" as *;
2
+
3
+ // #region Chart Colours
4
+ $chart-colors: ();
5
+ $chart-colors: map-merge((
6
+ 1: --colour-primary,
7
+ 2: --colour-secondary,
8
+ 3: --colour-info,
9
+ 4: --colour-warning,
10
+ 5: --colour-dark,
11
+ 6: --colour-light,
12
+ 7: --colour-primary,
13
+ 8: --colour-secondary,
14
+ 9: --colour-info,
15
+ 10: --colour-warning,
16
+ ), $chart-colors);
17
+
18
+ :root {
19
+
20
+ @each $index, $value in $chart-colors {
21
+ --colour-chart-#{$index}: var(#{$value});
22
+ }
23
+ }
24
+
25
+ @media screen and (prefers-color-scheme: dark) {
26
+ :root {
27
+ --colour-chart-1: var(--colour-dark);
28
+ --colour-chart-5: var(--colour-light);
29
+ --colour-chart-6: var(--colour-dark);
30
+ --colour-chart-7: var(--colour-secondary);
31
+ }
32
+ }
33
+ // #endregion
34
+
35
+ // #region Apply colours
36
+ @for $i from 1 to 10 {
37
+
38
+ .chart__key .key:not(:first-child):nth-child(#{$i+1}):before,
39
+ .chart:not(.chart--none):not(.chart--pie) table tbody tr td:not(:first-child):nth-child(#{$i+1}) {
40
+ background: var(#{'--colour-chart-'+$i});
41
+ }
42
+ .chart.chart--line:not(.chart--none):not(.chart--pie) .line:nth-child(#{$i}) {
43
+ stroke: var(#{'--colour-chart-'+$i});
44
+ z-index: #{10 - $i};
45
+ }
46
+ .chart.chart--pie .pie path:nth-child(#{$i}) {
47
+ fill: var(#{'--colour-chart-'+$i});
48
+ }
49
+ }
50
+ // #endregion
51
+
52
+ // #region caption
53
+ .chart__wrapper {
54
+ figcaption {
55
+ font-size: 1rem;
56
+ margin-bottom: 2rem;
57
+ display: block;
58
+ }
59
+ }
60
+ // #endregion
61
+
62
+ // #region Chart key
63
+ .chart__key {
64
+
65
+ padding-bottom: 2rem;
66
+ margin-bottom: 0;
67
+
68
+ &:before {
69
+ content: "Key: ";
70
+ display: inline-block;
71
+ padding-right: 1.5rem;
72
+ margin-bottom: 1rem;
73
+ width: 100%;
74
+
75
+ @include media-breakpoint-up(sm) {
76
+
77
+ width: auto;
78
+ }
79
+ }
80
+
81
+ .key {
82
+ display: inline-block;
83
+ padding-right: 1.5rem;
84
+ margin-bottom: 1rem;
85
+
86
+ &:before {
87
+ content: "";
88
+ height: 1em;
89
+ width: 1em;
90
+ margin-right: 0.25em;
91
+ background: red;
92
+ display: inline-block;
93
+ vertical-align: middle;
94
+ margin-bottom: 0.2em;
95
+ }
96
+
97
+ &:first-child {
98
+ display: none;
99
+ }
100
+ }
101
+ }
102
+ // #endregion
103
+
104
+ // #region Default bar chart (Also applies to line chart)
105
+ .chart:not(.chart--none):not(.chart--pie) {
106
+
107
+ --label-size: #{rem(12)};
108
+ --chart-ratio: 56.25%;
109
+
110
+ @include media-breakpoint-up(sm) {
111
+
112
+ --chart-ratio: 42.86%; // 21:9 ratio
113
+ }
114
+
115
+ @include media-breakpoint-up(md) {
116
+
117
+ --label-size: #{rem(14)};
118
+ }
119
+
120
+ display: flex;
121
+ position: relative;
122
+ margin-bottom: 2rem;
123
+
124
+ .chart__yaxis {
125
+ margin-bottom: 2rem;
126
+ display: flex;
127
+ flex-direction: column-reverse;
128
+ width: 0;
129
+
130
+ .axis__point {
131
+
132
+ bottom: var(--percent);
133
+ position: relative;
134
+ height: 0;
135
+ white-space: nowrap;
136
+
137
+ &:not(:last-child){
138
+ display: none;
139
+ }
140
+
141
+ span {
142
+ display: block;
143
+ transform: translate(0,-50%);
144
+ padding-right: 0.25rem;
145
+ text-align: right;
146
+ font-size: var(--label-size);
147
+ }
148
+
149
+ &:last-child span {
150
+
151
+ transform: translate(0,-100%);
152
+ }
153
+ }
154
+
155
+ @include media-breakpoint-up(sm) {
156
+
157
+ width: auto;
158
+
159
+ .axis__point {
160
+
161
+ &:not(:last-child){
162
+ display: block;
163
+ }
164
+
165
+ &:last-child span {
166
+
167
+ transform: translate(0,-50%);
168
+ }
169
+ }
170
+ }
171
+ }
172
+
173
+ .chart__guidelines {
174
+
175
+ position: absolute;
176
+ top: 0;
177
+ left: 0;
178
+ width: 100%;
179
+ height: calc(100% - 2rem);
180
+ margin-bottom: 2rem;
181
+ z-index: var(--index-below);
182
+ display: flex;
183
+ flex-direction: column-reverse;
184
+
185
+ .guideline {
186
+
187
+ bottom: var(--percent);
188
+ position: absolute;
189
+ right: 0;
190
+ width: 100%;
191
+ height: 0px;
192
+ margin-bottom: -1px;
193
+ border-bottom: 1px dashed #eeeeee;
194
+ }
195
+
196
+ [data-value="0"] {
197
+ border-bottom: 1px solid var(--colour-primary);
198
+
199
+ &:not(:first-child){
200
+
201
+ border-bottom: 1px dashed var(--colour-primary);
202
+ }
203
+ }
204
+ }
205
+
206
+ .table__wrapper {
207
+
208
+ padding-bottom: 2rem;
209
+ padding-right: 0;
210
+ margin: 0;
211
+ overflow-x: visible;
212
+ position: relative;
213
+
214
+ table{
215
+ overflow: visible;
216
+ }
217
+ }
218
+
219
+ table {
220
+ display: block;
221
+ width: 100%;
222
+ padding-top: var(--chart-ratio); // 16:9 ratio
223
+ position: relative;
224
+ margin-bottom: 0;
225
+ //border-bottom: 1px solid black;
226
+
227
+ thead {
228
+ display: none;
229
+ }
230
+
231
+ tbody {
232
+
233
+ display: flex;
234
+ position: absolute;
235
+ width: 100%;
236
+ height: 100%;
237
+ top: 0;
238
+ left: 0;
239
+ flex-direction: row;
240
+ border: none;
241
+ }
242
+
243
+ tbody tr {
244
+ display: flex;
245
+ flex-direction: row;
246
+ justify-content: center;
247
+ align-items: flex-end;
248
+ border: none;
249
+ width: 100%;
250
+ height: 100%;
251
+ position: relative;
252
+ padding: 0 5%;
253
+
254
+ td:first-child {
255
+ position: absolute;
256
+ top: 100%;
257
+ left: 50%;
258
+ transform: translate(-50%,0);
259
+ width: auto;
260
+ padding: 0;
261
+ white-space: nowrap;
262
+ max-width: 120%;
263
+ overflow: hidden;
264
+ text-overflow: ellipsis;
265
+ font-size: var(--label-size);
266
+ display: none;
267
+
268
+ @include media-breakpoint-up(md) {
269
+ display: block;
270
+ max-width: 95%;
271
+ }
272
+ }
273
+
274
+ &:first-child td:first-child,
275
+ &:last-child td:first-child {
276
+
277
+ display: block;
278
+ }
279
+
280
+ td:not(:first-child) {
281
+ height: 100%;
282
+ height: var(--percent, 0%);
283
+ bottom: var(--bottom,0%);
284
+ width: 50%;
285
+ max-width: 10rem;
286
+ position: relative;
287
+ background: green;
288
+ padding: 0;
289
+
290
+ &[data-label]:before {
291
+ display: none;
292
+ }
293
+
294
+ span {
295
+ position: absolute;
296
+ bottom: 100%;
297
+ left: 50%;
298
+ font-size: var(--label-size);
299
+ line-height: 1.2;
300
+ transform: translate(-50%,0);
301
+ background: var(--colour-info);
302
+ opacity: 0;
303
+ pointer-events: none;
304
+ padding: 0.5rem;
305
+ border-radius: 0.5rem;
306
+ margin-bottom: 0.25rem;
307
+ color: white;
308
+ white-space: pre;
309
+ text-align: center;
310
+
311
+ &::before {
312
+ content: attr(data-group) '\A' attr(data-label) ': ';
313
+ }
314
+ }
315
+
316
+ &:hover span {
317
+ opacity: 1;
318
+ z-index: var(--index-above);
319
+ }
320
+ }
321
+
322
+ &:first-child td:not(:first-child) span {
323
+
324
+ left: -20%;
325
+ transform: translate(0%,0);
326
+ }
327
+
328
+ &:last-child td:not(:first-child) span {
329
+
330
+ left: 120%;
331
+ transform: translate(-100%,0);
332
+ }
333
+
334
+ @include media-breakpoint-up(sm) {
335
+
336
+ &:first-child td:not(:first-child) span,
337
+ &:last-child td:not(:first-child) span {
338
+
339
+ left: 50%;
340
+ transform: translate(-50%,0);
341
+ }
342
+ }
343
+
344
+ td:first-child {
345
+ &[data-label]:before {
346
+ display: none;
347
+ }
348
+ }
349
+ }
350
+ }
351
+
352
+ .line,
353
+ .pie {
354
+ display: none;
355
+ }
356
+ }
357
+ // #endregion
358
+
359
+ // #region Stacked bar chart
360
+ .chart:not(.chart--none):not(.chart--pie).chart--stacked {
361
+ table tbody tr {
362
+ flex-direction: column-reverse;
363
+ justify-content: flex-start;
364
+ align-items: center;
365
+ }
366
+ }
367
+ // #endregion
368
+
369
+ // #region Line chart
370
+ .chart.chart--line:not(.chart--none):not(.chart--pie) {
371
+
372
+ --line-thickness: 1px;
373
+
374
+ @include media-breakpoint-up(sm) {
375
+
376
+ --line-thickness: 0.8px;
377
+ }
378
+ @include media-breakpoint-up(md) {
379
+
380
+ --line-thickness: 0.5px;
381
+ }
382
+
383
+ table tbody {
384
+ justify-content: space-between;
385
+
386
+ tr {
387
+ width: 4rem;
388
+ margin-left: -2rem;
389
+ margin-right: -2rem;
390
+ padding: 0;
391
+
392
+
393
+ &:first-child td:first-child {
394
+
395
+ transform: translate(0,0);
396
+ display: block;
397
+ }
398
+ &:last-child td:first-child {
399
+
400
+ left: 100%;
401
+ transform: translate(-100%,0);
402
+ display: block;
403
+ }
404
+
405
+ td:first-child {
406
+ left: 50%!important;
407
+ }
408
+
409
+ td:not(:first-child) {
410
+ position: absolute;
411
+ left: 50%;
412
+ bottom: var(--percent);
413
+ height: 6px;
414
+ width: 6px;
415
+ margin-bottom: -3px;
416
+ margin-left: -3px;
417
+ border-radius: 3px;
418
+ opacity: 0;
419
+
420
+ &:hover {
421
+ opacity: 1;
422
+ }
423
+ }
424
+
425
+ &:hover {
426
+ &:before {
427
+ content: "";
428
+ border-left: 1px dashed #eeeeee;
429
+
430
+ height: 100%;
431
+ width: 0;
432
+ position: absolute;
433
+ top: 0;
434
+ left: 50%;
435
+ height: 100%;
436
+ margin-left: -1px;
437
+ z-index: var(--index-below);
438
+ }
439
+ }
440
+ }
441
+ }
442
+
443
+ .line {
444
+ display: block;
445
+ position: absolute;
446
+ top: 0;
447
+ left: 0;
448
+ stroke-width: var(--line-thickness);
449
+ width: 100%;
450
+ height: calc(100% - 2rem);
451
+ pointer-events: none;
452
+ z-index: var(--index-below)
453
+ }
454
+
455
+ .pie {
456
+ display: none;
457
+ }
458
+ }
459
+ // #endregion
460
+
461
+ // #region Pie chart
462
+ .chart.chart--pie {
463
+
464
+ margin-bottom: 2rem;
465
+
466
+ .chart__yaxis,
467
+ .line {
468
+ display: none;
469
+ }
470
+ .table__wrapper {
471
+ display: none;
472
+ }
473
+
474
+ .pies {
475
+ display: flex;
476
+ flex-direction: row;
477
+ flex-wrap: wrap;
478
+ gap: 2rem;
479
+ }
480
+
481
+ .pie {
482
+ position: relative;
483
+ width: 100%;
484
+ aspect-ratio: 1 / 1;
485
+ min-width: rem(200);
486
+ flex: 1 1 auto;
487
+ display: inline-block;
488
+
489
+ @include media-breakpoint-up(sm) {
490
+
491
+ max-width: calc(33.333% - 1.4rem);
492
+ }
493
+ @include media-breakpoint-up(md) {
494
+
495
+ max-width: calc(25% - 1.5rem);
496
+ }
497
+
498
+
499
+ &:first-child {
500
+ margin-left: 0;
501
+ }
502
+ &:last-child {
503
+ margin-right: 0;
504
+ }
505
+ }
506
+
507
+ .pie svg {
508
+ width: 100%;
509
+ height: 100%;
510
+
511
+ path:hover {
512
+ transform: scale(1.05);
513
+ }
514
+ }
515
+
516
+ .pie foreignObject {
517
+ background: var(--bs-body-bg);
518
+ border-radius: 50%;
519
+ z-index: var(--index-focus);
520
+ pointer-events: none;
521
+ display: none;
522
+ padding: 1rem;
523
+
524
+ div {
525
+ display: flex;
526
+ justify-content: center;
527
+ align-items: center;
528
+ height: 100%;
529
+ }
530
+ span {
531
+ text-align: center;
532
+ display: block;
533
+ }
534
+ }
535
+
536
+ .pie {
537
+ foreignObject:nth-of-type(1) {
538
+ display: block;
539
+ }
540
+ path:hover ~ foreignObject:nth-of-type(1) {
541
+ display: none;
542
+ }
543
+ path:nth-child(1):hover ~ foreignObject:nth-of-type(2),
544
+ path:nth-child(2):hover ~ foreignObject:nth-of-type(3),
545
+ path:nth-child(3):hover ~ foreignObject:nth-of-type(4),
546
+ path:nth-child(4):hover ~ foreignObject:nth-of-type(5),
547
+ path:nth-child(5):hover ~ foreignObject:nth-of-type(6),
548
+ path:nth-child(6):hover ~ foreignObject:nth-of-type(7),
549
+ path:nth-child(7):hover ~ foreignObject:nth-of-type(8),
550
+ path:nth-child(8):hover ~ foreignObject:nth-of-type(9){
551
+ display: block;
552
+ }
553
+ }
554
+ }
555
+ // #endregion
556
+
557
+ // #region Reverted back into a table
558
+ .chart__key.chart__key--none{
559
+ display: none;
560
+ }
561
+ .chart.chart--none {
562
+
563
+ .chart__yaxis,
564
+ .line,
565
+ .pie {
566
+ display: none;
567
+ }
568
+ }
569
+ // #endregion