@guardian/interactive-component-library 0.1.0-alpha.19 → 0.1.0-alpha.21
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.
|
@@ -18,6 +18,8 @@ const defaultStyles$t = {
|
|
|
18
18
|
active
|
|
19
19
|
};
|
|
20
20
|
function mergeStyles(firstStyle, secondStyle) {
|
|
21
|
+
if (!firstStyle)
|
|
22
|
+
return secondStyle;
|
|
21
23
|
if (!secondStyle)
|
|
22
24
|
return firstStyle;
|
|
23
25
|
if (typeof firstStyle === "string") {
|
|
@@ -28,14 +30,7 @@ function mergeStyles(firstStyle, secondStyle) {
|
|
|
28
30
|
}
|
|
29
31
|
const allKeys = /* @__PURE__ */ new Set([...Object.keys(firstStyle), ...Object.keys(secondStyle)]);
|
|
30
32
|
const merged = Array.from(allKeys).reduce((result, key) => {
|
|
31
|
-
|
|
32
|
-
if (firstStyle && key in firstStyle) {
|
|
33
|
-
classNames.push(firstStyle[key]);
|
|
34
|
-
}
|
|
35
|
-
if (secondStyle && key in secondStyle) {
|
|
36
|
-
classNames.push(secondStyle[key]);
|
|
37
|
-
}
|
|
38
|
-
result[key] = classNames.join(" ");
|
|
33
|
+
result[key] = mergeStyles(firstStyle[key], secondStyle[key]);
|
|
39
34
|
return result;
|
|
40
35
|
}, {});
|
|
41
36
|
return merged;
|
|
@@ -44,9 +39,14 @@ const DIRECTION = {
|
|
|
44
39
|
up: "up",
|
|
45
40
|
down: "down"
|
|
46
41
|
};
|
|
42
|
+
const SIZE = {
|
|
43
|
+
small: "small",
|
|
44
|
+
large: "large"
|
|
45
|
+
};
|
|
47
46
|
function Chevron({
|
|
48
47
|
active: active2 = false,
|
|
49
48
|
direction = DIRECTION.down,
|
|
49
|
+
size = SIZE.small,
|
|
50
50
|
styles: styles2
|
|
51
51
|
}) {
|
|
52
52
|
const defaultStylesCopy = {
|
|
@@ -59,6 +59,15 @@ function Chevron({
|
|
|
59
59
|
defaultStylesCopy.group = mergeStyles(defaultStyles$t.group, defaultStyles$t.rotated);
|
|
60
60
|
}
|
|
61
61
|
styles2 = mergeStyles(defaultStylesCopy, styles2);
|
|
62
|
+
return size === SIZE.small ? jsx(SmallChevron, {
|
|
63
|
+
styles: styles2
|
|
64
|
+
}) : jsx(LargeChevron, {
|
|
65
|
+
styles: styles2
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function SmallChevron({
|
|
69
|
+
styles: styles2
|
|
70
|
+
}) {
|
|
62
71
|
return jsx("svg", {
|
|
63
72
|
width: "16",
|
|
64
73
|
height: "24",
|
|
@@ -78,15 +87,34 @@ function Chevron({
|
|
|
78
87
|
})
|
|
79
88
|
});
|
|
80
89
|
}
|
|
90
|
+
function LargeChevron({
|
|
91
|
+
styles: styles2
|
|
92
|
+
}) {
|
|
93
|
+
return jsx("svg", {
|
|
94
|
+
width: "15",
|
|
95
|
+
height: "19",
|
|
96
|
+
className: styles2.svg,
|
|
97
|
+
viewBox: "0 0 15 19",
|
|
98
|
+
fill: "none",
|
|
99
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
100
|
+
children: jsx("g", {
|
|
101
|
+
className: styles2.group,
|
|
102
|
+
children: jsx("path", {
|
|
103
|
+
d: "M0.667809 7.5L6.81507 12.1053L8.18493 12.1053L14.3322 7.5L15 8.09868L7.84247 14.5L7.15753 14.5L-2.61693e-08 8.09868L0.667809 7.5Z",
|
|
104
|
+
className: styles2.path
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
81
109
|
const container$5 = "_container_jzalm_1";
|
|
82
110
|
const dot = "_dot_jzalm_6";
|
|
83
111
|
const circle$2 = "_circle_jzalm_13";
|
|
84
|
-
const text$
|
|
112
|
+
const text$3 = "_text_jzalm_17";
|
|
85
113
|
const defaultStyles$s = {
|
|
86
114
|
container: container$5,
|
|
87
115
|
dot,
|
|
88
116
|
circle: circle$2,
|
|
89
|
-
text: text$
|
|
117
|
+
text: text$3
|
|
90
118
|
};
|
|
91
119
|
const DOT_TYPE = {
|
|
92
120
|
round: "round",
|
|
@@ -123,9 +151,7 @@ const defaultStyles$r = {
|
|
|
123
151
|
label: label$1,
|
|
124
152
|
backgroundRect
|
|
125
153
|
};
|
|
126
|
-
function preventOverlap(labelPositions, iteration = 0, labelSize = 12, coordinate = "y") {
|
|
127
|
-
const maxIterations = 10;
|
|
128
|
-
let totalOverlap = 0;
|
|
154
|
+
function preventOverlap(labelPositions, iteration = 0, labelSize = 12, coordinate = "y", moveBothLabels = true) {
|
|
129
155
|
for (let index2 = 1; index2 < labelPositions.length; index2++) {
|
|
130
156
|
const previousElement = labelPositions[index2 - 1];
|
|
131
157
|
const element = labelPositions[index2];
|
|
@@ -133,22 +159,22 @@ function preventOverlap(labelPositions, iteration = 0, labelSize = 12, coordinat
|
|
|
133
159
|
if (overlap < 0) {
|
|
134
160
|
continue;
|
|
135
161
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
162
|
+
if (moveBothLabels) {
|
|
163
|
+
previousElement[coordinate] -= overlap / 2;
|
|
164
|
+
element[coordinate] += overlap / 2;
|
|
165
|
+
} else {
|
|
166
|
+
previousElement[coordinate] -= overlap;
|
|
167
|
+
}
|
|
168
|
+
return labelPositions;
|
|
142
169
|
}
|
|
143
|
-
return labelPositions;
|
|
144
170
|
}
|
|
145
171
|
function uniqueBy(array, key) {
|
|
146
172
|
return [...array.reduce((map, d2) => map.set(d2[key], d2), /* @__PURE__ */ new Map()).values()];
|
|
147
173
|
}
|
|
148
|
-
function positionLabels(labels, coordinate = "y") {
|
|
174
|
+
function positionLabels(labels, labelSize = 12, coordinate = "y", moveBothLabels = true) {
|
|
149
175
|
labels = uniqueBy(labels, "value");
|
|
150
176
|
labels.sort((a, b) => a[coordinate] - b[coordinate]);
|
|
151
|
-
return preventOverlap(labels);
|
|
177
|
+
return preventOverlap(labels, 0, labelSize, coordinate, moveBothLabels);
|
|
152
178
|
}
|
|
153
179
|
function scaleLinear(domain, range) {
|
|
154
180
|
const [domainMin, domainMax] = domain;
|
|
@@ -168,7 +194,7 @@ function StackedBar({
|
|
|
168
194
|
width,
|
|
169
195
|
height,
|
|
170
196
|
hideLabels = false,
|
|
171
|
-
labelType = LabelType.
|
|
197
|
+
labelType = LabelType.inline,
|
|
172
198
|
showBackgroundRect = false,
|
|
173
199
|
createSVG = true,
|
|
174
200
|
styles: styles2
|
|
@@ -178,7 +204,7 @@ function StackedBar({
|
|
|
178
204
|
styles2 = mergeStyles({
|
|
179
205
|
...defaultStyles$r
|
|
180
206
|
}, styles2);
|
|
181
|
-
const svgHeight = labelType === LabelType.hanging ? height + 20 : height;
|
|
207
|
+
const svgHeight = labelType === LabelType.hanging && !hideLabels ? height + 20 : height;
|
|
182
208
|
const renderLabel = (config, i) => jsx("text", {
|
|
183
209
|
ref: (element) => textElements.current[i] = element,
|
|
184
210
|
"text-rendering": "optimizeLegibility",
|
|
@@ -189,7 +215,7 @@ function StackedBar({
|
|
|
189
215
|
x: config.x,
|
|
190
216
|
y: config.y,
|
|
191
217
|
textAnchor: config.textAnchor,
|
|
192
|
-
|
|
218
|
+
dominantBaseline: config.dominantBaseline,
|
|
193
219
|
children: config.value
|
|
194
220
|
}, `label-${i}`);
|
|
195
221
|
let totalWidth = 0;
|
|
@@ -200,7 +226,7 @@ function StackedBar({
|
|
|
200
226
|
x: itemWidth - 4,
|
|
201
227
|
y: height / 2,
|
|
202
228
|
textAnchor: "end",
|
|
203
|
-
|
|
229
|
+
dominantBaseline: "middle"
|
|
204
230
|
};
|
|
205
231
|
const value = jsxs("g", {
|
|
206
232
|
transform: `translate(${totalWidth}, 0)`,
|
|
@@ -227,13 +253,12 @@ function StackedBar({
|
|
|
227
253
|
y: height + 4,
|
|
228
254
|
value: d2.label,
|
|
229
255
|
textAnchor: "end",
|
|
230
|
-
|
|
256
|
+
dominantBaseline: "hanging"
|
|
231
257
|
};
|
|
232
|
-
console.log(labelConfig);
|
|
233
258
|
totalW += itemWidth;
|
|
234
259
|
return labelConfig;
|
|
235
260
|
});
|
|
236
|
-
return preventOverlap(labels, 0, 20, "x");
|
|
261
|
+
return preventOverlap(labels, 0, 20, "x", false);
|
|
237
262
|
}, [stack, height, width]);
|
|
238
263
|
const backgroundRect2 = jsx("g", {
|
|
239
264
|
children: jsx("rect", {
|
|
@@ -288,7 +313,7 @@ function createStore(initialStore) {
|
|
|
288
313
|
return () => {
|
|
289
314
|
listeners.delete(listener);
|
|
290
315
|
};
|
|
291
|
-
}, []);
|
|
316
|
+
}, [selectorFn]);
|
|
292
317
|
const syncedStore = useSyncExternalStore(subscribe, getStore, getServerStore);
|
|
293
318
|
return selectorFn(syncedStore);
|
|
294
319
|
}
|
|
@@ -395,10 +420,10 @@ function GradientDefs({
|
|
|
395
420
|
})
|
|
396
421
|
});
|
|
397
422
|
}
|
|
398
|
-
const button$
|
|
423
|
+
const button$5 = "_button_oqopj_1";
|
|
399
424
|
const svg$7 = "_svg_oqopj_15";
|
|
400
425
|
const defaultStyles$p = {
|
|
401
|
-
button: button$
|
|
426
|
+
button: button$5,
|
|
402
427
|
svg: svg$7
|
|
403
428
|
};
|
|
404
429
|
const InfoButton = ({
|
|
@@ -453,9 +478,9 @@ const CircleIcon = ({
|
|
|
453
478
|
})
|
|
454
479
|
});
|
|
455
480
|
};
|
|
456
|
-
const text$
|
|
481
|
+
const text$2 = "_text_1okyv_1";
|
|
457
482
|
const defaultStyles$n = {
|
|
458
|
-
text: text$
|
|
483
|
+
text: text$2
|
|
459
484
|
};
|
|
460
485
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
461
486
|
function getDefaultExportFromCjs(x) {
|
|
@@ -993,11 +1018,11 @@ const SquareIcon = ({
|
|
|
993
1018
|
})
|
|
994
1019
|
});
|
|
995
1020
|
};
|
|
996
|
-
const button$
|
|
997
|
-
const icon = "_icon_1fees_6";
|
|
1021
|
+
const button$4 = "_button_1fees_1";
|
|
1022
|
+
const icon$2 = "_icon_1fees_6";
|
|
998
1023
|
const defaultStyles$h = {
|
|
999
|
-
button: button$
|
|
1000
|
-
icon
|
|
1024
|
+
button: button$4,
|
|
1025
|
+
icon: icon$2
|
|
1001
1026
|
};
|
|
1002
1027
|
function ArrowButton({
|
|
1003
1028
|
direction = "right",
|
|
@@ -1029,10 +1054,10 @@ function ArrowButton({
|
|
|
1029
1054
|
})
|
|
1030
1055
|
});
|
|
1031
1056
|
}
|
|
1032
|
-
const button$
|
|
1057
|
+
const button$3 = "_button_3521c_1";
|
|
1033
1058
|
const buttonInner$1 = "_buttonInner_3521c_6";
|
|
1034
1059
|
const defaultStyles$g = {
|
|
1035
|
-
button: button$
|
|
1060
|
+
button: button$3,
|
|
1036
1061
|
buttonInner: buttonInner$1
|
|
1037
1062
|
};
|
|
1038
1063
|
function Button({
|
|
@@ -1052,12 +1077,12 @@ function Button({
|
|
|
1052
1077
|
})
|
|
1053
1078
|
});
|
|
1054
1079
|
}
|
|
1055
|
-
const button$
|
|
1080
|
+
const button$2 = "_button_125im_1";
|
|
1056
1081
|
const buttonBorder = "_buttonBorder_125im_11";
|
|
1057
1082
|
const svg$3 = "_svg_125im_19";
|
|
1058
1083
|
const path$3 = "_path_125im_25";
|
|
1059
1084
|
const defaultStyles$f = {
|
|
1060
|
-
button: button$
|
|
1085
|
+
button: button$2,
|
|
1061
1086
|
buttonBorder,
|
|
1062
1087
|
svg: svg$3,
|
|
1063
1088
|
path: path$3
|
|
@@ -1632,7 +1657,7 @@ const enter$1 = "_enter_1gzlr_21";
|
|
|
1632
1657
|
const exitDone$1 = "_exitDone_1gzlr_22";
|
|
1633
1658
|
const enterActive$1 = "_enterActive_1gzlr_31";
|
|
1634
1659
|
const exit$1 = "_exit_1gzlr_22";
|
|
1635
|
-
const styles$
|
|
1660
|
+
const styles$6 = {
|
|
1636
1661
|
transitionContainer: transitionContainer$1,
|
|
1637
1662
|
modalBox: modalBox$1,
|
|
1638
1663
|
enter: enter$1,
|
|
@@ -1647,12 +1672,12 @@ function Modal$1({
|
|
|
1647
1672
|
return jsx(d, {
|
|
1648
1673
|
in: visible,
|
|
1649
1674
|
duration: 300,
|
|
1650
|
-
classNames: styles$
|
|
1675
|
+
classNames: styles$6,
|
|
1651
1676
|
alwaysMounted: true,
|
|
1652
1677
|
children: jsx("div", {
|
|
1653
|
-
class: styles$
|
|
1678
|
+
class: styles$6.transitionContainer,
|
|
1654
1679
|
children: jsx("div", {
|
|
1655
|
-
class: styles$
|
|
1680
|
+
class: styles$6.modalBox,
|
|
1656
1681
|
children
|
|
1657
1682
|
})
|
|
1658
1683
|
})
|
|
@@ -1781,10 +1806,10 @@ function tooltipPositionForRect({
|
|
|
1781
1806
|
}
|
|
1782
1807
|
return newPosition;
|
|
1783
1808
|
}
|
|
1784
|
-
const text$
|
|
1809
|
+
const text$1 = "_text_1b8t2_1";
|
|
1785
1810
|
const container$3 = "_container_1b8t2_10";
|
|
1786
1811
|
const defaultStyles$a = {
|
|
1787
|
-
text: text$
|
|
1812
|
+
text: text$1,
|
|
1788
1813
|
container: container$3
|
|
1789
1814
|
};
|
|
1790
1815
|
const ControlChange = ({
|
|
@@ -1955,11 +1980,11 @@ const PageSection = forwardRef(({
|
|
|
1955
1980
|
})]
|
|
1956
1981
|
});
|
|
1957
1982
|
});
|
|
1958
|
-
const text
|
|
1983
|
+
const text = "_text_lo5h3_1";
|
|
1959
1984
|
const axis = "_axis_lo5h3_6";
|
|
1960
1985
|
const bar = "_bar_lo5h3_10";
|
|
1961
1986
|
const defaultStyles$7 = {
|
|
1962
|
-
text
|
|
1987
|
+
text,
|
|
1963
1988
|
axis,
|
|
1964
1989
|
bar
|
|
1965
1990
|
};
|
|
@@ -2009,58 +2034,56 @@ const ColumnChart = ({
|
|
|
2009
2034
|
})]
|
|
2010
2035
|
});
|
|
2011
2036
|
};
|
|
2012
|
-
const
|
|
2013
|
-
const
|
|
2014
|
-
const title$
|
|
2015
|
-
const subtitle = "
|
|
2016
|
-
const
|
|
2017
|
-
const
|
|
2018
|
-
const
|
|
2019
|
-
const mugshot = "_mugshot_vd5ly_71";
|
|
2037
|
+
const container$2 = "_container_1snyq_1";
|
|
2038
|
+
const img = "_img_1snyq_7";
|
|
2039
|
+
const title$2 = "_title_1snyq_15";
|
|
2040
|
+
const subtitle = "_subtitle_1snyq_31";
|
|
2041
|
+
const small = "_small_1snyq_41";
|
|
2042
|
+
const blurb = "_blurb_1snyq_51";
|
|
2043
|
+
const footnote = "_footnote_1snyq_59";
|
|
2020
2044
|
const defaultStyles$6 = {
|
|
2021
|
-
text,
|
|
2022
2045
|
container: container$2,
|
|
2023
|
-
|
|
2046
|
+
img,
|
|
2047
|
+
title: title$2,
|
|
2024
2048
|
subtitle,
|
|
2049
|
+
small,
|
|
2025
2050
|
blurb,
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2051
|
+
footnote
|
|
2052
|
+
};
|
|
2053
|
+
const SubtitleStyle = {
|
|
2054
|
+
small: "small",
|
|
2055
|
+
large: "large"
|
|
2029
2056
|
};
|
|
2030
2057
|
const PartyProfile = ({
|
|
2031
|
-
styles: styles2,
|
|
2032
2058
|
title: title2,
|
|
2033
2059
|
subtitle: subtitle2,
|
|
2060
|
+
subtitleStyle = SubtitleStyle.large,
|
|
2034
2061
|
blurb: blurb2,
|
|
2062
|
+
footnote: footnote2,
|
|
2035
2063
|
imgSrc,
|
|
2036
|
-
|
|
2064
|
+
styles: styles2
|
|
2037
2065
|
}) => {
|
|
2038
2066
|
styles2 = mergeStyles({
|
|
2039
2067
|
...defaultStyles$6
|
|
2040
2068
|
}, styles2);
|
|
2041
|
-
return
|
|
2069
|
+
return jsxs("div", {
|
|
2042
2070
|
class: styles2.container,
|
|
2043
|
-
children:
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
src: imgSrc,
|
|
2060
|
-
className: `${styles2.mugshot} bg-color--${abbreviation}`
|
|
2061
|
-
})
|
|
2062
|
-
})]
|
|
2063
|
-
})
|
|
2071
|
+
children: [jsx("img", {
|
|
2072
|
+
src: imgSrc,
|
|
2073
|
+
className: styles2.img
|
|
2074
|
+
}), jsx("h3", {
|
|
2075
|
+
className: styles2.title,
|
|
2076
|
+
children: title2
|
|
2077
|
+
}), jsx("div", {
|
|
2078
|
+
className: [styles2.subtitle, styles2[subtitleStyle]].join(" "),
|
|
2079
|
+
children: subtitle2
|
|
2080
|
+
}), jsx("div", {
|
|
2081
|
+
className: styles2.blurb,
|
|
2082
|
+
children: blurb2
|
|
2083
|
+
}), jsx("div", {
|
|
2084
|
+
className: styles2.footnote,
|
|
2085
|
+
children: footnote2
|
|
2086
|
+
})]
|
|
2064
2087
|
});
|
|
2065
2088
|
};
|
|
2066
2089
|
var epsilon$1 = 1e-6;
|
|
@@ -2475,7 +2498,7 @@ function useContainerSize(containerRef) {
|
|
|
2475
2498
|
}
|
|
2476
2499
|
const container$1 = "_container_cyrny_1";
|
|
2477
2500
|
const svg$1 = "_svg_cyrny_6";
|
|
2478
|
-
const styles$
|
|
2501
|
+
const styles$5 = {
|
|
2479
2502
|
container: container$1,
|
|
2480
2503
|
svg: svg$1
|
|
2481
2504
|
};
|
|
@@ -2723,7 +2746,7 @@ const Map$1 = forwardRef(({
|
|
|
2723
2746
|
const renderSVG = containerSize && !config.drawToCanvas;
|
|
2724
2747
|
return jsx("div", {
|
|
2725
2748
|
ref: containerRef,
|
|
2726
|
-
className: styles$
|
|
2749
|
+
className: styles$5.container,
|
|
2727
2750
|
style: containerStyle,
|
|
2728
2751
|
children: renderSVG && jsx(SVGMapProvider, {
|
|
2729
2752
|
id,
|
|
@@ -2775,7 +2798,7 @@ function ResultSummary({
|
|
|
2775
2798
|
}
|
|
2776
2799
|
const svg = "_svg_1dms8_1";
|
|
2777
2800
|
const path = "_path_1dms8_8";
|
|
2778
|
-
const styles$
|
|
2801
|
+
const styles$4 = {
|
|
2779
2802
|
svg,
|
|
2780
2803
|
path
|
|
2781
2804
|
};
|
|
@@ -2783,9 +2806,9 @@ function SearchIcon() {
|
|
|
2783
2806
|
return jsx("svg", {
|
|
2784
2807
|
viewBox: "0 0 20 20",
|
|
2785
2808
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2786
|
-
className: styles$
|
|
2809
|
+
className: styles$4.svg,
|
|
2787
2810
|
children: jsx("path", {
|
|
2788
|
-
className: styles$
|
|
2811
|
+
className: styles$4.path,
|
|
2789
2812
|
"fill-rule": "evenodd",
|
|
2790
2813
|
"clip-rule": "evenodd",
|
|
2791
2814
|
d: "M7.273 0c4.022 0 7.25 3.295 7.25 7.273a7.226 7.226 0 01-7.25 7.25C3.25 14.523 0 11.295 0 7.273 0 3.295 3.25 0 7.273 0zm0 1.84A5.403 5.403 0 001.84 7.274c0 3 2.409 5.454 5.432 5.454 3 0 5.454-2.454 5.454-5.454 0-3.023-2.454-5.432-5.454-5.432zM20 18.16l-5.432-5.432h-.932l-.909.91v.931L18.16 20 20 18.159z"
|
|
@@ -2930,11 +2953,13 @@ function SuggestionList({
|
|
|
2930
2953
|
})
|
|
2931
2954
|
});
|
|
2932
2955
|
}
|
|
2933
|
-
const refreshIndicator = "
|
|
2934
|
-
const
|
|
2935
|
-
const
|
|
2956
|
+
const refreshIndicator = "_refreshIndicator_3z0ji_9";
|
|
2957
|
+
const icon$1 = "_icon_3z0ji_17";
|
|
2958
|
+
const liveText = "_liveText_3z0ji_26";
|
|
2959
|
+
const refreshText = "_refreshText_3z0ji_27";
|
|
2936
2960
|
const defaultStyles$2 = {
|
|
2937
2961
|
refreshIndicator,
|
|
2962
|
+
icon: icon$1,
|
|
2938
2963
|
liveText,
|
|
2939
2964
|
refreshText
|
|
2940
2965
|
};
|
|
@@ -2945,8 +2970,11 @@ function RefreshIndicator({
|
|
|
2945
2970
|
styles2 = mergeStyles(defaultStyles$2, styles2);
|
|
2946
2971
|
return jsxs("div", {
|
|
2947
2972
|
className: styles2.refreshIndicator,
|
|
2948
|
-
children: [jsx(
|
|
2949
|
-
|
|
2973
|
+
children: [jsx("span", {
|
|
2974
|
+
className: styles2.icon,
|
|
2975
|
+
children: jsx(CircleIcon, {
|
|
2976
|
+
pulse: true
|
|
2977
|
+
})
|
|
2950
2978
|
}), jsx("span", {
|
|
2951
2979
|
className: styles2.liveText,
|
|
2952
2980
|
children: "LIVE"
|
|
@@ -2990,7 +3018,7 @@ const enter = "_enter_wws3j_21";
|
|
|
2990
3018
|
const exitDone = "_exitDone_wws3j_22";
|
|
2991
3019
|
const enterActive = "_enterActive_wws3j_31";
|
|
2992
3020
|
const exit = "_exit_wws3j_22";
|
|
2993
|
-
const styles$
|
|
3021
|
+
const styles$3 = {
|
|
2994
3022
|
transitionContainer,
|
|
2995
3023
|
modalBox,
|
|
2996
3024
|
enter,
|
|
@@ -3013,21 +3041,123 @@ function Modal({
|
|
|
3013
3041
|
return createPortal(jsx(d, {
|
|
3014
3042
|
in: visible,
|
|
3015
3043
|
duration: 300,
|
|
3016
|
-
classNames: styles$
|
|
3044
|
+
classNames: styles$3,
|
|
3017
3045
|
children: jsx("div", {
|
|
3018
|
-
class: styles$
|
|
3046
|
+
class: styles$3.transitionContainer,
|
|
3019
3047
|
onClick,
|
|
3020
3048
|
style: {
|
|
3021
3049
|
pointerEvents: visible ? "auto" : "none"
|
|
3022
3050
|
},
|
|
3023
3051
|
children: jsx("div", {
|
|
3024
3052
|
ref: modalBoxRef,
|
|
3025
|
-
class: styles$
|
|
3053
|
+
class: styles$3.modalBox,
|
|
3026
3054
|
children
|
|
3027
3055
|
})
|
|
3028
3056
|
})
|
|
3029
3057
|
}), document.body);
|
|
3030
3058
|
}
|
|
3059
|
+
const button$1 = "_button_xeyqm_1";
|
|
3060
|
+
const icon = "_icon_xeyqm_17";
|
|
3061
|
+
const title$1 = "_title_xeyqm_22";
|
|
3062
|
+
const popout = "_popout_xeyqm_29";
|
|
3063
|
+
const hint = "_hint_xeyqm_44";
|
|
3064
|
+
const option = "_option_xeyqm_51";
|
|
3065
|
+
const optionIcon = "_optionIcon_xeyqm_71";
|
|
3066
|
+
const optionTitle = "_optionTitle_xeyqm_76";
|
|
3067
|
+
const optionDescription = "_optionDescription_xeyqm_84";
|
|
3068
|
+
const checkmark = "_checkmark_xeyqm_91";
|
|
3069
|
+
const checkmarkPath = "_checkmarkPath_xeyqm_97";
|
|
3070
|
+
const styles$2 = {
|
|
3071
|
+
button: button$1,
|
|
3072
|
+
icon,
|
|
3073
|
+
title: title$1,
|
|
3074
|
+
popout,
|
|
3075
|
+
hint,
|
|
3076
|
+
option,
|
|
3077
|
+
optionIcon,
|
|
3078
|
+
optionTitle,
|
|
3079
|
+
optionDescription,
|
|
3080
|
+
checkmark,
|
|
3081
|
+
checkmarkPath
|
|
3082
|
+
};
|
|
3083
|
+
function Dropdown({
|
|
3084
|
+
title: title2,
|
|
3085
|
+
hint: hint2,
|
|
3086
|
+
options,
|
|
3087
|
+
onSelect
|
|
3088
|
+
}) {
|
|
3089
|
+
const [expanded, setExpanded] = useState(true);
|
|
3090
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
3091
|
+
const onOptionClick = useCallback((option2, index2) => {
|
|
3092
|
+
setSelectedIndex(index2);
|
|
3093
|
+
if (onSelect)
|
|
3094
|
+
onSelect(option2, index2);
|
|
3095
|
+
}, [onSelect]);
|
|
3096
|
+
const iconForSelectedOption = useMemo(() => {
|
|
3097
|
+
const selectedOption = options[selectedIndex];
|
|
3098
|
+
return selectedOption.icon;
|
|
3099
|
+
}, [options, selectedIndex]);
|
|
3100
|
+
return jsxs("div", {
|
|
3101
|
+
children: [jsxs("button", {
|
|
3102
|
+
className: styles$2.button,
|
|
3103
|
+
onClick: () => setExpanded((current) => !current),
|
|
3104
|
+
children: [jsx("img", {
|
|
3105
|
+
src: iconForSelectedOption,
|
|
3106
|
+
className: styles$2.icon
|
|
3107
|
+
}), jsx("span", {
|
|
3108
|
+
className: styles$2.title,
|
|
3109
|
+
children: title2
|
|
3110
|
+
}), jsx(Chevron, {
|
|
3111
|
+
active: true,
|
|
3112
|
+
size: "large",
|
|
3113
|
+
direction: expanded ? "up" : "down"
|
|
3114
|
+
})]
|
|
3115
|
+
}), jsxs("div", {
|
|
3116
|
+
className: styles$2.popout,
|
|
3117
|
+
style: {
|
|
3118
|
+
visibility: expanded ? "visible" : "hidden"
|
|
3119
|
+
},
|
|
3120
|
+
children: [hint2 && jsx("p", {
|
|
3121
|
+
className: styles$2.hint,
|
|
3122
|
+
children: hint2
|
|
3123
|
+
}), options.map((option2, index2) => jsxs("button", {
|
|
3124
|
+
className: styles$2.option,
|
|
3125
|
+
onClick: () => onOptionClick(option2, index2),
|
|
3126
|
+
children: [jsx("img", {
|
|
3127
|
+
src: option2.icon,
|
|
3128
|
+
className: styles$2.optionIcon
|
|
3129
|
+
}), jsxs("div", {
|
|
3130
|
+
className: styles$2.optionText,
|
|
3131
|
+
children: [jsx("h4", {
|
|
3132
|
+
className: styles$2.optionTitle,
|
|
3133
|
+
children: option2.title
|
|
3134
|
+
}), jsx("p", {
|
|
3135
|
+
className: styles$2.optionDescription,
|
|
3136
|
+
children: option2.description
|
|
3137
|
+
})]
|
|
3138
|
+
}), index2 === selectedIndex && jsx("div", {
|
|
3139
|
+
className: styles$2.checkmark,
|
|
3140
|
+
children: jsx(Checkmark, {})
|
|
3141
|
+
})]
|
|
3142
|
+
}, option2.title))]
|
|
3143
|
+
})]
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
function Checkmark() {
|
|
3147
|
+
return jsx("svg", {
|
|
3148
|
+
width: "11",
|
|
3149
|
+
height: "9",
|
|
3150
|
+
viewBox: "0 0 11 9",
|
|
3151
|
+
fill: "none",
|
|
3152
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3153
|
+
children: jsx("path", {
|
|
3154
|
+
"fill-rule": "evenodd",
|
|
3155
|
+
"clip-rule": "evenodd",
|
|
3156
|
+
d: "M0.631814 4.43687L0.0839844 4.9847L2.82313 8.8195H3.08335L10.9173 0.711624L10.3695 0.17749L3.08335 6.77884L0.631814 4.43687Z",
|
|
3157
|
+
className: styles$2.checkmarkPath
|
|
3158
|
+
})
|
|
3159
|
+
});
|
|
3160
|
+
}
|
|
3031
3161
|
const coalitionsWrapper = "_coalitionsWrapper_1ahqy_9";
|
|
3032
3162
|
const coalitionsContainer = "_coalitionsContainer_1ahqy_14";
|
|
3033
3163
|
const coalition = "_coalition_1ahqy_9";
|
|
@@ -3322,6 +3452,7 @@ export {
|
|
|
3322
3452
|
ColumnChart,
|
|
3323
3453
|
Container,
|
|
3324
3454
|
ControlChange,
|
|
3455
|
+
Dropdown,
|
|
3325
3456
|
GradientIcon,
|
|
3326
3457
|
GridType,
|
|
3327
3458
|
InfoButton,
|