@guardian/interactive-component-library 0.2.0-rc4 → 0.2.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 (276) hide show
  1. package/dist/interactive-component-library.js +8338 -0
  2. package/dist/interactive-component-library.js.map +1 -0
  3. package/dist/interactive-component-library.umd.cjs +8333 -0
  4. package/dist/interactive-component-library.umd.cjs.map +1 -0
  5. package/dist/style.css +157 -73
  6. package/package.json +11 -19
  7. package/dist/components/index.d.ts +0 -3
  8. package/dist/components/molecules/canvas-map/Map.d.ts +0 -17
  9. package/dist/components/molecules/canvas-map/Map.js +0 -89
  10. package/dist/components/molecules/canvas-map/context/MapContext.d.ts +0 -19
  11. package/dist/components/molecules/canvas-map/context/MapContext.js +0 -20
  12. package/dist/components/molecules/canvas-map/controls/ZoomControl.d.ts +0 -6
  13. package/dist/components/molecules/canvas-map/controls/ZoomControl.js +0 -40
  14. package/dist/components/molecules/canvas-map/controls/icons/index.d.ts +0 -3
  15. package/dist/components/molecules/canvas-map/controls/icons/minus.d.ts +0 -1
  16. package/dist/components/molecules/canvas-map/controls/icons/minus.js +0 -25
  17. package/dist/components/molecules/canvas-map/controls/icons/plus.d.ts +0 -1
  18. package/dist/components/molecules/canvas-map/controls/icons/plus.js +0 -25
  19. package/dist/components/molecules/canvas-map/controls/icons/reset.d.ts +0 -3
  20. package/dist/components/molecules/canvas-map/controls/icons/reset.js +0 -25
  21. package/dist/components/molecules/canvas-map/controls/index.d.ts +0 -1
  22. package/dist/components/molecules/canvas-map/controls/style.module.css.js +0 -11
  23. package/dist/components/molecules/canvas-map/index.d.ts +0 -12
  24. package/dist/components/molecules/canvas-map/lib/Feature.d.ts +0 -38
  25. package/dist/components/molecules/canvas-map/lib/Feature.js +0 -104
  26. package/dist/components/molecules/canvas-map/lib/FeatureCollection.d.ts +0 -20
  27. package/dist/components/molecules/canvas-map/lib/FeatureCollection.js +0 -23
  28. package/dist/components/molecules/canvas-map/lib/Map.d.ts +0 -69
  29. package/dist/components/molecules/canvas-map/lib/Map.js +0 -254
  30. package/dist/components/molecules/canvas-map/lib/View.d.ts +0 -136
  31. package/dist/components/molecules/canvas-map/lib/View.js +0 -179
  32. package/dist/components/molecules/canvas-map/lib/events/Dispatcher.d.ts +0 -8
  33. package/dist/components/molecules/canvas-map/lib/events/Dispatcher.js +0 -35
  34. package/dist/components/molecules/canvas-map/lib/events/MapEvent.d.ts +0 -6
  35. package/dist/components/molecules/canvas-map/lib/events/MapEvent.js +0 -9
  36. package/dist/components/molecules/canvas-map/lib/events/index.d.ts +0 -2
  37. package/dist/components/molecules/canvas-map/lib/formats/GeoJSON.d.ts +0 -10
  38. package/dist/components/molecules/canvas-map/lib/formats/GeoJSON.js +0 -96
  39. package/dist/components/molecules/canvas-map/lib/geometry/Geometry.d.ts +0 -32
  40. package/dist/components/molecules/canvas-map/lib/geometry/Geometry.js +0 -41
  41. package/dist/components/molecules/canvas-map/lib/geometry/LineString.d.ts +0 -12
  42. package/dist/components/molecules/canvas-map/lib/geometry/LineString.js +0 -19
  43. package/dist/components/molecules/canvas-map/lib/geometry/Point.d.ts +0 -11
  44. package/dist/components/molecules/canvas-map/lib/geometry/Point.js +0 -16
  45. package/dist/components/molecules/canvas-map/lib/geometry/Polygon.d.ts +0 -16
  46. package/dist/components/molecules/canvas-map/lib/geometry/Polygon.js +0 -46
  47. package/dist/components/molecules/canvas-map/lib/geometry/index.d.ts +0 -4
  48. package/dist/components/molecules/canvas-map/lib/interpolators/index.d.ts +0 -2
  49. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateFeatures.d.ts +0 -5
  50. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateFeatures.js +0 -95
  51. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateStyles.d.ts +0 -4
  52. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateStyles.js +0 -65
  53. package/dist/components/molecules/canvas-map/lib/layers/TextLayer.d.ts +0 -52
  54. package/dist/components/molecules/canvas-map/lib/layers/TextLayer.js +0 -111
  55. package/dist/components/molecules/canvas-map/lib/layers/VectorLayer.d.ts +0 -53
  56. package/dist/components/molecules/canvas-map/lib/layers/VectorLayer.js +0 -132
  57. package/dist/components/molecules/canvas-map/lib/layers/index.d.ts +0 -3
  58. package/dist/components/molecules/canvas-map/lib/projection/index.d.ts +0 -22
  59. package/dist/components/molecules/canvas-map/lib/projection/index.js +0 -12
  60. package/dist/components/molecules/canvas-map/lib/renderers/FeatureRenderer.d.ts +0 -6
  61. package/dist/components/molecules/canvas-map/lib/renderers/FeatureRenderer.js +0 -46
  62. package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.d.ts +0 -6
  63. package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.js +0 -53
  64. package/dist/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.d.ts +0 -17
  65. package/dist/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.js +0 -119
  66. package/dist/components/molecules/canvas-map/lib/renderers/VectorLayerRenderer.d.ts +0 -10
  67. package/dist/components/molecules/canvas-map/lib/renderers/VectorLayerRenderer.js +0 -78
  68. package/dist/components/molecules/canvas-map/lib/sources/VectorSource.d.ts +0 -15
  69. package/dist/components/molecules/canvas-map/lib/sources/VectorSource.js +0 -56
  70. package/dist/components/molecules/canvas-map/lib/styles/Fill.d.ts +0 -7
  71. package/dist/components/molecules/canvas-map/lib/styles/Fill.js +0 -15
  72. package/dist/components/molecules/canvas-map/lib/styles/Stroke.d.ts +0 -8
  73. package/dist/components/molecules/canvas-map/lib/styles/Stroke.js +0 -16
  74. package/dist/components/molecules/canvas-map/lib/styles/Style.d.ts +0 -24
  75. package/dist/components/molecules/canvas-map/lib/styles/Style.js +0 -17
  76. package/dist/components/molecules/canvas-map/lib/styles/Text.d.ts +0 -10
  77. package/dist/components/molecules/canvas-map/lib/styles/Text.js +0 -14
  78. package/dist/components/molecules/canvas-map/lib/styles/index.d.ts +0 -4
  79. package/dist/components/molecules/canvas-map/lib/util/array.d.ts +0 -6
  80. package/dist/components/molecules/canvas-map/lib/util/array.js +0 -15
  81. package/dist/components/molecules/canvas-map/lib/util/bboxFeature.d.ts +0 -8
  82. package/dist/components/molecules/canvas-map/lib/util/bboxFeature.js +0 -26
  83. package/dist/components/molecules/canvas-map/lib/util/debug.d.ts +0 -11
  84. package/dist/components/molecules/canvas-map/lib/util/debug.js +0 -27
  85. package/dist/components/molecules/canvas-map/lib/util/deflate.d.ts +0 -36
  86. package/dist/components/molecules/canvas-map/lib/util/distance.d.ts +0 -1
  87. package/dist/components/molecules/canvas-map/lib/util/distance.js +0 -12
  88. package/dist/components/molecules/canvas-map/lib/util/dom.d.ts +0 -9
  89. package/dist/components/molecules/canvas-map/lib/util/dom.js +0 -28
  90. package/dist/components/molecules/canvas-map/lib/util/extent.d.ts +0 -21
  91. package/dist/components/molecules/canvas-map/lib/util/extent.js +0 -38
  92. package/dist/components/molecules/canvas-map/lib/util/memoise.d.ts +0 -10
  93. package/dist/components/molecules/canvas-map/lib/util/memoise.js +0 -20
  94. package/dist/components/molecules/canvas-map/lib/util/resolution.d.ts +0 -9
  95. package/dist/components/molecules/canvas-map/lib/util/resolution.js +0 -11
  96. package/dist/components/molecules/canvas-map/lib/util/simplify.d.ts +0 -114
  97. package/dist/components/molecules/canvas-map/lib/util/size.d.ts +0 -32
  98. package/dist/components/molecules/canvas-map/lib/util/size.js +0 -53
  99. package/dist/components/molecules/canvas-map/lib/util/toRgba.d.ts +0 -1
  100. package/dist/components/molecules/canvas-map/lib/util/toRgba.js +0 -25
  101. package/dist/components/molecules/canvas-map/lib/util/uid.d.ts +0 -5
  102. package/dist/components/molecules/canvas-map/lib/util/uid.js +0 -7
  103. package/dist/components/molecules/canvas-map/lib/util/zoomLevel.d.ts +0 -2
  104. package/dist/components/molecules/canvas-map/lib/util/zoomLevel.js +0 -14
  105. package/dist/components/molecules/canvas-map/style.module.scss.js +0 -20
  106. package/dist/components/molecules/column-chart/column-chart-example.d.ts +0 -35
  107. package/dist/components/molecules/column-chart/column-chart-util.d.ts +0 -1
  108. package/dist/components/molecules/column-chart/index.d.ts +0 -11
  109. package/dist/components/molecules/column-chart/index.js +0 -63
  110. package/dist/components/molecules/column-chart/style.module.css.js +0 -14
  111. package/dist/components/molecules/control-change/index.d.ts +0 -6
  112. package/dist/components/molecules/control-change/index.js +0 -29
  113. package/dist/components/molecules/control-change/style.module.css.js +0 -11
  114. package/dist/components/molecules/dropdown/index.d.ts +0 -11
  115. package/dist/components/molecules/dropdown/index.js +0 -191
  116. package/dist/components/molecules/dropdown/style.module.css.js +0 -50
  117. package/dist/components/molecules/first-past-the-post-waffle/index.d.ts +0 -5
  118. package/dist/components/molecules/first-past-the-post-waffle/index.js +0 -14
  119. package/dist/components/molecules/first-past-the-post-waffle/style.module.css.js +0 -14
  120. package/dist/components/molecules/index.d.ts +0 -17
  121. package/dist/components/molecules/modal/index.d.ts +0 -8
  122. package/dist/components/molecules/modal/index.js +0 -59
  123. package/dist/components/molecules/modal/style.module.css.js +0 -26
  124. package/dist/components/molecules/page-section/index.d.ts +0 -8
  125. package/dist/components/molecules/page-section/index.js +0 -52
  126. package/dist/components/molecules/page-section/style.module.scss.js +0 -20
  127. package/dist/components/molecules/party-profile/index.d.ts +0 -10
  128. package/dist/components/molecules/party-profile/index.js +0 -29
  129. package/dist/components/molecules/party-profile/style.module.css.js +0 -26
  130. package/dist/components/molecules/refresh-indicator/index.d.ts +0 -4
  131. package/dist/components/molecules/refresh-indicator/index.js +0 -18
  132. package/dist/components/molecules/refresh-indicator/style.module.scss.js +0 -17
  133. package/dist/components/molecules/responsive-grid/index.d.ts +0 -10
  134. package/dist/components/molecules/responsive-grid/index.js +0 -19
  135. package/dist/components/molecules/responsive-grid/style.module.scss.js +0 -8
  136. package/dist/components/molecules/result-summary/index.d.ts +0 -8
  137. package/dist/components/molecules/result-summary/index.js +0 -38
  138. package/dist/components/molecules/result-summary/style.module.css.js +0 -11
  139. package/dist/components/molecules/search-input/icons/search.d.ts +0 -1
  140. package/dist/components/molecules/search-input/icons/search.js +0 -24
  141. package/dist/components/molecules/search-input/icons/search.module.css.js +0 -11
  142. package/dist/components/molecules/search-input/index.d.ts +0 -11
  143. package/dist/components/molecules/search-input/index.js +0 -164
  144. package/dist/components/molecules/search-input/style.module.css.js +0 -32
  145. package/dist/components/molecules/slope-chart/index.d.ts +0 -16
  146. package/dist/components/molecules/slope-chart/index.js +0 -139
  147. package/dist/components/molecules/slope-chart/style.module.css.js +0 -35
  148. package/dist/components/molecules/svg-map/context/MapContext.d.ts +0 -1
  149. package/dist/components/molecules/svg-map/context/MapContext.js +0 -5
  150. package/dist/components/molecules/svg-map/context/SVGMapProvider.d.ts +0 -10
  151. package/dist/components/molecules/svg-map/context/SVGMapProvider.js +0 -88
  152. package/dist/components/molecules/svg-map/helpers/bboxFeature.d.ts +0 -8
  153. package/dist/components/molecules/svg-map/helpers/bboxFeature.js +0 -26
  154. package/dist/components/molecules/svg-map/helpers/dynamicPropValue.d.ts +0 -1
  155. package/dist/components/molecules/svg-map/helpers/dynamicPropValue.js +0 -9
  156. package/dist/components/molecules/svg-map/helpers/geoMath.d.ts +0 -4
  157. package/dist/components/molecules/svg-map/helpers/saveSVG.d.ts +0 -1
  158. package/dist/components/molecules/svg-map/hooks/useCamera.d.ts +0 -0
  159. package/dist/components/molecules/svg-map/hooks/useThrowIfNonLayerChildren.d.ts +0 -4
  160. package/dist/components/molecules/svg-map/hooks/useThrowIfNonLayerChildren.js +0 -19
  161. package/dist/components/molecules/svg-map/index.d.ts +0 -38
  162. package/dist/components/molecules/svg-map/index.js +0 -121
  163. package/dist/components/molecules/svg-map/layers/CompositionBorders.d.ts +0 -3
  164. package/dist/components/molecules/svg-map/layers/CompositionBorders.js +0 -14
  165. package/dist/components/molecules/svg-map/layers/Line.d.ts +0 -7
  166. package/dist/components/molecules/svg-map/layers/Line.js +0 -48
  167. package/dist/components/molecules/svg-map/layers/Point.d.ts +0 -10
  168. package/dist/components/molecules/svg-map/layers/Point.js +0 -59
  169. package/dist/components/molecules/svg-map/layers/Polygon.d.ts +0 -9
  170. package/dist/components/molecules/svg-map/layers/Polygon.js +0 -75
  171. package/dist/components/molecules/svg-map/layers/Prerendered.d.ts +0 -3
  172. package/dist/components/molecules/svg-map/layers/Prerendered.js +0 -11
  173. package/dist/components/molecules/svg-map/layers/compositionBorders.module.scss.js +0 -8
  174. package/dist/components/molecules/svg-map/layers/index.d.ts +0 -5
  175. package/dist/components/molecules/svg-map/layers/index.js +0 -12
  176. package/dist/components/molecules/svg-map/renderers/SVGRenderer.d.ts +0 -3
  177. package/dist/components/molecules/svg-map/renderers/SVGRenderer.js +0 -32
  178. package/dist/components/molecules/svg-map/style.module.css.js +0 -11
  179. package/dist/components/molecules/table/index.d.ts +0 -7
  180. package/dist/components/molecules/table/index.js +0 -90
  181. package/dist/components/molecules/table/style.module.scss.js +0 -29
  182. package/dist/components/molecules/table/useTable.d.ts +0 -8
  183. package/dist/components/molecules/table/useTable.js +0 -128
  184. package/dist/components/molecules/tooltip/index.d.ts +0 -82
  185. package/dist/components/molecules/tooltip/index.js +0 -117
  186. package/dist/components/molecules/tooltip/style.module.css.js +0 -8
  187. package/dist/components/molecules/topline-result/index.d.ts +0 -3
  188. package/dist/components/molecules/topline-result/index.js +0 -61
  189. package/dist/components/molecules/topline-result/style.module.scss.js +0 -38
  190. package/dist/components/organisms/coalitions-tracker/index.d.ts +0 -16
  191. package/dist/components/organisms/coalitions-tracker/index.js +0 -151
  192. package/dist/components/organisms/coalitions-tracker/style.module.scss.js +0 -32
  193. package/dist/components/organisms/index.d.ts +0 -2
  194. package/dist/components/organisms/ticker/gradient/index.d.ts +0 -1
  195. package/dist/components/organisms/ticker/gradient/index.js +0 -35
  196. package/dist/components/organisms/ticker/gradient/style.module.scss.js +0 -14
  197. package/dist/components/organisms/ticker/index.d.ts +0 -5
  198. package/dist/components/organisms/ticker/index.js +0 -102
  199. package/dist/components/organisms/ticker/style.module.scss.js +0 -32
  200. package/dist/components/particles/ad-slot/index.d.ts +0 -40
  201. package/dist/components/particles/ad-slot/index.js +0 -34
  202. package/dist/components/particles/ad-slot/style.module.css.js +0 -11
  203. package/dist/components/particles/arrow-button/index.d.ts +0 -6
  204. package/dist/components/particles/arrow-button/index.js +0 -32
  205. package/dist/components/particles/arrow-button/style.module.css.js +0 -11
  206. package/dist/components/particles/aspect-ratio-box/index.d.ts +0 -4
  207. package/dist/components/particles/aspect-ratio-box/index.js +0 -15
  208. package/dist/components/particles/aspect-ratio-box/style.module.css.js +0 -6
  209. package/dist/components/particles/button/index.d.ts +0 -6
  210. package/dist/components/particles/button/index.js +0 -10
  211. package/dist/components/particles/button/style.module.css.js +0 -11
  212. package/dist/components/particles/change-bar/index.d.ts +0 -8
  213. package/dist/components/particles/change-bar/index.js +0 -27
  214. package/dist/components/particles/change-bar/style.module.scss.js +0 -14
  215. package/dist/components/particles/chevron/index.d.ts +0 -6
  216. package/dist/components/particles/chevron/index.js +0 -78
  217. package/dist/components/particles/chevron/style.module.css.js +0 -20
  218. package/dist/components/particles/circle-icon/index.d.ts +0 -6
  219. package/dist/components/particles/circle-icon/index.js +0 -32
  220. package/dist/components/particles/circle-icon/style.module.css.js +0 -14
  221. package/dist/components/particles/close-button/index.d.ts +0 -5
  222. package/dist/components/particles/close-button/index.js +0 -35
  223. package/dist/components/particles/close-button/style.module.css.js +0 -17
  224. package/dist/components/particles/container/index.d.ts +0 -5
  225. package/dist/components/particles/container/index.js +0 -13
  226. package/dist/components/particles/container/style.module.scss.js +0 -11
  227. package/dist/components/particles/gradient-icon/index.d.ts +0 -1
  228. package/dist/components/particles/gradient-icon/index.js +0 -46
  229. package/dist/components/particles/gradient-icon/style.module.css.js +0 -14
  230. package/dist/components/particles/index.d.ts +0 -18
  231. package/dist/components/particles/info-button/index.d.ts +0 -3
  232. package/dist/components/particles/info-button/index.js +0 -19
  233. package/dist/components/particles/info-button/style.module.css.js +0 -11
  234. package/dist/components/particles/legend-item/index.d.ts +0 -6
  235. package/dist/components/particles/legend-item/index.js +0 -26
  236. package/dist/components/particles/legend-item/style.module.css.js +0 -17
  237. package/dist/components/particles/relative-time-sentence/index.d.ts +0 -4
  238. package/dist/components/particles/relative-time-sentence/index.js +0 -14
  239. package/dist/components/particles/relative-time-sentence/style.module.css.js +0 -8
  240. package/dist/components/particles/square-cut-corner-icon/index.d.ts +0 -6
  241. package/dist/components/particles/square-cut-corner-icon/index.js +0 -56
  242. package/dist/components/particles/square-cut-corner-icon/style.module.scss.js +0 -17
  243. package/dist/components/particles/square-icon/index.d.ts +0 -5
  244. package/dist/components/particles/square-icon/index.js +0 -28
  245. package/dist/components/particles/square-icon/style.module.scss.js +0 -11
  246. package/dist/components/particles/stacked-bar/index.d.ts +0 -23
  247. package/dist/components/particles/stacked-bar/index.js +0 -140
  248. package/dist/components/particles/stacked-bar/style.module.css.js +0 -17
  249. package/dist/components/particles/stacked-grid/index.d.ts +0 -6
  250. package/dist/components/particles/stacked-grid/index.js +0 -35
  251. package/dist/components/particles/stacked-grid/style.module.css.js +0 -20
  252. package/dist/components/particles/waffle/index.d.ts +0 -14
  253. package/dist/components/particles/waffle/index.js +0 -76
  254. package/dist/components/particles/waffle/style.module.css.js +0 -11
  255. package/dist/index.d.ts +0 -2
  256. package/dist/index.js +0 -128
  257. package/dist/shared/colors/index.d.ts +0 -2
  258. package/dist/shared/helpers/createStore.d.ts +0 -1
  259. package/dist/shared/helpers/geometry.d.ts +0 -3
  260. package/dist/shared/helpers/geometry.js +0 -16
  261. package/dist/shared/helpers/geometry.test.d.ts +0 -1
  262. package/dist/shared/helpers/labelsUtil.d.ts +0 -54
  263. package/dist/shared/helpers/labelsUtil.js +0 -58
  264. package/dist/shared/helpers/labelsUtils.test.d.ts +0 -1
  265. package/dist/shared/helpers/shouldUpdate.d.ts +0 -7
  266. package/dist/shared/hooks/index.d.ts +0 -3
  267. package/dist/shared/hooks/useContainerSize.d.ts +0 -1
  268. package/dist/shared/hooks/useContainerSize.js +0 -24
  269. package/dist/shared/hooks/useTouchOrHover.d.ts +0 -6
  270. package/dist/shared/hooks/useTouchOrHover.js +0 -95
  271. package/dist/shared/hooks/useWindowSize.d.ts +0 -4
  272. package/dist/shared/hooks/useWindowSize.js +0 -27
  273. package/dist/styles/helpers/mergeStyles.d.ts +0 -1
  274. package/dist/styles/helpers/mergeStyles.js +0 -22
  275. package/dist/styles/helpers/mergeStyles.test.d.ts +0 -1
  276. package/dist/styles/theme.config.d.ts +0 -124
