@guardian/interactive-component-library 0.1.0-alpha.22 → 0.1.0-alpha.24

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.
@@ -10,7 +10,7 @@ const group = "_group_b5io0_5";
10
10
  const rotated = "_rotated_b5io0_10";
11
11
  const path$4 = "_path_b5io0_14";
12
12
  const active = "_active_b5io0_18";
13
- const defaultStyles$t = {
13
+ const defaultStyles$v = {
14
14
  svg: svg$9,
15
15
  group,
16
16
  rotated,
@@ -50,13 +50,13 @@ function Chevron({
50
50
  styles: styles2
51
51
  }) {
52
52
  const defaultStylesCopy = {
53
- ...defaultStyles$t
53
+ ...defaultStyles$v
54
54
  };
55
55
  if (active2) {
56
- defaultStylesCopy.path = mergeStyles(defaultStyles$t.path, defaultStyles$t.active);
56
+ defaultStylesCopy.path = mergeStyles(defaultStyles$v.path, defaultStyles$v.active);
57
57
  }
58
58
  if (direction === DIRECTION.up) {
59
- defaultStylesCopy.group = mergeStyles(defaultStyles$t.group, defaultStyles$t.rotated);
59
+ defaultStylesCopy.group = mergeStyles(defaultStyles$v.group, defaultStyles$v.rotated);
60
60
  }
61
61
  styles2 = mergeStyles(defaultStylesCopy, styles2);
62
62
  return size === SIZE.small ? jsx(SmallChevron, {
@@ -106,12 +106,12 @@ function LargeChevron({
106
106
  })
107
107
  });
108
108
  }
109
- const container$5 = "_container_jzalm_1";
109
+ const container$7 = "_container_jzalm_1";
110
110
  const dot = "_dot_jzalm_6";
111
111
  const circle$2 = "_circle_jzalm_13";
112
112
  const text$3 = "_text_jzalm_17";
113
- const defaultStyles$s = {
114
- container: container$5,
113
+ const defaultStyles$u = {
114
+ container: container$7,
115
115
  dot,
116
116
  circle: circle$2,
117
117
  text: text$3
@@ -127,10 +127,10 @@ const LegendItem = ({
127
127
  abbreviation
128
128
  }) => {
129
129
  const defaultStylesCopy = {
130
- ...defaultStyles$s
130
+ ...defaultStyles$u
131
131
  };
132
132
  if (dotType === DOT_TYPE.round) {
133
- defaultStylesCopy.dot = mergeStyles(defaultStyles$s.dot, defaultStyles$s.circle);
133
+ defaultStylesCopy.dot = mergeStyles(defaultStyles$u.dot, defaultStyles$u.circle);
134
134
  }
135
135
  styles2 = mergeStyles(defaultStylesCopy, styles2);
136
136
  return jsxs("div", {
@@ -146,7 +146,7 @@ const LegendItem = ({
146
146
  const bar$2 = "_bar_bf839_1";
147
147
  const label$1 = "_label_bf839_5";
148
148
  const backgroundRect = "_backgroundRect_bf839_11";
149
- const defaultStyles$r = {
149
+ const defaultStyles$t = {
150
150
  bar: bar$2,
151
151
  label: label$1,
152
152
  backgroundRect
@@ -202,7 +202,7 @@ function StackedBar({
202
202
  const rectElements = useRef([]);
203
203
  const textElements = useRef([]);
204
204
  styles2 = mergeStyles({
205
- ...defaultStyles$r
205
+ ...defaultStyles$t
206
206
  }, styles2);
207
207
  const svgHeight = labelType === LabelType.hanging && !hideLabels ? height + 20 : height;
208
208
  const renderLabel = (config, i) => jsx("text", {
@@ -342,7 +342,7 @@ const [useGradients, setGradients, getGradients] = createStore({});
342
342
  const svg$8 = "_svg_1cajk_6";
343
343
  const previous = "_previous_1cajk_12";
344
344
  const next = "_next_1cajk_16";
345
- const defaultStyles$q = {
345
+ const defaultStyles$s = {
346
346
  svg: svg$8,
347
347
  previous,
348
348
  next
@@ -353,7 +353,7 @@ const GradientIcon = (props) => {
353
353
  next: next2,
354
354
  styles: styles2
355
355
  } = props;
356
- styles2 = mergeStyles(defaultStyles$q, styles2);
356
+ styles2 = mergeStyles(defaultStyles$s, styles2);
357
357
  const gradientId = `gv-gradient-def-${previous2}-${next2}`;
358
358
  const gradients = useGradients();
359
359
  useEffect(() => {
@@ -420,9 +420,123 @@ function GradientDefs({
420
420
  })
421
421
  });
422
422
  }
423
+ const unit = "_unit_mo5d9_1";
424
+ const container$6 = "_container_mo5d9_6";
425
+ const defaultStyles$r = {
426
+ unit,
427
+ container: container$6
428
+ };
429
+ function useWindowSize() {
430
+ const [windowSize, setWindowSize] = useState(() => {
431
+ if (typeof window === "undefined")
432
+ return {
433
+ width: 0,
434
+ height: 0
435
+ };
436
+ return {
437
+ width: window.innerWidth,
438
+ height: window.innerHeight
439
+ };
440
+ });
441
+ useEffect(() => {
442
+ if (typeof window === "undefined")
443
+ return;
444
+ function handleResize() {
445
+ setWindowSize({
446
+ width: window.innerWidth,
447
+ height: window.innerHeight
448
+ });
449
+ }
450
+ window.addEventListener("resize", handleResize);
451
+ return () => {
452
+ window.removeEventListener("resize", handleResize);
453
+ };
454
+ }, []);
455
+ return windowSize;
456
+ }
457
+ function useContainerSize(containerRef) {
458
+ const windowSize = useWindowSize();
459
+ const [containerSize, setContainerSize] = useState();
460
+ useLayoutEffect(() => {
461
+ const container2 = containerRef.current;
462
+ if (!container2)
463
+ return;
464
+ setContainerSize({
465
+ width: container2.clientWidth,
466
+ height: container2.clientHeight
467
+ });
468
+ }, [containerRef, windowSize]);
469
+ return containerSize;
470
+ }
471
+ const WaffleType = {
472
+ circle: "circle",
473
+ square: "square"
474
+ };
475
+ const WaffleUnit = ({
476
+ type,
477
+ attributes
478
+ }) => type === WaffleType.square ? jsx("rect", {
479
+ ...attributes
480
+ }) : jsx("circle", {
481
+ ...attributes
482
+ });
483
+ const Waffle = ({
484
+ units,
485
+ numberOfRows,
486
+ type = WaffleType.circle,
487
+ idAccessor,
488
+ onMouseOver,
489
+ styles: styles2
490
+ }) => {
491
+ const containerRef = useRef();
492
+ const containerSize = useContainerSize(containerRef);
493
+ const width = containerSize ? containerSize.width : 0;
494
+ const total = units.length;
495
+ const columns = Math.ceil(total / numberOfRows);
496
+ const unitWidth = width / columns;
497
+ const unitHeight = unitWidth;
498
+ const height = numberOfRows * unitHeight;
499
+ styles2 = mergeStyles(defaultStyles$r, styles2);
500
+ return jsx("div", {
501
+ ref: containerRef,
502
+ className: styles2.container,
503
+ children: containerSize && jsx("svg", {
504
+ viewBox: `0 0 ${width} ${height}`,
505
+ class: styles2.svg,
506
+ children: jsx("g", {
507
+ children: units.map((unit2, j) => {
508
+ let attributes;
509
+ if (type === WaffleType.square) {
510
+ attributes = {
511
+ id: unit2[idAccessor] || `w-${j}`,
512
+ onMouseOver: (e) => onMouseOver(unit2, e),
513
+ class: `${styles2.unit} ${unit2.class}`,
514
+ height: unitHeight,
515
+ width: unitWidth,
516
+ x: unitWidth * Math.floor(j / numberOfRows),
517
+ y: unitHeight * (j % numberOfRows)
518
+ };
519
+ } else {
520
+ attributes = {
521
+ id: unit2[idAccessor] || `w-${j}`,
522
+ onMouseOver: (e) => onMouseOver(unit2, e),
523
+ class: `${styles2.unit} ${unit2.class}`,
524
+ r: unitWidth / 2,
525
+ transform: `translate(${unitWidth * Math.floor(j / numberOfRows) + unitWidth / 2}, ${unitHeight * (j % numberOfRows) + unitHeight / 2})`
526
+ };
527
+ }
528
+ return jsx(WaffleUnit, {
529
+ type,
530
+ attributes
531
+ }, `wu-${j}`);
532
+ })
533
+ })
534
+ })
535
+ });
536
+ };
423
537
  const button$5 = "_button_oqopj_1";
424
538
  const svg$7 = "_svg_oqopj_15";
425
- const defaultStyles$p = {
539
+ const defaultStyles$q = {
426
540
  button: button$5,
427
541
  svg: svg$7
428
542
  };
@@ -431,7 +545,7 @@ const InfoButton = forwardRef(({
431
545
  styles: styles2
432
546
  }, ref) => {
433
547
  styles2 = mergeStyles({
434
- ...defaultStyles$p
548
+ ...defaultStyles$q
435
549
  }, styles2);
436
550
  return jsx("button", {
437
551
  ref,
@@ -450,7 +564,7 @@ const InfoButton = forwardRef(({
450
564
  const svg$6 = "_svg_1v49v_1";
451
565
  const circle$1 = "_circle_1v49v_5";
452
566
  const pulse = "_pulse_1v49v_9";
453
- const defaultStyles$o = {
567
+ const defaultStyles$p = {
454
568
  svg: svg$6,
455
569
  circle: circle$1,
456
570
  pulse
@@ -460,7 +574,7 @@ const CircleIcon = ({
460
574
  pulse: pulse2 = false,
461
575
  styles: styles2
462
576
  }) => {
463
- styles2 = mergeStyles(defaultStyles$o, styles2);
577
+ styles2 = mergeStyles(defaultStyles$p, styles2);
464
578
  return jsx("svg", {
465
579
  style: styles2.svg,
466
580
  fill: "none",
@@ -480,7 +594,7 @@ const CircleIcon = ({
480
594
  });
481
595
  };
482
596
  const text$2 = "_text_1okyv_1";
483
- const defaultStyles$n = {
597
+ const defaultStyles$o = {
484
598
  text: text$2
485
599
  };
486
600
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -830,7 +944,7 @@ const RelativeTimeSentence = ({
830
944
  styles: styles2
831
945
  }) => {
832
946
  styles2 = mergeStyles({
833
- ...defaultStyles$n
947
+ ...defaultStyles$o
834
948
  }, styles2);
835
949
  let timeSince = dayjs(timeStamp).fromNow();
836
950
  return jsx("span", {
@@ -840,7 +954,7 @@ const RelativeTimeSentence = ({
840
954
  };
841
955
  const pageContainer = "_pageContainer_1s0yq_9";
842
956
  const sideBorders = "_sideBorders_1s0yq_42";
843
- const defaultStyles$m = {
957
+ const defaultStyles$n = {
844
958
  pageContainer,
845
959
  sideBorders
846
960
  };
@@ -852,17 +966,17 @@ function Container({
852
966
  const {
853
967
  pageContainer: pageContainer2,
854
968
  sideBorders: sideBordersStyle
855
- } = mergeStyles(defaultStyles$m, styles2);
969
+ } = mergeStyles(defaultStyles$n, styles2);
856
970
  return jsx("div", {
857
971
  className: [pageContainer2, sideBorders2 && sideBordersStyle].join(" "),
858
972
  children
859
973
  });
860
974
  }
861
- const wrapper = "_wrapper_5oj1x_9";
975
+ const wrapper$1 = "_wrapper_5oj1x_9";
862
976
  const bar$1 = "_bar_5oj1x_14";
863
977
  const zero = "_zero_5oj1x_19";
864
- const defaultStyles$l = {
865
- wrapper,
978
+ const defaultStyles$m = {
979
+ wrapper: wrapper$1,
866
980
  bar: bar$1,
867
981
  zero
868
982
  };
@@ -882,7 +996,7 @@ function ChangeBar({
882
996
  let thisColor = ` bg-color--${party}`;
883
997
  let zeroStyles = ` height: ${height};`;
884
998
  styles2 = mergeStyles({
885
- ...defaultStyles$l
999
+ ...defaultStyles$m
886
1000
  }, styles2);
887
1001
  return jsxs("div", {
888
1002
  className: styles2.wrapper,
@@ -900,7 +1014,7 @@ const svg$5 = "_svg_886i1_9";
900
1014
  const dividingLineColor = "_dividingLineColor_886i1_16";
901
1015
  const square = "_square_886i1_20";
902
1016
  const corner = "_corner_886i1_24";
903
- const defaultStyles$k = {
1017
+ const defaultStyles$l = {
904
1018
  svg: svg$5,
905
1019
  dividingLineColor,
906
1020
  square,
@@ -913,7 +1027,7 @@ const SquareCutCornerIcon = ({
913
1027
  styles: styles2
914
1028
  }) => {
915
1029
  styles2 = mergeStyles({
916
- ...defaultStyles$k
1030
+ ...defaultStyles$l
917
1031
  }, styles2);
918
1032
  let cornerSize = squareSize * 0.625;
919
1033
  let cornerMargin = squareSize < 100 ? squareSize / 6 : 10;
@@ -951,7 +1065,7 @@ const stackedGridRotateItems0 = "_stackedGridRotateItems0_6whof_11";
951
1065
  const stackedGridRotateItems90 = "_stackedGridRotateItems90_6whof_17";
952
1066
  const stackedGridRotateItems180 = "_stackedGridRotateItems180_6whof_23";
953
1067
  const stackedGridRotateItems270 = "_stackedGridRotateItems270_6whof_29";
954
- const defaultStyles$j = {
1068
+ const defaultStyles$k = {
955
1069
  stackedGridContainer,
956
1070
  stackedGridRotateItems0,
957
1071
  stackedGridRotateItems90,
@@ -982,7 +1096,7 @@ const StackedGrid = ({
982
1096
  }) => {
983
1097
  let containerFlip = getContainerFlip(fromBottom, fromLeft);
984
1098
  let itemRotateClass = getItemRotate(fromBottom, fromLeft);
985
- styles2 = mergeStyles(defaultStyles$j, styles2);
1099
+ styles2 = mergeStyles(defaultStyles$k, styles2);
986
1100
  return jsx("div", {
987
1101
  style: {
988
1102
  transform: containerFlip
@@ -993,7 +1107,7 @@ const StackedGrid = ({
993
1107
  };
994
1108
  const svg$4 = "_svg_l2fsl_9";
995
1109
  const squareFill = "_squareFill_l2fsl_16";
996
- const defaultStyles$i = {
1110
+ const defaultStyles$j = {
997
1111
  svg: svg$4,
998
1112
  squareFill
999
1113
  };
@@ -1003,7 +1117,7 @@ const SquareIcon = ({
1003
1117
  styles: styles2
1004
1118
  }) => {
1005
1119
  styles2 = mergeStyles({
1006
- ...defaultStyles$i
1120
+ ...defaultStyles$j
1007
1121
  }, styles2);
1008
1122
  return jsx("svg", {
1009
1123
  width: size,
@@ -1019,9 +1133,9 @@ const SquareIcon = ({
1019
1133
  })
1020
1134
  });
1021
1135
  };
1022
- const button$4 = "_button_1fees_1";
1023
- const icon$2 = "_icon_1fees_6";
1024
- const defaultStyles$h = {
1136
+ const button$4 = "_button_1kqfn_1";
1137
+ const icon$2 = "_icon_1kqfn_6";
1138
+ const defaultStyles$i = {
1025
1139
  button: button$4,
1026
1140
  icon: icon$2
1027
1141
  };
@@ -1031,7 +1145,7 @@ function ArrowButton({
1031
1145
  styles: styles2,
1032
1146
  onClick
1033
1147
  }) {
1034
- styles2 = mergeStyles(defaultStyles$h, styles2);
1148
+ styles2 = mergeStyles(defaultStyles$i, styles2);
1035
1149
  return jsx("button", {
1036
1150
  className: styles2.button,
1037
1151
  disabled,
@@ -1055,9 +1169,9 @@ function ArrowButton({
1055
1169
  })
1056
1170
  });
1057
1171
  }
1058
- const button$3 = "_button_3521c_1";
1059
- const buttonInner$1 = "_buttonInner_3521c_6";
1060
- const defaultStyles$g = {
1172
+ const button$3 = "_button_s6ell_1";
1173
+ const buttonInner$1 = "_buttonInner_s6ell_6";
1174
+ const defaultStyles$h = {
1061
1175
  button: button$3,
1062
1176
  buttonInner: buttonInner$1
1063
1177
  };
@@ -1067,7 +1181,7 @@ function Button({
1067
1181
  styles: styles2,
1068
1182
  children
1069
1183
  }) {
1070
- styles2 = mergeStyles(defaultStyles$g, styles2);
1184
+ styles2 = mergeStyles(defaultStyles$h, styles2);
1071
1185
  return jsx("button", {
1072
1186
  className: styles2.button,
1073
1187
  "data-type": type,
@@ -1078,11 +1192,11 @@ function Button({
1078
1192
  })
1079
1193
  });
1080
1194
  }
1081
- const button$2 = "_button_125im_1";
1082
- const buttonBorder = "_buttonBorder_125im_11";
1083
- const svg$3 = "_svg_125im_19";
1084
- const path$3 = "_path_125im_25";
1085
- const defaultStyles$f = {
1195
+ const button$2 = "_button_nr8bh_1";
1196
+ const buttonBorder = "_buttonBorder_nr8bh_11";
1197
+ const svg$3 = "_svg_nr8bh_19";
1198
+ const path$3 = "_path_nr8bh_25";
1199
+ const defaultStyles$g = {
1086
1200
  button: button$2,
1087
1201
  buttonBorder,
1088
1202
  svg: svg$3,
@@ -1093,7 +1207,7 @@ function CloseButton({
1093
1207
  onClick,
1094
1208
  styles: styles2
1095
1209
  }) {
1096
- styles2 = mergeStyles(defaultStyles$f, styles2);
1210
+ styles2 = mergeStyles(defaultStyles$g, styles2);
1097
1211
  return jsx("button", {
1098
1212
  className: [styles2.button, border && styles2.buttonBorder].join(" "),
1099
1213
  onClick,
@@ -1111,10 +1225,10 @@ function CloseButton({
1111
1225
  })
1112
1226
  });
1113
1227
  }
1114
- const container$4 = "_container_tq3ke_1";
1228
+ const container$5 = "_container_tq3ke_1";
1115
1229
  const slot = "_slot_tq3ke_5";
1116
- const defaultStyles$e = {
1117
- container: container$4,
1230
+ const defaultStyles$f = {
1231
+ container: container$5,
1118
1232
  slot
1119
1233
  };
1120
1234
  function AdSlot({
@@ -1124,7 +1238,7 @@ function AdSlot({
1124
1238
  }) {
1125
1239
  var _a, _b, _c;
1126
1240
  const slotId = `dfp-ad--${name2}`;
1127
- styles2 = mergeStyles(defaultStyles$e, styles2);
1241
+ styles2 = mergeStyles(defaultStyles$f, styles2);
1128
1242
  const mobileSizes = (_a = sizeMapping.mobile) == null ? void 0 : _a.map((size) => size.join(",")).join("|");
1129
1243
  const tabletSizes = (_b = sizeMapping.tablet) == null ? void 0 : _b.map((size) => size.join(",")).join("|");
1130
1244
  const desktopSizes = (_c = sizeMapping.desktop) == null ? void 0 : _c.map((size) => size.join(",")).join("|");
@@ -1269,7 +1383,7 @@ const headerCell = "_headerCell_1dg64_32";
1269
1383
  const headerCellButton = "_headerCellButton_1dg64_40";
1270
1384
  const bodyRow = "_bodyRow_1dg64_49";
1271
1385
  const bodyCell = "_bodyCell_1dg64_54";
1272
- const defaultStyles$d = {
1386
+ const defaultStyles$e = {
1273
1387
  table,
1274
1388
  hideHeader,
1275
1389
  hideHeaderNoBorder,
@@ -1310,7 +1424,7 @@ function Table({
1310
1424
  };
1311
1425
  });
1312
1426
  };
1313
- styles2 = mergeStyles(defaultStyles$d, styles2);
1427
+ styles2 = mergeStyles(defaultStyles$e, styles2);
1314
1428
  return jsxs("table", {
1315
1429
  className: styles2.table,
1316
1430
  cellSpacing: 0,
@@ -1372,47 +1486,19 @@ function HeaderCell({
1372
1486
  })]
1373
1487
  });
1374
1488
  }
1375
- function useWindowSize() {
1376
- const [windowSize, setWindowSize] = useState(() => {
1377
- if (typeof window === "undefined")
1378
- return {
1379
- width: 0,
1380
- height: 0
1381
- };
1382
- return {
1383
- width: window.innerWidth,
1384
- height: window.innerHeight
1385
- };
1386
- });
1387
- useEffect(() => {
1388
- if (typeof window === "undefined")
1389
- return;
1390
- function handleResize() {
1391
- setWindowSize({
1392
- width: window.innerWidth,
1393
- height: window.innerHeight
1394
- });
1395
- }
1396
- window.addEventListener("resize", handleResize);
1397
- return () => {
1398
- window.removeEventListener("resize", handleResize);
1399
- };
1400
- }, []);
1401
- return windowSize;
1402
- }
1403
1489
  const slopeChartContainer = "_slopeChartContainer_gj7pr_1";
1404
1490
  const svg$2 = "_svg_gj7pr_5";
1405
- const line = "_line_gj7pr_9";
1491
+ const line$1 = "_line_gj7pr_9";
1406
1492
  const circle = "_circle_gj7pr_14";
1407
1493
  const label = "_label_gj7pr_18";
1408
1494
  const y1Label = "_y1Label_gj7pr_24";
1409
1495
  const y2Label = "_y2Label_gj7pr_28";
1410
1496
  const axis$1 = "_axis_gj7pr_32";
1411
1497
  const axisLabel = "_axisLabel_gj7pr_37";
1412
- const defaultStyles$c = {
1498
+ const defaultStyles$d = {
1413
1499
  slopeChartContainer,
1414
1500
  svg: svg$2,
1415
- line,
1501
+ line: line$1,
1416
1502
  circle,
1417
1503
  label,
1418
1504
  y1Label,
@@ -1461,7 +1547,7 @@ const SlopeChart = ({
1461
1547
  return positionLabels(labels);
1462
1548
  }, [lines, y2Label2, yScale]);
1463
1549
  styles2 = mergeStyles({
1464
- ...defaultStyles$c
1550
+ ...defaultStyles$d
1465
1551
  }, styles2);
1466
1552
  const chart = jsx("svg", {
1467
1553
  class: styles2.svg,
@@ -1554,7 +1640,7 @@ function pointInsideRect(point, rect) {
1554
1640
  return point.x >= rect.x && point.x <= rect.x + rect.width && point.y >= rect.y && point.y <= rect.y + rect.height;
1555
1641
  }
1556
1642
  const tooltip = "_tooltip_11t5d_1";
1557
- const defaultStyles$b = {
1643
+ const defaultStyles$c = {
1558
1644
  tooltip
1559
1645
  };
1560
1646
  function Tooltip({
@@ -1573,7 +1659,7 @@ function Tooltip({
1573
1659
  });
1574
1660
  const [displayElement, setDisplayElement] = useState(null);
1575
1661
  const tooltipRef = useRef();
1576
- styles2 = mergeStyles(defaultStyles$b, styles2);
1662
+ styles2 = mergeStyles(defaultStyles$c, styles2);
1577
1663
  useEffect(() => {
1578
1664
  setDisplayElement(document.querySelector("body"));
1579
1665
  return () => {
@@ -1682,10 +1768,10 @@ function tooltipPositionForRect({
1682
1768
  return newPosition;
1683
1769
  }
1684
1770
  const text$1 = "_text_1b8t2_1";
1685
- const container$3 = "_container_1b8t2_10";
1686
- const defaultStyles$a = {
1771
+ const container$4 = "_container_1b8t2_10";
1772
+ const defaultStyles$b = {
1687
1773
  text: text$1,
1688
- container: container$3
1774
+ container: container$4
1689
1775
  };
1690
1776
  const ControlChange = ({
1691
1777
  previous: previous2,
@@ -1694,7 +1780,7 @@ const ControlChange = ({
1694
1780
  styles: styles2
1695
1781
  }) => {
1696
1782
  styles2 = mergeStyles({
1697
- ...defaultStyles$a
1783
+ ...defaultStyles$b
1698
1784
  }, styles2);
1699
1785
  let hasChanged = next2 !== previous2;
1700
1786
  return jsx("div", {
@@ -1718,6 +1804,34 @@ const ControlChange = ({
1718
1804
  })
1719
1805
  });
1720
1806
  };
1807
+ const wrapper = "_wrapper_8vo05_1";
1808
+ const line = "_line_8vo05_5";
1809
+ const halfLineText = "_halfLineText_8vo05_15";
1810
+ const defaultStyles$a = {
1811
+ wrapper,
1812
+ line,
1813
+ halfLineText
1814
+ };
1815
+ const FirstPastThePostWaffle = ({
1816
+ styles: styles2,
1817
+ children,
1818
+ lineOverHang
1819
+ }) => {
1820
+ styles2 = mergeStyles(defaultStyles$a, styles2);
1821
+ return jsxs("div", {
1822
+ class: styles2.wrapper,
1823
+ children: [jsx("p", {
1824
+ style: {
1825
+ height: lineOverHang + 20
1826
+ },
1827
+ class: styles2.halfLineText,
1828
+ children: children.halfLineText
1829
+ }), jsx("div", {
1830
+ class: styles2.line,
1831
+ children: " "
1832
+ }), children.waffle]
1833
+ });
1834
+ };
1721
1835
  const toplineResult = "_toplineResult_49z3u_9";
1722
1836
  const primaryname = "_primaryname_49z3u_14";
1723
1837
  const secondaryname = "_secondaryname_49z3u_29";
@@ -1844,14 +1958,22 @@ const PageSection = forwardRef(({
1844
1958
  styles2 = mergeStyles({
1845
1959
  ...defaultStyles$8
1846
1960
  }, styles2);
1961
+ const [minHeight, setMinHeight] = useState("auto");
1962
+ const headerRef = useRef();
1963
+ useLayoutEffect(() => {
1964
+ const headerElement = headerRef.current;
1965
+ setMinHeight(headerElement.offsetHeight);
1966
+ }, [children]);
1847
1967
  return jsxs("section", {
1848
1968
  ref,
1849
1969
  className: [styles2.section, borderTop2 && styles2.borderTop].join(" "),
1850
1970
  style: {
1851
- "--background-color": backgroundColor
1971
+ "--background-color": backgroundColor,
1972
+ minHeight
1852
1973
  },
1853
1974
  children: [jsx("div", {
1854
1975
  className: styles2.header,
1976
+ ref: headerRef,
1855
1977
  children: children.header
1856
1978
  }), jsx("div", {
1857
1979
  className: styles2.content,
@@ -1913,7 +2035,7 @@ const ColumnChart = ({
1913
2035
  })]
1914
2036
  });
1915
2037
  };
1916
- const container$2 = "_container_1snyq_1";
2038
+ const container$3 = "_container_1snyq_1";
1917
2039
  const img = "_img_1snyq_7";
1918
2040
  const title$2 = "_title_1snyq_15";
1919
2041
  const subtitle = "_subtitle_1snyq_31";
@@ -1921,7 +2043,7 @@ const small = "_small_1snyq_41";
1921
2043
  const blurb = "_blurb_1snyq_51";
1922
2044
  const footnote = "_footnote_1snyq_59";
1923
2045
  const defaultStyles$6 = {
1924
- container: container$2,
2046
+ container: container$3,
1925
2047
  img,
1926
2048
  title: title$2,
1927
2049
  subtitle,
@@ -2361,24 +2483,10 @@ function SVGRenderer({
2361
2483
  })
2362
2484
  });
2363
2485
  }
2364
- function useContainerSize(containerRef) {
2365
- const windowSize = useWindowSize();
2366
- const [containerSize, setContainerSize] = useState();
2367
- useLayoutEffect(() => {
2368
- const container2 = containerRef.current;
2369
- if (!container2)
2370
- return;
2371
- setContainerSize({
2372
- width: container2.clientWidth,
2373
- height: container2.clientHeight
2374
- });
2375
- }, [containerRef, windowSize]);
2376
- return containerSize;
2377
- }
2378
- const container$1 = "_container_cyrny_1";
2486
+ const container$2 = "_container_cyrny_1";
2379
2487
  const svg$1 = "_svg_cyrny_6";
2380
2488
  const styles$5 = {
2381
- container: container$1,
2489
+ container: container$2,
2382
2490
  svg: svg$1
2383
2491
  };
2384
2492
  function dynamicPropValue(prop, d2, index2) {
@@ -2644,10 +2752,10 @@ const Map$1 = forwardRef(({
2644
2752
  })
2645
2753
  });
2646
2754
  });
2647
- const container = "_container_azu4a_1";
2755
+ const container$1 = "_container_azu4a_1";
2648
2756
  const paragraph = "_paragraph_azu4a_12";
2649
2757
  const defaultStyles$4 = {
2650
- container,
2758
+ container: container$1,
2651
2759
  paragraph
2652
2760
  };
2653
2761
  function ResultSummary({
@@ -2983,6 +3091,18 @@ function Modal({
2983
3091
  onClickOutside(event);
2984
3092
  }
2985
3093
  }, [onClickOutside, visible]);
3094
+ useEffect(() => {
3095
+ if (visible) {
3096
+ window.addEventListener("scroll", onClick, {
3097
+ once: true
3098
+ });
3099
+ }
3100
+ return () => {
3101
+ if (visible) {
3102
+ window.removeEventListener("scroll", onClick);
3103
+ }
3104
+ };
3105
+ }, [onClick, visible]);
2986
3106
  return createPortal(jsx(d, {
2987
3107
  in: visible,
2988
3108
  duration: 300,
@@ -3001,18 +3121,20 @@ function Modal({
3001
3121
  })
3002
3122
  }), document.body);
3003
3123
  }
3004
- const button$1 = "_button_xeyqm_1";
3005
- const icon = "_icon_xeyqm_17";
3006
- const title$1 = "_title_xeyqm_22";
3007
- const popout = "_popout_xeyqm_29";
3008
- const hint = "_hint_xeyqm_44";
3009
- const option = "_option_xeyqm_51";
3010
- const optionIcon = "_optionIcon_xeyqm_71";
3011
- const optionTitle = "_optionTitle_xeyqm_76";
3012
- const optionDescription = "_optionDescription_xeyqm_84";
3013
- const checkmark = "_checkmark_xeyqm_91";
3014
- const checkmarkPath = "_checkmarkPath_xeyqm_97";
3124
+ const container = "_container_iozsb_1";
3125
+ const button$1 = "_button_iozsb_6";
3126
+ const icon = "_icon_iozsb_22";
3127
+ const title$1 = "_title_iozsb_27";
3128
+ const popout = "_popout_iozsb_34";
3129
+ const hint = "_hint_iozsb_51";
3130
+ const option = "_option_iozsb_58";
3131
+ const optionIcon = "_optionIcon_iozsb_79";
3132
+ const optionTitle = "_optionTitle_iozsb_84";
3133
+ const optionDescription = "_optionDescription_iozsb_92";
3134
+ const checkmark = "_checkmark_iozsb_99";
3135
+ const checkmarkPath = "_checkmarkPath_iozsb_105";
3015
3136
  const styles$2 = {
3137
+ container,
3016
3138
  button: button$1,
3017
3139
  icon,
3018
3140
  title: title$1,
@@ -3029,20 +3151,25 @@ function Dropdown({
3029
3151
  title: title2,
3030
3152
  hint: hint2,
3031
3153
  options,
3032
- onSelect
3154
+ onSelect,
3155
+ collapseOnSelect = false,
3156
+ expandByDefault = true
3033
3157
  }) {
3034
- const [expanded, setExpanded] = useState(true);
3158
+ const [expanded, setExpanded] = useState(expandByDefault);
3035
3159
  const [selectedIndex, setSelectedIndex] = useState(0);
3036
3160
  const onOptionClick = useCallback((option2, index2) => {
3037
3161
  setSelectedIndex(index2);
3038
3162
  if (onSelect)
3039
3163
  onSelect(option2, index2);
3164
+ if (collapseOnSelect)
3165
+ setExpanded(false);
3040
3166
  }, [onSelect]);
3041
3167
  const iconForSelectedOption = useMemo(() => {
3042
3168
  const selectedOption = options[selectedIndex];
3043
3169
  return selectedOption.icon;
3044
3170
  }, [options, selectedIndex]);
3045
3171
  return jsxs("div", {
3172
+ className: styles$2.container,
3046
3173
  children: [jsxs("button", {
3047
3174
  className: styles$2.button,
3048
3175
  onClick: () => setExpanded((current) => !current),
@@ -3514,6 +3641,7 @@ export {
3514
3641
  Container,
3515
3642
  ControlChange,
3516
3643
  Dropdown,
3644
+ FirstPastThePostWaffle,
3517
3645
  GradientIcon,
3518
3646
  GridType,
3519
3647
  InfoButton,
@@ -3540,6 +3668,8 @@ export {
3540
3668
  Ticker,
3541
3669
  Tooltip,
3542
3670
  ToplineResult,
3671
+ Waffle,
3672
+ WaffleType,
3543
3673
  useContainerSize,
3544
3674
  useTouchOrHover,
3545
3675
  useWindowSize