@guardian/interactive-component-library 0.1.0-alpha.11 → 0.1.0-alpha.13

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.
@@ -1,13 +1,13 @@
1
1
  (function(global2, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("preact/jsx-runtime"), require("preact/hooks"), require("preact/compat"), require("preact"), require("d3-scale"), require("d3-geo")) : typeof define === "function" && define.amd ? define(["exports", "preact/jsx-runtime", "preact/hooks", "preact/compat", "preact", "d3-scale", "d3-geo"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["interactive-component-library"] = {}, global2["preact/jsx-runtime"], global2["preact/hooks"], global2["preact/compat"], global2.preact, global2["d3-scale"], global2["d3-geo"]));
3
- })(this, function(exports2, jsxRuntime, hooks, compat, preact, d3Scale, d3Geo) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("preact/jsx-runtime"), require("preact/hooks"), require("preact"), require("preact/compat"), require("d3-scale"), require("d3-geo")) : typeof define === "function" && define.amd ? define(["exports", "preact/jsx-runtime", "preact/hooks", "preact", "preact/compat", "d3-scale", "d3-geo"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["interactive-component-library"] = {}, global2["preact/jsx-runtime"], global2["preact/hooks"], global2.preact, global2["preact/compat"], global2["d3-scale"], global2["d3-geo"]));
3
+ })(this, function(exports2, jsxRuntime, hooks, preact, compat, d3Scale, d3Geo) {
4
4
  "use strict";
5
5
  const main = "";
6
6
  const group = "_group_nq9z3_1";
7
7
  const rotated = "_rotated_nq9z3_6";
8
8
  const path$4 = "_path_nq9z3_10";
9
9
  const active = "_active_nq9z3_14";
10
- const defaultStyles$q = {
10
+ const defaultStyles$r = {
11
11
  group,
12
12
  rotated,
13
13
  path: path$4,
@@ -46,13 +46,13 @@
46
46
  styles: styles2
47
47
  }) {
48
48
  const defaultStylesCopy = {
49
- ...defaultStyles$q
49
+ ...defaultStyles$r
50
50
  };
51
51
  if (active2) {
52
- defaultStylesCopy.path = mergeStyles(defaultStyles$q.path, defaultStyles$q.active);
52
+ defaultStylesCopy.path = mergeStyles(defaultStyles$r.path, defaultStyles$r.active);
53
53
  }
54
54
  if (direction === DIRECTION.up) {
55
- defaultStylesCopy.group = mergeStyles(defaultStyles$q.group, defaultStyles$q.rotated);
55
+ defaultStylesCopy.group = mergeStyles(defaultStyles$r.group, defaultStyles$r.rotated);
56
56
  }
57
57
  styles2 = mergeStyles(defaultStylesCopy, styles2);
58
58
  return jsxRuntime.jsx("svg", {
@@ -75,12 +75,12 @@
75
75
  }
76
76
  const container$4 = "_container_jzalm_1";
77
77
  const dot = "_dot_jzalm_6";
78
- const circle$1 = "_circle_jzalm_13";
78
+ const circle$2 = "_circle_jzalm_13";
79
79
  const text$4 = "_text_jzalm_17";
80
- const defaultStyles$p = {
80
+ const defaultStyles$q = {
81
81
  container: container$4,
82
82
  dot,
83
- circle: circle$1,
83
+ circle: circle$2,
84
84
  text: text$4
85
85
  };
86
86
  const DOT_TYPE = {
@@ -94,10 +94,10 @@
94
94
  abbreviation
95
95
  }) => {
96
96
  const defaultStylesCopy = {
97
- ...defaultStyles$p
97
+ ...defaultStyles$q
98
98
  };
99
99
  if (dotType === DOT_TYPE.round) {
100
- defaultStylesCopy.dot = mergeStyles(defaultStyles$p.dot, defaultStyles$p.circle);
100
+ defaultStylesCopy.dot = mergeStyles(defaultStyles$q.dot, defaultStyles$q.circle);
101
101
  }
102
102
  styles2 = mergeStyles(defaultStylesCopy, styles2);
103
103
  return jsxRuntime.jsxs("div", {
@@ -132,7 +132,7 @@
132
132
  const bar$2 = "_bar_wmb0k_1";
133
133
  const label$1 = "_label_wmb0k_5";
134
134
  const backgroundRect = "_backgroundRect_wmb0k_11";
135
- const defaultStyles$o = {
135
+ const defaultStyles$p = {
136
136
  bar: bar$2,
137
137
  label: label$1,
138
138
  backgroundRect
@@ -166,7 +166,7 @@
166
166
  setHideLabels(false);
167
167
  }, [stack, width, height]);
168
168
  styles2 = mergeStyles({
169
- ...defaultStyles$o
169
+ ...defaultStyles$p
170
170
  }, styles2);
171
171
  let totalWidth = 0;
172
172
  const content2 = stack.map((d2, index2) => {
@@ -222,62 +222,153 @@
222
222
  children: content2
223
223
  });
224
224
  }
225
- const svg$7 = "_svg_un4gp_1";
226
- const previous = "_previous_un4gp_7";
227
- const next = "_next_un4gp_11";
228
- const defaultStyles$n = {
229
- svg: svg$7,
225
+ function shouldUpdate(oldState, newState) {
226
+ if (oldState === newState)
227
+ return false;
228
+ if (isObj(oldState) && isObj(newState)) {
229
+ for (let key in newState) {
230
+ if (oldState[key] !== newState[key])
231
+ return true;
232
+ }
233
+ return false;
234
+ }
235
+ return true;
236
+ }
237
+ function isObj(obj) {
238
+ return typeof obj === "object" && !Array.isArray(obj) && obj !== null;
239
+ }
240
+ function createStore(initialStore) {
241
+ let store = initialStore;
242
+ const listeners = /* @__PURE__ */ new Set();
243
+ function useStore(selectorFn = (store2) => store2) {
244
+ const subscribe = hooks.useCallback((updater) => {
245
+ const listener = {
246
+ updater,
247
+ selectorFn
248
+ };
249
+ listeners.add(listener);
250
+ return () => {
251
+ listeners.delete(listener);
252
+ };
253
+ }, []);
254
+ const syncedStore = compat.useSyncExternalStore(subscribe, getStore, getServerStore);
255
+ return selectorFn(syncedStore);
256
+ }
257
+ function setStore(action) {
258
+ const oldStore = store;
259
+ store = action instanceof Function ? action(store) : action;
260
+ listeners.forEach(({
261
+ selectorFn,
262
+ updater
263
+ }) => {
264
+ const oldState = selectorFn(oldStore);
265
+ const newState = selectorFn(store);
266
+ if (shouldUpdate(oldState, newState))
267
+ updater(() => newState);
268
+ });
269
+ }
270
+ function getStore() {
271
+ return store;
272
+ }
273
+ function getServerStore() {
274
+ return initialStore;
275
+ }
276
+ return [useStore, setStore, getStore];
277
+ }
278
+ const [useGradients, setGradients, getGradients] = createStore({});
279
+ const svg$8 = "_svg_1cajk_6";
280
+ const previous = "_previous_1cajk_12";
281
+ const next = "_next_1cajk_16";
282
+ const defaultStyles$o = {
283
+ svg: svg$8,
230
284
  previous,
231
285
  next
232
286
  };
233
- const GradientIcon = ({
234
- previous: previous2,
235
- next: next2,
236
- styles: styles2
237
- }) => {
238
- styles2 = mergeStyles({
239
- ...defaultStyles$n
240
- }, styles2);
241
- const gradientId = hooks.useId();
242
- return jsxRuntime.jsxs("svg", {
287
+ const GradientIcon = (props) => {
288
+ let {
289
+ previous: previous2,
290
+ next: next2,
291
+ styles: styles2
292
+ } = props;
293
+ styles2 = mergeStyles(defaultStyles$o, styles2);
294
+ const gradientId = `gv-gradient-def-${previous2}-${next2}`;
295
+ const gradients = useGradients();
296
+ hooks.useEffect(() => {
297
+ setGradients((current) => {
298
+ current[gradientId] = {
299
+ id: gradientId,
300
+ ...props
301
+ };
302
+ return current;
303
+ });
304
+ }, [gradientId, props]);
305
+ hooks.useEffect(() => {
306
+ let container2 = document.getElementById("gv-gradient-defs");
307
+ if (!container2) {
308
+ container2 = document.createElement("div");
309
+ container2.id = "gv-gradient-defs";
310
+ document.body.prepend(container2);
311
+ }
312
+ preact.render(jsxRuntime.jsx(GradientDefs, {
313
+ gradients: Object.values(gradients)
314
+ }), container2);
315
+ }, [gradients]);
316
+ return jsxRuntime.jsx("svg", {
243
317
  class: styles2.svg,
244
318
  width: "24",
245
319
  height: "11",
246
320
  viewBox: "0 0 24 11",
247
321
  xmlns: "http://www.w3.org/2000/svg",
248
- children: [jsxRuntime.jsx("path", {
322
+ children: jsxRuntime.jsx("path", {
249
323
  d: "M0 5.434C0 2.43288 2.43288 0 5.434 0H5.69626C6.85818 0 7.9797 0.426401 8.84813 1.19834C10.6456 2.79612 13.3544 2.79612 15.1519 1.19834C16.0203 0.426401 17.1418 0 18.3037 0L18.566 0C21.5671 0 24 2.43288 24 5.434V5.566C24 8.56712 21.5671 11 18.566 11H18.3037C17.1418 11 16.0203 10.5736 15.1519 9.80166C13.3544 8.20388 10.6456 8.20388 8.84813 9.80166C7.9797 10.5736 6.85818 11 5.69626 11H5.434C2.43288 11 0 8.56712 0 5.566V5.434Z",
250
324
  fill: `url(#${gradientId})`
251
- }), jsxRuntime.jsx("defs", {
252
- children: jsxRuntime.jsxs("linearGradient", {
253
- id: gradientId,
254
- x1: "5.5",
255
- y1: "5.5",
256
- x2: "12",
257
- y2: "5.5",
258
- gradientUnits: "userSpaceOnUse",
259
- children: [jsxRuntime.jsx("stop", {
260
- class: `${styles2.previous} stop-color--${previous2}`
261
- }), jsxRuntime.jsx("stop", {
262
- class: `${styles2.next} stop-color--${next2}`,
263
- offset: "1"
264
- })]
265
- })
266
- })]
325
+ })
267
326
  });
268
327
  };
328
+ function GradientDefs({
329
+ gradients
330
+ }) {
331
+ return jsxRuntime.jsx("svg", {
332
+ width: "24",
333
+ height: "11",
334
+ viewBox: "0 0 24 11",
335
+ children: jsxRuntime.jsx("defs", {
336
+ children: gradients.map(({
337
+ id,
338
+ previous: previous2,
339
+ next: next2,
340
+ styles: styles2
341
+ }) => {
342
+ return jsxRuntime.jsxs("linearGradient", {
343
+ id,
344
+ x1: "5.5",
345
+ y1: "5.5",
346
+ x2: "12",
347
+ y2: "5.5",
348
+ gradientUnits: "userSpaceOnUse",
349
+ children: [jsxRuntime.jsx("stop", {
350
+ class: `${styles2 == null ? void 0 : styles2.previous} stop-color--${previous2}`
351
+ }), jsxRuntime.jsx("stop", {
352
+ class: `${styles2 == null ? void 0 : styles2.next} stop-color--${next2}`,
353
+ offset: "1"
354
+ })]
355
+ }, id);
356
+ })
357
+ })
358
+ });
359
+ }
269
360
  const button$4 = "_button_kpmyt_1";
270
- const svg$6 = "_svg_kpmyt_14";
271
- const defaultStyles$m = {
361
+ const svg$7 = "_svg_kpmyt_14";
362
+ const defaultStyles$n = {
272
363
  button: button$4,
273
- svg: svg$6
364
+ svg: svg$7
274
365
  };
275
366
  const InfoButton = ({
276
367
  onClick,
277
368
  styles: styles2
278
369
  }) => {
279
370
  styles2 = mergeStyles({
280
- ...defaultStyles$m
371
+ ...defaultStyles$n
281
372
  }, styles2);
282
373
  return jsxRuntime.jsx("button", {
283
374
  class: styles2.button,
@@ -292,28 +383,32 @@
292
383
  })
293
384
  });
294
385
  };
295
- const circleicon = "_circleicon_1ge2m_1";
296
- const rect = "_rect_1ge2m_7";
297
- const defaultStyles$l = {
298
- circleicon,
299
- rect
386
+ const svg$6 = "_svg_1v49v_1";
387
+ const circle$1 = "_circle_1v49v_5";
388
+ const pulse = "_pulse_1v49v_9";
389
+ const defaultStyles$m = {
390
+ svg: svg$6,
391
+ circle: circle$1,
392
+ pulse
300
393
  };
301
394
  const CircleIcon = ({
302
- abbreviation,
395
+ color,
396
+ pulse: pulse2 = false,
303
397
  styles: styles2
304
398
  }) => {
305
- styles2 = mergeStyles({
306
- ...defaultStyles$l
307
- }, styles2);
399
+ styles2 = mergeStyles(defaultStyles$m, styles2);
308
400
  return jsxRuntime.jsx("svg", {
309
- style: styles2.circleicon,
401
+ style: styles2.svg,
310
402
  fill: "none",
311
403
  height: "11",
312
404
  viewBox: "0 0 11 11",
313
405
  width: "11",
314
406
  xmlns: "http://www.w3.org/2000/svg",
315
407
  children: jsxRuntime.jsx("rect", {
316
- class: `${styles2.rect} fill-color--${abbreviation}`,
408
+ class: [styles2.circle, pulse2 && styles2.pulse].join(" "),
409
+ style: {
410
+ fill: color
411
+ },
317
412
  height: "11",
318
413
  rx: "5.5",
319
414
  width: "11"
@@ -321,7 +416,7 @@
321
416
  });
322
417
  };
323
418
  const text$3 = "_text_1okyv_1";
324
- const defaultStyles$k = {
419
+ const defaultStyles$l = {
325
420
  text: text$3
326
421
  };
327
422
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -671,7 +766,7 @@
671
766
  styles: styles2
672
767
  }) => {
673
768
  styles2 = mergeStyles({
674
- ...defaultStyles$k
769
+ ...defaultStyles$l
675
770
  }, styles2);
676
771
  let timeSince = dayjs(timeStamp).fromNow();
677
772
  return jsxRuntime.jsx("span", {
@@ -681,7 +776,7 @@
681
776
  };
682
777
  const pageContainer = "_pageContainer_1s0yq_9";
683
778
  const sideBorders = "_sideBorders_1s0yq_42";
684
- const defaultStyles$j = {
779
+ const defaultStyles$k = {
685
780
  pageContainer,
686
781
  sideBorders
687
782
  };
@@ -693,14 +788,14 @@
693
788
  const {
694
789
  pageContainer: pageContainer2,
695
790
  sideBorders: sideBordersStyle
696
- } = mergeStyles(defaultStyles$j, styles2);
791
+ } = mergeStyles(defaultStyles$k, styles2);
697
792
  return jsxRuntime.jsx("div", {
698
793
  className: [pageContainer2, sideBorders2 && sideBordersStyle].join(" "),
699
794
  children
700
795
  });
701
796
  }
702
797
  const bar$1 = "_bar_17pyf_9";
703
- const defaultStyles$i = {
798
+ const defaultStyles$j = {
704
799
  bar: bar$1
705
800
  };
706
801
  function ChangeBar({
@@ -718,7 +813,7 @@
718
813
  let thisStyles = ` height: ${height}; width: ${barwidth}px; ${positive ? `left: ${posleft}` : `left: ${negleft}`}`;
719
814
  let thisColor = ` bg-color--${party}`;
720
815
  styles2 = mergeStyles({
721
- ...defaultStyles$i
816
+ ...defaultStyles$j
722
817
  }, styles2);
723
818
  return jsxRuntime.jsx("div", {
724
819
  className: styles2.wrapper,
@@ -733,7 +828,7 @@
733
828
  const dividingLineColor = "_dividingLineColor_886i1_16";
734
829
  const square = "_square_886i1_20";
735
830
  const corner = "_corner_886i1_24";
736
- const defaultStyles$h = {
831
+ const defaultStyles$i = {
737
832
  svg: svg$5,
738
833
  dividingLineColor,
739
834
  square,
@@ -746,7 +841,7 @@
746
841
  styles: styles2
747
842
  }) => {
748
843
  styles2 = mergeStyles({
749
- ...defaultStyles$h
844
+ ...defaultStyles$i
750
845
  }, styles2);
751
846
  let cornerSize = squareSize * 0.625;
752
847
  let cornerMargin = squareSize < 100 ? squareSize / 6 : 10;
@@ -784,7 +879,7 @@
784
879
  const stackedGridRotateItems90 = "_stackedGridRotateItems90_1e05o_19";
785
880
  const stackedGridRotateItems180 = "_stackedGridRotateItems180_1e05o_25";
786
881
  const stackedGridRotateItems270 = "_stackedGridRotateItems270_1e05o_31";
787
- const defaultStyles$g = {
882
+ const defaultStyles$h = {
788
883
  stackedGridContainer,
789
884
  stackedGridRotateItems0,
790
885
  stackedGridRotateItems90,
@@ -823,7 +918,7 @@
823
918
  width: containerWidth,
824
919
  transform: containerFlip
825
920
  };
826
- styles2 = mergeStyles(defaultStyles$g, styles2);
921
+ styles2 = mergeStyles(defaultStyles$h, styles2);
827
922
  return jsxRuntime.jsx("div", {
828
923
  style: flexStyles,
829
924
  className: `${styles2.stackedGridContainer} ${styles2[itemRotateClass]}`,
@@ -832,7 +927,7 @@
832
927
  };
833
928
  const svg$4 = "_svg_l2fsl_9";
834
929
  const squareFill = "_squareFill_l2fsl_16";
835
- const defaultStyles$f = {
930
+ const defaultStyles$g = {
836
931
  svg: svg$4,
837
932
  squareFill
838
933
  };
@@ -842,7 +937,7 @@
842
937
  styles: styles2
843
938
  }) => {
844
939
  styles2 = mergeStyles({
845
- ...defaultStyles$f
940
+ ...defaultStyles$g
846
941
  }, styles2);
847
942
  return jsxRuntime.jsx("svg", {
848
943
  width: size,
@@ -860,7 +955,7 @@
860
955
  };
861
956
  const button$3 = "_button_1fees_1";
862
957
  const icon = "_icon_1fees_6";
863
- const defaultStyles$e = {
958
+ const defaultStyles$f = {
864
959
  button: button$3,
865
960
  icon
866
961
  };
@@ -870,7 +965,7 @@
870
965
  styles: styles2,
871
966
  onClick
872
967
  }) {
873
- styles2 = mergeStyles(defaultStyles$e, styles2);
968
+ styles2 = mergeStyles(defaultStyles$f, styles2);
874
969
  return jsxRuntime.jsx("button", {
875
970
  className: styles2.button,
876
971
  disabled,
@@ -896,7 +991,7 @@
896
991
  }
897
992
  const button$2 = "_button_19t7j_1";
898
993
  const buttonInner$1 = "_buttonInner_19t7j_6";
899
- const defaultStyles$d = {
994
+ const defaultStyles$e = {
900
995
  button: button$2,
901
996
  buttonInner: buttonInner$1
902
997
  };
@@ -906,7 +1001,7 @@
906
1001
  styles: styles2,
907
1002
  children
908
1003
  }) {
909
- styles2 = mergeStyles(defaultStyles$d, styles2);
1004
+ styles2 = mergeStyles(defaultStyles$e, styles2);
910
1005
  return jsxRuntime.jsx("button", {
911
1006
  className: styles2.button,
912
1007
  "data-type": type,
@@ -921,7 +1016,7 @@
921
1016
  const buttonBorder = "_buttonBorder_6w12u_10";
922
1017
  const svg$3 = "_svg_6w12u_18";
923
1018
  const path$3 = "_path_6w12u_24";
924
- const defaultStyles$c = {
1019
+ const defaultStyles$d = {
925
1020
  button: button$1,
926
1021
  buttonBorder,
927
1022
  svg: svg$3,
@@ -932,7 +1027,7 @@
932
1027
  onClick,
933
1028
  styles: styles2
934
1029
  }) {
935
- styles2 = mergeStyles(defaultStyles$c, styles2);
1030
+ styles2 = mergeStyles(defaultStyles$d, styles2);
936
1031
  return jsxRuntime.jsx("button", {
937
1032
  className: [styles2.button, border && styles2.buttonBorder].join(" "),
938
1033
  onClick,
@@ -1075,7 +1170,7 @@
1075
1170
  const headerCellButton = "_headerCellButton_1b75c_39";
1076
1171
  const bodyRow = "_bodyRow_1b75c_48";
1077
1172
  const bodyCell = "_bodyCell_1b75c_53";
1078
- const defaultStyles$b = {
1173
+ const defaultStyles$c = {
1079
1174
  table,
1080
1175
  hideHeader,
1081
1176
  hideHeaderNoBorder,
@@ -1116,7 +1211,7 @@
1116
1211
  };
1117
1212
  });
1118
1213
  };
1119
- styles2 = mergeStyles(defaultStyles$b, styles2);
1214
+ styles2 = mergeStyles(defaultStyles$c, styles2);
1120
1215
  return jsxRuntime.jsxs("table", {
1121
1216
  className: styles2.table,
1122
1217
  children: [jsxRuntime.jsx("thead", {
@@ -1249,7 +1344,7 @@
1249
1344
  const y2Label = "_y2Label_gj7pr_28";
1250
1345
  const axis$1 = "_axis_gj7pr_32";
1251
1346
  const axisLabel = "_axisLabel_gj7pr_37";
1252
- const defaultStyles$a = {
1347
+ const defaultStyles$b = {
1253
1348
  slopeChartContainer,
1254
1349
  svg: svg$2,
1255
1350
  line,
@@ -1301,7 +1396,7 @@
1301
1396
  return positionLabels(labels);
1302
1397
  }, [lines, y2Label2, yScale]);
1303
1398
  styles2 = mergeStyles({
1304
- ...defaultStyles$a
1399
+ ...defaultStyles$b
1305
1400
  }, styles2);
1306
1401
  const chart = jsxRuntime.jsx("svg", {
1307
1402
  class: styles2.svg,
@@ -1390,9 +1485,9 @@
1390
1485
  clientY,
1391
1486
  currentTarget
1392
1487
  }) => {
1393
- const rect2 = currentTarget.getBoundingClientRect();
1394
- const x = clientX - rect2.left;
1395
- const y = clientY - rect2.top;
1488
+ const rect = currentTarget.getBoundingClientRect();
1489
+ const x = clientX - rect.left;
1490
+ const y = clientY - rect.top;
1396
1491
  requestAnimationFrame(() => {
1397
1492
  setPosition({
1398
1493
  x,
@@ -1524,7 +1619,7 @@
1524
1619
  });
1525
1620
  }
1526
1621
  const tooltip = "_tooltip_11t5d_1";
1527
- const defaultStyles$9 = {
1622
+ const defaultStyles$a = {
1528
1623
  tooltip
1529
1624
  };
1530
1625
  const TooltipType = {
@@ -1552,7 +1647,7 @@
1552
1647
  hoverActive
1553
1648
  } = useTooltipTarget(targetElement, trackPosition);
1554
1649
  const tooltipRef = hooks.useRef(null);
1555
- styles2 = mergeStyles(defaultStyles$9, styles2);
1650
+ styles2 = mergeStyles(defaultStyles$a, styles2);
1556
1651
  hooks.useEffect(() => {
1557
1652
  let element = null;
1558
1653
  if (typeof refOrSelector === "string") {
@@ -1647,7 +1742,7 @@
1647
1742
  }
1648
1743
  const text$2 = "_text_1b8t2_1";
1649
1744
  const container$3 = "_container_1b8t2_10";
1650
- const defaultStyles$8 = {
1745
+ const defaultStyles$9 = {
1651
1746
  text: text$2,
1652
1747
  container: container$3
1653
1748
  };
@@ -1658,7 +1753,7 @@
1658
1753
  styles: styles2
1659
1754
  }) => {
1660
1755
  styles2 = mergeStyles({
1661
- ...defaultStyles$8
1756
+ ...defaultStyles$9
1662
1757
  }, styles2);
1663
1758
  let hasChanged = next2 !== previous2;
1664
1759
  return jsxRuntime.jsx("div", {
@@ -1672,9 +1767,8 @@
1672
1767
  next: styles2.next
1673
1768
  }
1674
1769
  }) : jsxRuntime.jsx(CircleIcon, {
1675
- abbreviation: next2,
1676
1770
  styles: {
1677
- rect: styles2.next
1771
+ circle: styles2.next || `fill-color--${next2}`
1678
1772
  }
1679
1773
  }), jsxRuntime.jsx("strong", {
1680
1774
  className: styles2.text,
@@ -1683,16 +1777,20 @@
1683
1777
  })
1684
1778
  });
1685
1779
  };
1686
- const toplineResult = "_toplineResult_lvw57_9";
1687
- const name = "_name_lvw57_12";
1688
- const displayNumbers = "_displayNumbers_lvw57_25";
1689
- const mainNumber = "_mainNumber_lvw57_34";
1690
- const secondaryNumber = "_secondaryNumber_lvw57_38";
1691
- const displayRow = "_displayRow_lvw57_45";
1692
- const displayColumn = "_displayColumn_lvw57_51";
1693
- const topRow = "_topRow_lvw57_55";
1694
- const defaultStyles$7 = {
1780
+ const toplineResult = "_toplineResult_w8o28_9";
1781
+ const primaryname = "_primaryname_w8o28_12";
1782
+ const secondaryname = "_secondaryname_w8o28_26";
1783
+ const name = "_name_w8o28_32";
1784
+ const displayNumbers = "_displayNumbers_w8o28_45";
1785
+ const mainNumber = "_mainNumber_w8o28_54";
1786
+ const secondaryNumber = "_secondaryNumber_w8o28_58";
1787
+ const displayRow = "_displayRow_w8o28_65";
1788
+ const displayColumn = "_displayColumn_w8o28_71";
1789
+ const topRow = "_topRow_w8o28_75";
1790
+ const defaultStyles$8 = {
1695
1791
  toplineResult,
1792
+ primaryname,
1793
+ secondaryname,
1696
1794
  name,
1697
1795
  displayNumbers,
1698
1796
  mainNumber,
@@ -1703,6 +1801,7 @@
1703
1801
  };
1704
1802
  const ToplineResult = ({
1705
1803
  name: name2,
1804
+ secondaryName,
1706
1805
  mainNumber: mainNumber2,
1707
1806
  secondaryNumber: secondaryNumber2,
1708
1807
  styles: styles2,
@@ -1713,40 +1812,74 @@
1713
1812
  showInfoButton = false
1714
1813
  }) => {
1715
1814
  styles2 = mergeStyles({
1716
- ...defaultStyles$7
1815
+ ...defaultStyles$8
1717
1816
  }, styles2);
1718
1817
  const displayStyle = displayRow2 ? styles2.displayRow : styles2.displayColumn;
1719
- return jsxRuntime.jsxs("div", {
1720
- class: styles2.toplineResult,
1721
- onMouseOver,
1722
- children: [jsxRuntime.jsxs("div", {
1723
- class: styles2.topRow,
1724
- children: [jsxRuntime.jsx("span", {
1725
- class: `${styles2.name} before-color--${abbreviation}`,
1726
- children: name2
1727
- }), " ", showInfoButton && jsxRuntime.jsx("span", {
1728
- class: styles2.infoButton,
1729
- children: jsxRuntime.jsx(InfoButton, {
1730
- onClick: onInfoPress
1731
- })
1732
- })]
1733
- }), jsxRuntime.jsxs("div", {
1734
- class: `${styles2.displayNumbers} ${displayStyle}`,
1735
- children: [jsxRuntime.jsx("div", {
1736
- class: styles2.mainNumber,
1737
- children: mainNumber2
1738
- }), jsxRuntime.jsx("div", {
1739
- class: styles2.secondaryNumber,
1740
- children: secondaryNumber2
1818
+ return !secondaryName ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
1819
+ children: [" ", jsxRuntime.jsxs("div", {
1820
+ class: styles2.toplineResult,
1821
+ onMouseOver,
1822
+ children: [jsxRuntime.jsxs("div", {
1823
+ class: styles2.topRow,
1824
+ children: [jsxRuntime.jsx("span", {
1825
+ class: `${styles2.name} before-color--${abbreviation}`,
1826
+ children: name2
1827
+ }), " ", showInfoButton && jsxRuntime.jsx("span", {
1828
+ class: styles2.infoButton,
1829
+ children: jsxRuntime.jsx(InfoButton, {
1830
+ onClick: onInfoPress
1831
+ })
1832
+ })]
1833
+ }), jsxRuntime.jsxs("div", {
1834
+ class: `${styles2.displayNumbers} ${displayStyle}`,
1835
+ children: [jsxRuntime.jsx("div", {
1836
+ class: styles2.mainNumber,
1837
+ children: mainNumber2
1838
+ }), jsxRuntime.jsx("div", {
1839
+ class: styles2.secondaryNumber,
1840
+ children: secondaryNumber2
1841
+ })]
1741
1842
  })]
1742
1843
  })]
1844
+ }) : jsxRuntime.jsx(jsxRuntime.Fragment, {
1845
+ children: jsxRuntime.jsxs("div", {
1846
+ class: styles2.toplineResult,
1847
+ onMouseOver,
1848
+ children: [jsxRuntime.jsxs("div", {
1849
+ class: styles2.topRow,
1850
+ children: [jsxRuntime.jsx("span", {
1851
+ class: `${styles2.primaryname} before-color--${abbreviation}`,
1852
+ children: name2
1853
+ }), " ", showInfoButton && jsxRuntime.jsx("span", {
1854
+ class: styles2.infoButton,
1855
+ children: jsxRuntime.jsx(InfoButton, {
1856
+ onClick: onInfoPress
1857
+ })
1858
+ })]
1859
+ }), jsxRuntime.jsxs("div", {
1860
+ class: styles2.subhead,
1861
+ children: [jsxRuntime.jsx("span", {
1862
+ class: styles2.secondaryname,
1863
+ children: secondaryName
1864
+ }), " "]
1865
+ }), jsxRuntime.jsxs("div", {
1866
+ class: `${styles2.displayNumbers} ${displayStyle}`,
1867
+ children: [jsxRuntime.jsx("div", {
1868
+ class: styles2.mainNumber,
1869
+ children: mainNumber2
1870
+ }), jsxRuntime.jsx("div", {
1871
+ class: styles2.secondaryNumber,
1872
+ children: secondaryNumber2
1873
+ })]
1874
+ })]
1875
+ })
1743
1876
  });
1744
1877
  };
1745
- const section = "_section_te61d_9";
1746
- const borderTop = "_borderTop_te61d_13";
1747
- const header = "_header_te61d_45";
1748
- const content = "_content_te61d_65";
1749
- const defaultStyles$6 = {
1878
+ const section = "_section_12aiu_9";
1879
+ const borderTop = "_borderTop_12aiu_52";
1880
+ const header = "_header_12aiu_56";
1881
+ const content = "_content_12aiu_76";
1882
+ const defaultStyles$7 = {
1750
1883
  section,
1751
1884
  borderTop,
1752
1885
  header,
@@ -1755,14 +1888,18 @@
1755
1888
  const PageSection = compat.forwardRef(({
1756
1889
  children,
1757
1890
  styles: styles2,
1758
- borderTop: borderTop2 = false
1891
+ borderTop: borderTop2 = false,
1892
+ backgroundColor = "transparent"
1759
1893
  }, ref) => {
1760
1894
  styles2 = mergeStyles({
1761
- ...defaultStyles$6
1895
+ ...defaultStyles$7
1762
1896
  }, styles2);
1763
1897
  return jsxRuntime.jsxs("section", {
1764
1898
  ref,
1765
1899
  className: [styles2.section, borderTop2 && styles2.borderTop].join(" "),
1900
+ style: {
1901
+ "--background-color": backgroundColor
1902
+ },
1766
1903
  children: [jsxRuntime.jsx("div", {
1767
1904
  className: styles2.header,
1768
1905
  children: children.header
@@ -1775,7 +1912,7 @@
1775
1912
  const text$1 = "_text_lo5h3_1";
1776
1913
  const axis = "_axis_lo5h3_6";
1777
1914
  const bar = "_bar_lo5h3_10";
1778
- const defaultStyles$5 = {
1915
+ const defaultStyles$6 = {
1779
1916
  text: text$1,
1780
1917
  axis,
1781
1918
  bar
@@ -1790,17 +1927,16 @@
1790
1927
  columnPadding,
1791
1928
  styles: styles2
1792
1929
  }) => {
1793
- styles2 = mergeStyles(defaultStyles$5, styles2);
1930
+ styles2 = mergeStyles(defaultStyles$6, styles2);
1794
1931
  const yScale = d3Scale.scaleLinear([maxValue, minValue], [0, chartHeight]);
1932
+ const totalColumnWidth = Number(columnWidth) + Number(columnPadding.left) + Number(columnPadding.right);
1795
1933
  return jsxRuntime.jsxs("svg", {
1796
1934
  width: chartWidth,
1797
1935
  height: chartHeight,
1798
- style: "",
1799
1936
  children: [columns.map((column, index2) => {
1800
1937
  const getHeight = (input2) => {
1801
1938
  return yScale(0) - yScale(input2);
1802
1939
  };
1803
- let totalColumnWidth = Number(columnWidth) + Number(columnPadding.left) + Number(columnPadding.right);
1804
1940
  return jsxRuntime.jsxs("g", {
1805
1941
  children: [jsxRuntime.jsx("rect", {
1806
1942
  x: index2 * totalColumnWidth,
@@ -1810,7 +1946,7 @@
1810
1946
  fill: column.color,
1811
1947
  className: `${styles2.bar} fill-color--${column.id}`,
1812
1948
  id: column.id
1813
- }, index2), jsxRuntime.jsx("text", {
1949
+ }), jsxRuntime.jsx("text", {
1814
1950
  className: styles2.text,
1815
1951
  x: index2 * totalColumnWidth + 2,
1816
1952
  y: column.value < 0 ? yScale(0) - 6 : yScale(0) + 20,
@@ -1834,7 +1970,7 @@
1834
1970
  const leftCell = "_leftCell_vd5ly_55";
1835
1971
  const rightCell = "_rightCell_vd5ly_55";
1836
1972
  const mugshot = "_mugshot_vd5ly_71";
1837
- const defaultStyles$4 = {
1973
+ const defaultStyles$5 = {
1838
1974
  text,
1839
1975
  container: container$2,
1840
1976
  title: title$1,
@@ -1853,7 +1989,7 @@
1853
1989
  abbreviation
1854
1990
  }) => {
1855
1991
  styles2 = mergeStyles({
1856
- ...defaultStyles$4
1992
+ ...defaultStyles$5
1857
1993
  }, styles2);
1858
1994
  return jsxRuntime.jsx("div", {
1859
1995
  class: styles2.container,
@@ -2162,7 +2298,7 @@
2162
2298
  });
2163
2299
  }
2164
2300
  const path$1 = "_path_1cwd5_9";
2165
- const defaultStyles$3 = {
2301
+ const defaultStyles$4 = {
2166
2302
  path: path$1
2167
2303
  };
2168
2304
  function CompositionBorders({
@@ -2171,7 +2307,7 @@
2171
2307
  const {
2172
2308
  projection
2173
2309
  } = hooks.useContext(MapContext);
2174
- styles2 = mergeStyles(defaultStyles$3, styles2);
2310
+ styles2 = mergeStyles(defaultStyles$4, styles2);
2175
2311
  return jsxRuntime.jsx("path", {
2176
2312
  className: styles2.path,
2177
2313
  d: projection.getCompositionBorders()
@@ -2470,7 +2606,7 @@
2470
2606
  });
2471
2607
  const container = "_container_azu4a_1";
2472
2608
  const paragraph = "_paragraph_azu4a_12";
2473
- const defaultStyles$2 = {
2609
+ const defaultStyles$3 = {
2474
2610
  container,
2475
2611
  paragraph
2476
2612
  };
@@ -2483,7 +2619,7 @@
2483
2619
  styles: styles2
2484
2620
  }) {
2485
2621
  styles2 = mergeStyles({
2486
- ...defaultStyles$2
2622
+ ...defaultStyles$3
2487
2623
  }, styles2);
2488
2624
  return jsxRuntime.jsxs("div", {
2489
2625
  class: styles2.container,
@@ -2526,7 +2662,7 @@
2526
2662
  const suggestion = "_suggestion_g5w44_36";
2527
2663
  const selected = "_selected_g5w44_59";
2528
2664
  const highlighted = "_highlighted_g5w44_63";
2529
- const defaultStyles$1 = {
2665
+ const defaultStyles$2 = {
2530
2666
  searchContainer,
2531
2667
  input,
2532
2668
  searchIcon,
@@ -2547,7 +2683,7 @@
2547
2683
  styles: styles2
2548
2684
  }) {
2549
2685
  var _a, _b, _c;
2550
- styles2 = mergeStyles(defaultStyles$1, styles2);
2686
+ styles2 = mergeStyles(defaultStyles$2, styles2);
2551
2687
  const inputRef = hooks.useRef(null);
2552
2688
  const [selectedIndex, setSelectedIndex] = hooks.useState(-1);
2553
2689
  const [suggestions2, setSuggestions] = hooks.useState();
@@ -2656,6 +2792,32 @@
2656
2792
  })
2657
2793
  });
2658
2794
  }
2795
+ const refreshIndicator = "_refreshIndicator_u6lji_1";
2796
+ const liveText = "_liveText_u6lji_8";
2797
+ const refreshText = "_refreshText_u6lji_9";
2798
+ const defaultStyles$1 = {
2799
+ refreshIndicator,
2800
+ liveText,
2801
+ refreshText
2802
+ };
2803
+ function RefreshIndicator({
2804
+ text: text2,
2805
+ styles: styles2
2806
+ }) {
2807
+ styles2 = mergeStyles(defaultStyles$1, styles2);
2808
+ return jsxRuntime.jsxs("div", {
2809
+ className: styles2.refreshIndicator,
2810
+ children: [jsxRuntime.jsx(CircleIcon, {
2811
+ pulse: true
2812
+ }), jsxRuntime.jsx("span", {
2813
+ className: styles2.liveText,
2814
+ children: "LIVE"
2815
+ }), jsxRuntime.jsx("span", {
2816
+ className: styles2.refreshText,
2817
+ children: text2
2818
+ })]
2819
+ });
2820
+ }
2659
2821
  const coalitionsWrapper = "_coalitionsWrapper_1ahqy_9";
2660
2822
  const coalitionsContainer = "_coalitionsContainer_1ahqy_14";
2661
2823
  const coalition = "_coalition_1ahqy_9";
@@ -2958,6 +3120,7 @@
2958
3120
  exports2.PageSection = PageSection;
2959
3121
  exports2.PartyProfile = PartyProfile;
2960
3122
  exports2.Projection = Projection;
3123
+ exports2.RefreshIndicator = RefreshIndicator;
2961
3124
  exports2.RelativeTimeSentence = RelativeTimeSentence;
2962
3125
  exports2.ResultSummary = ResultSummary;
2963
3126
  exports2.SearchInput = SearchInput;