@@ -1,14 +0,0 @@
1
- const gradient = "_gradient_plpaq_9";
2
- const firstStop = "_firstStop_plpaq_24";
3
- const lastStop = "_lastStop_plpaq_29";
4
- const styles = {
5
- gradient,
6
- firstStop,
7
- lastStop
8
- };
9
- export {
10
- styles as default,
11
- firstStop,
12
- gradient,
13
- lastStop
14
- };
@@ -1,5 +0,0 @@
1
- export function Ticker({ maxItems, onStateChange, children }: {
2
- maxItems?: number;
3
- onStateChange: any;
4
- children: any;
5
- }): import("preact").JSX.Element;
@@ -1,102 +0,0 @@
1
- import { jsxs, jsx } from "preact/jsx-runtime";
2
- import { toChildArray } from "preact";
3
- import { useState, useMemo, useRef, useLayoutEffect } from "preact/hooks";
4
- import { Gradient } from "./gradient/index.js";
5
- import "../../particles/info-button/index.js";
6
- import "../../particles/relative-time-sentence/index.js";
7
- import { ArrowButton } from "../../particles/arrow-button/index.js";
8
- import { Button } from "../../particles/button/index.js";
9
- import styles from "./style.module.scss.js";
10
- function Ticker({ maxItems = 20, onStateChange, children }) {
11
- const [pageIndex, setPageIndex] = useState(0);
12
- const [pageWidth, setPageWidth] = useState(0);
13
- const [numberOfPages, setNumberOfPages] = useState(0);
14
- const offsetWidth = useMemo(() => {
15
- return -pageIndex * (pageWidth || 0);
16
- }, [pageIndex, pageWidth]);
17
- const tickerRef = useRef();
18
- const tickerItemsRef = useRef();
19
- const tickerScrollRef = useRef();
20
- const controlsRef = useRef();
21
- const [hideButtons, setHideButtons] = useState(false);
22
- const [expanded, setExpanded] = useState(false);
23
- const childArray = toChildArray(children);
24
- useLayoutEffect(() => {
25
- const tickerItemsContainer = tickerItemsRef.current;
26
- const pageWidth2 = tickerItemsContainer.clientWidth * 0.75;
27
- setPageWidth(pageWidth2);
28
- const numberOfPages2 = Math.ceil(
29
- tickerScrollRef.current.scrollWidth / pageWidth2
30
- );
31
- setNumberOfPages(numberOfPages2);
32
- }, [childArray]);
33
- useLayoutEffect(() => {
34
- const hideButtons2 = childArray.length < 4;
35
- setHideButtons(hideButtons2);
36
- }, [childArray]);
37
- function toggleExpandedState() {
38
- if (expanded) {
39
- tickerRef.current.scrollIntoView({ behavior: "smooth", alignToTop: true });
40
- }
41
- setExpanded((expanded2) => {
42
- const newState = !expanded2;
43
- if (onStateChange) onStateChange({ expanded: newState });
44
- return newState;
45
- });
46
- }
47
- return /* @__PURE__ */ jsxs(
48
- "div",
49
- {
50
- ref: tickerRef,
51
- className: styles.ticker,
52
- style: `--ticker-offset: ${offsetWidth}px;`,
53
- "data-expanded": expanded,
54
- children: [
55
- /* @__PURE__ */ jsx("div", { ref: tickerItemsRef, className: styles.tickerItems, children: /* @__PURE__ */ jsx("div", { ref: tickerScrollRef, className: styles.tickerScroll, children: childArray.map((child, index) => {
56
- var _a;
57
- return /* @__PURE__ */ jsx("div", { className: styles.tickerItem, children: child }, ((_a = child == null ? void 0 : child.props) == null ? void 0 : _a.id) ?? index);
58
- }) }) }),
59
- /* @__PURE__ */ jsxs(
60
- "div",
61
- {
62
- ref: controlsRef,
63
- className: styles.controls,
64
- style: hideButtons && { display: "none" },
65
- children: [
66
- /* @__PURE__ */ jsx("div", { className: styles.gradient, children: /* @__PURE__ */ jsx(Gradient, {}) }),
67
- /* @__PURE__ */ jsxs("div", { className: styles.buttons, children: [
68
- /* @__PURE__ */ jsx(
69
- ArrowButton,
70
- {
71
- onClick: () => setPageIndex((d) => d + 1),
72
- disabled: pageIndex >= numberOfPages - 2
73
- }
74
- ),
75
- /* @__PURE__ */ jsx(
76
- ArrowButton,
77
- {
78
- direction: "left",
79
- onClick: () => setPageIndex((d) => d - 1),
80
- disabled: pageIndex <= 0
81
- }
82
- )
83
- ] }),
84
- /* @__PURE__ */ jsx("div", { className: styles.button, children: /* @__PURE__ */ jsx(
85
- Button,
86
- {
87
- type: "regular",
88
- styles: { buttonInner: styles.buttonInner },
89
- onClick: toggleExpandedState,
90
- children: expanded ? "Show fewer" : `Show ${maxItems} most recent`
91
- }
92
- ) })
93
- ]
94
- }
95
- )
96
- ]
97
- }
98
- );
99
- }
100
- export {
101
- Ticker
102
- };
@@ -1,32 +0,0 @@
1
- const ticker = "_ticker_15ezr_9";
2
- const tickerItems = "_tickerItems_15ezr_21";
3
- const tickerScroll = "_tickerScroll_15ezr_26";
4
- const tickerItem = "_tickerItem_15ezr_21";
5
- const controls = "_controls_15ezr_48";
6
- const gradient = "_gradient_15ezr_63";
7
- const buttons = "_buttons_15ezr_75";
8
- const button = "_button_15ezr_75";
9
- const buttonInner = "_buttonInner_15ezr_101";
10
- const styles = {
11
- ticker,
12
- tickerItems,
13
- tickerScroll,
14
- tickerItem,
15
- controls,
16
- gradient,
17
- buttons,
18
- button,
19
- buttonInner
20
- };
21
- export {
22
- button,
23
- buttonInner,
24
- buttons,
25
- controls,
26
- styles as default,
27
- gradient,
28
- ticker,
29
- tickerItem,
30
- tickerItems,
31
- tickerScroll
32
- };
@@ -1,40 +0,0 @@
1
- /**
2
- * Array of available breakpoints.
3
- * @typedef {"mobile" | "phablet" | "tablet" | "desktop"} Breakpoint
4
- *
5
- * Type representing an ad size, defined as a tuple of two numbers in the format [width, height].
6
- * @typedef {[number, number]} AdSize
7
- *
8
- * Type representing a size mapping for different breakpoints,
9
- * the breakpoints cascade from the smallest to the largest.
10
- * AKA if only mobile and desktop are defined, the mobile size will be used for phablet and tablet.
11
- *
12
- * @typedef {Partial<Record<Breakpoint, AdSize[]>>} SizeMapping
13
- *
14
- * @interface AdSlotProps
15
- * @property {string} name - The unique name of the ad slot.
16
- * @property {SizeMapping} sizeMapping - The size mapping for the ad slot.
17
- * @property {Object} styles - The styles for the ad slot.
18
- */
19
- /**
20
- * A placeholder for an ad slot, the commercial bundle will fill this slot with an ad,
21
- * matching the size mapping.
22
- *
23
- * @param {AdSlotProps} props
24
- * @returns {React.ComponentElement<AdSlotProps, null>}
25
- */
26
- export function AdSlot({ name, sizeMapping, styles }: AdSlotProps): React.ComponentElement<AdSlotProps, null>;
27
- /**
28
- * Type representing an ad size, defined as a tuple of two numbers in the format [width, height].
29
- */
30
- export type Breakpoint = "mobile" | "phablet" | "tablet" | "desktop";
31
- /**
32
- * Type representing a size mapping for different breakpoints,
33
- * the breakpoints cascade from the smallest to the largest.
34
- * AKA if only mobile and desktop are defined, the mobile size will be used for phablet and tablet.
35
- */
36
- export type AdSize = [number, number];
37
- /**
38
- * Array of available breakpoints.
39
- */
40
- export type SizeMapping = Partial<Record<Breakpoint, AdSize[]>>;
@@ -1,34 +0,0 @@
1
- import { jsx } from "preact/jsx-runtime";
2
- import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
3
- import defaultStyles from "./style.module.css.js";
4
- function AdSlot({ name, sizeMapping, styles }) {
5
- var _a, _b, _c;
6
- const slotId = `dfp-ad--${name}`;
7
- styles = mergeStyles(defaultStyles, styles);
8
- const mobileSizes = (_a = sizeMapping.mobile) == null ? void 0 : _a.map((size) => size.join(",")).join("|");
9
- const tabletSizes = (_b = sizeMapping.tablet) == null ? void 0 : _b.map((size) => size.join(",")).join("|");
10
- const desktopSizes = (_c = sizeMapping.desktop) == null ? void 0 : _c.map((size) => size.join(",")).join("|");
11
- return /* @__PURE__ */ jsx("div", { className: ["ad-slot-container", styles.container].join(" "), children: /* @__PURE__ */ jsx(
12
- "div",
13
- {
14
- id: slotId,
15
- className: [
16
- "js-ad-slot",
17
- "ad-slot",
18
- "interactive-ad-slot",
19
- styles.slot
20
- ].join(" "),
21
- "data-link-name": `ad slot ${name}`,
22
- "data-name": `${name}`,
23
- "data-label-show": "true",
24
- "ad-label-text": "Advertisement",
25
- "aria-hidden": "true",
26
- "data-mobile": mobileSizes,
27
- "data-tablet": tabletSizes,
28
- "data-desktop": desktopSizes
29
- }
30
- ) });
31
- }
32
- export {
33
- AdSlot
34
- };
@@ -1,11 +0,0 @@
1
- const container = "_container_tq3ke_1";
2
- const slot = "_slot_tq3ke_5";
3
- const defaultStyles = {
4
- container,
5
- slot
6
- };
7
- export {
8
- container,
9
- defaultStyles as default,
10
- slot
11
- };
@@ -1,6 +0,0 @@
1
- export function ArrowButton({ direction, disabled, styles, onClick, }: {
2
- direction?: string;
3
- disabled?: boolean;
4
- styles: any;
5
- onClick: any;
6
- }): import("preact").JSX.Element;
@@ -1,32 +0,0 @@
1
- import { jsx, jsxs } from "preact/jsx-runtime";
2
- import defaultStyles from "./style.module.css.js";
3
- import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
4
- function ArrowButton({
5
- direction = "right",
6
- disabled = false,
7
- styles,
8
- onClick
9
- }) {
10
- styles = mergeStyles(defaultStyles, styles);
11
- return /* @__PURE__ */ jsx("button", { className: styles.button, disabled, onClick, children: /* @__PURE__ */ jsxs(
12
- "svg",
13
- {
14
- className: [styles.icon, direction].join(" "),
15
- viewBox: "0 0 28 28",
16
- xmlns: "http://www.w3.org/2000/svg",
17
- children: [
18
- /* @__PURE__ */ jsx("circle", { cx: 14, cy: 14, r: "13", fillRule: "nonzero" }),
19
- /* @__PURE__ */ jsx("g", { transform: "translate(6 7)", children: /* @__PURE__ */ jsx(
20
- "path",
21
- {
22
- d: "M0.667319 7.63692L12.8497 7.63692L8.07231 13.3539L8.69338 13.975L15.334 7.31842L15.334 6.68143L8.69338 0.0249018L8.07231 0.645966L12.8497 6.36294L0.667319 6.36294L0.667319 7.63692Z",
23
- fill: "#121212"
24
- }
25
- ) })
26
- ]
27
- }
28
- ) });
29
- }
30
- export {
31
- ArrowButton
32
- };
@@ -1,11 +0,0 @@
1
- const button = "_button_1kqfn_1";
2
- const icon = "_icon_1kqfn_6";
3
- const defaultStyles = {
4
- button,
5
- icon
6
- };
7
- export {
8
- button,
9
- defaultStyles as default,
10
- icon
11
- };
@@ -1,4 +0,0 @@
1
- export function AspectRatioBox({ heightAsProportionOfWidth, children }: {
2
- heightAsProportionOfWidth: any;
3
- children: any;
4
- }): import("preact").JSX.Element;
@@ -1,15 +0,0 @@
1
- import { jsx } from "preact/jsx-runtime";
2
- import style from "./style.module.css.js";
3
- function AspectRatioBox({ heightAsProportionOfWidth, children }) {
4
- return /* @__PURE__ */ jsx(
5
- "div",
6
- {
7
- className: style["aspect-ratio-box"],
8
- style: { "--aspect-ratio": heightAsProportionOfWidth },
9
- children: /* @__PURE__ */ jsx("div", { style: { position: "absolute", width: "100%", height: "100%" }, children })
10
- }
11
- );
12
- }
13
- export {
14
- AspectRatioBox
15
- };
@@ -1,6 +0,0 @@
1
- const style = {
2
- "aspect-ratio-box": "_aspect-ratio-box_1e5oy_1"
3
- };
4
- export {
5
- style as default
6
- };
@@ -1,6 +0,0 @@
1
- export function Button({ type, onClick, styles, children }: {
2
- type?: string;
3
- onClick: any;
4
- styles: any;
5
- children: any;
6
- }): import("preact").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { jsx } from "preact/jsx-runtime";
2
- import defaultStyles from "./style.module.css.js";
3
- import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
4
- function Button({ type = "regular", onClick, styles, children }) {
5
- styles = mergeStyles(defaultStyles, styles);
6
- return /* @__PURE__ */ jsx("button", { className: styles.button, "data-type": type, onClick, children: /* @__PURE__ */ jsx("div", { className: styles.buttonInner, children }) });
7
- }
8
- export {
9
- Button
10
- };
@@ -1,11 +0,0 @@
1
- const button = "_button_s6ell_1";
2
- const buttonInner = "_buttonInner_s6ell_6";
3
- const defaultStyles = {
4
- button,
5
- buttonInner
6
- };
7
- export {
8
- button,
9
- buttonInner,
10
- defaultStyles as default
11
- };
@@ -1,8 +0,0 @@
1
- export function ChangeBar({ fraction, positive, party, width, height, styles, }: {
2
- fraction: any;
3
- positive: any;
4
- party: any;
5
- width: any;
6
- height: any;
7
- styles: any;
8
- }): import("preact").JSX.Element;
@@ -1,27 +0,0 @@
1
- import { jsxs, jsx } from "preact/jsx-runtime";
2
- import defaultStyles from "./style.module.scss.js";
3
- import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
4
- function ChangeBar({
5
- fraction,
6
- positive,
7
- party,
8
- width,
9
- height,
10
- styles
11
- }) {
12
- let centre = parseFloat(width) / 2;
13
- let barwidth = parseFloat(fraction) * (parseFloat(width) / 2);
14
- let negleft = `${centre - barwidth}px`;
15
- let posleft = `${centre}px`;
16
- let thisStyles = ` height: ${height}; width: ${barwidth}px; ${positive ? `left: ${posleft}` : `left: ${negleft}`}`;
17
- let thisColor = ` bg-color--${party}`;
18
- let zeroStyles = ` height: ${height};`;
19
- styles = mergeStyles({ ...defaultStyles }, styles);
20
- return /* @__PURE__ */ jsxs("div", { className: styles.wrapper, style: `width: ${width}px`, children: [
21
- /* @__PURE__ */ jsx("div", { className: styles.bar.concat(thisColor), style: thisStyles }),
22
- /* @__PURE__ */ jsx("div", { className: styles.zero, style: zeroStyles })
23
- ] });
24
- }
25
- export {
26
- ChangeBar
27
- };
@@ -1,14 +0,0 @@
1
- const wrapper = "_wrapper_5oj1x_9";
2
- const bar = "_bar_5oj1x_14";
3
- const zero = "_zero_5oj1x_19";
4
- const defaultStyles = {
5
- wrapper,
6
- bar,
7
- zero
8
- };
9
- export {
10
- bar,
11
- defaultStyles as default,
12
- wrapper,
13
- zero
14
- };
@@ -1,6 +0,0 @@
1
- export function Chevron({ active, direction, size, styles, }: {
2
- active?: boolean;
3
- direction?: string;
4
- size?: string;
5
- styles: any;
6
- }): import("preact").JSX.Element;
@@ -1,78 +0,0 @@
1
- import { jsx } from "preact/jsx-runtime";
2
- import defaultStyles from "./style.module.css.js";
3
- import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
4
- const DIRECTION = {
5
- up: "up",
6
- down: "down"
7
- };
8
- const SIZE = {
9
- small: "small",
10
- large: "large"
11
- };
12
- function Chevron({
13
- active = false,
14
- direction = DIRECTION.down,
15
- size = SIZE.small,
16
- styles
17
- }) {
18
- const defaultStylesCopy = { ...defaultStyles };
19
- if (active) {
20
- defaultStylesCopy.path = mergeStyles(
21
- defaultStyles.path,
22
- defaultStyles.active
23
- );
24
- }
25
- if (direction === DIRECTION.up) {
26
- defaultStylesCopy.group = mergeStyles(
27
- defaultStyles.group,
28
- defaultStyles.rotated
29
- );
30
- }
31
- styles = mergeStyles(defaultStylesCopy, styles);
32
- return size === SIZE.small ? /* @__PURE__ */ jsx(SmallChevron, { styles }) : /* @__PURE__ */ jsx(LargeChevron, { styles });
33
- }
34
- function SmallChevron({ styles }) {
35
- return /* @__PURE__ */ jsx(
36
- "svg",
37
- {
38
- width: "16",
39
- height: "24",
40
- viewBox: "0 0 16 24",
41
- className: styles.svg,
42
- fill: "none",
43
- xmlns: "http://www.w3.org/2000/svg",
44
- children: /* @__PURE__ */ jsx("g", { className: styles.group, style: "transform-box: fill-box;", children: /* @__PURE__ */ jsx(
45
- "path",
46
- {
47
- fillRule: "evenodd",
48
- clipRule: "evenodd",
49
- d: "M7.80569 10.7123L11.6344 15H12.365L16.1938 10.7123L15.4997 10L11.9997 13L8.49976 10L7.80569 10.7123Z",
50
- className: styles.path
51
- }
52
- ) })
53
- }
54
- );
55
- }
56
- function LargeChevron({ styles }) {
57
- return /* @__PURE__ */ jsx(
58
- "svg",
59
- {
60
- width: "15",
61
- height: "19",
62
- className: styles.svg,
63
- viewBox: "0 0 15 19",
64
- fill: "none",
65
- xmlns: "http://www.w3.org/2000/svg",
66
- children: /* @__PURE__ */ jsx("g", { className: styles.group, children: /* @__PURE__ */ jsx(
67
- "path",
68
- {
69
- 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",
70
- className: styles.path
71
- }
72
- ) })
73
- }
74
- );
75
- }
76
- export {
77
- Chevron
78
- };
@@ -1,20 +0,0 @@
1
- const svg = "_svg_b5io0_1";
2
- const group = "_group_b5io0_5";
3
- const rotated = "_rotated_b5io0_10";
4
- const path = "_path_b5io0_14";
5
- const active = "_active_b5io0_18";
6
- const defaultStyles = {
7
- svg,
8
- group,
9
- rotated,
10
- path,
11
- active
12
- };
13
- export {
14
- active,
15
- defaultStyles as default,
16
- group,
17
- path,
18
- rotated,
19
- svg
20
- };
@@ -1,6 +0,0 @@
1
- export function CircleIcon({ color, pulse, diameter, styles }: {
2
- color: any;
3
- pulse?: boolean;
4
- diameter?: number;
5
- styles: any;
6
- }): import("preact").JSX.Element;
@@ -1,32 +0,0 @@
1
- import { jsx } from "preact/jsx-runtime";
2
- import defaultStyles from "./style.module.css.js";
3
- import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
4
- const CircleIcon = ({ color, pulse = false, diameter = 11, styles }) => {
5
- styles = mergeStyles(defaultStyles, styles);
6
- let radius = diameter / 2;
7
- let padding = 2;
8
- return /* @__PURE__ */ jsx(
9
- "svg",
10
- {
11
- style: styles.svg,
12
- fill: "none",
13
- height: diameter + padding,
14
- viewBox: `0 0 ${diameter + padding} ${diameter + padding}`,
15
- width: diameter + padding,
16
- xmlns: "http://www.w3.org/2000/svg",
17
- children: /* @__PURE__ */ jsx(
18
- "circle",
19
- {
20
- className: [styles.circle, pulse && styles.pulse].join(" "),
21
- style: { fill: color },
22
- r: radius,
23
- cx: radius + padding / 2,
24
- cy: radius + padding / 2
25
- }
26
- )
27
- }
28
- );
29
- };
30
- export {
31
- CircleIcon
32
- };
@@ -1,14 +0,0 @@
1
- const svg = "_svg_1v49v_1";
2
- const circle = "_circle_1v49v_5";
3
- const pulse = "_pulse_1v49v_9";
4
- const defaultStyles = {
5
- svg,
6
- circle,
7
- pulse
8
- };
9
- export {
10
- circle,
11
- defaultStyles as default,
12
- pulse,
13
- svg
14
- };
@@ -1,5 +0,0 @@
1
- export function CloseButton({ border, onClick, styles }: {
2
- border?: boolean;
3
- onClick: any;
4
- styles: any;
5
- }): import("preact").JSX.Element;
@@ -1,35 +0,0 @@
1
- import { jsx } from "preact/jsx-runtime";
2
- import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
3
- import defaultStyles from "./style.module.css.js";
4
- function CloseButton({ border = true, onClick, styles }) {
5
- styles = mergeStyles(defaultStyles, styles);
6
- return /* @__PURE__ */ jsx(
7
- "button",
8
- {
9
- className: [styles.button, border && styles.buttonBorder].join(" "),
10
- onClick,
11
- children: /* @__PURE__ */ jsx(
12
- "svg",
13
- {
14
- className: styles.svg,
15
- viewBox: "0 0 17 17",
16
- fill: "none",
17
- preserveAspectRatio: "xMidYMid meet",
18
- xmlns: "http://www.w3.org/2000/svg",
19
- children: /* @__PURE__ */ jsx(
20
- "path",
21
- {
22
- className: styles.path,
23
- fillRule: "evenodd",
24
- clipRule: "evenodd",
25
- d: "M8.32497 10.025L15.5499 16.6499L16.6249 15.5749L10.025 8.32497L16.6249 1.075L15.5499 0L8.32497 6.62498L1.075 0.0249999L0 1.1L6.62498 8.32497L0 15.5499L1.075 16.6249L8.32497 10.025Z"
26
- }
27
- )
28
- }
29
- )
30
- }
31
- );
32
- }
33
- export {
34
- CloseButton
35
- };
@@ -1,17 +0,0 @@
1
- const button = "_button_1bibm_1";
2
- const buttonBorder = "_buttonBorder_1bibm_14";
3
- const svg = "_svg_1bibm_22";
4
- const path = "_path_1bibm_29";
5
- const defaultStyles = {
6
- button,
7
- buttonBorder,
8
- svg,
9
- path
10
- };
11
- export {
12
- button,
13
- buttonBorder,
14
- defaultStyles as default,
15
- path,
16
- svg
17
- };
@@ -1,5 +0,0 @@
1
- export function Container({ children, sideBorders, styles }: {
2
- children: any;
3
- sideBorders?: boolean;
4
- styles: any;
5
- }): import("preact").JSX.Element;
@@ -1,13 +0,0 @@
1
- import { jsx } from "preact/jsx-runtime";
2
- import defaultStyles from "./style.module.scss.js";
3
- import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
4
- function Container({ children, sideBorders = false, styles }) {
5
- const { pageContainer, sideBorders: sideBordersStyle } = mergeStyles(
6
- defaultStyles,
7
- styles
8
- );
9
- return /* @__PURE__ */ jsx("div", { className: [pageContainer, sideBorders && sideBordersStyle].join(" "), children });
10
- }
11
- export {
12
- Container
13
- };