@guardian/interactive-component-library 0.4.3 → 0.4.5

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.
@@ -36,14 +36,13 @@ class MapRenderer {
36
36
  }
37
37
  viewState.projection = projection;
38
38
  };
39
- const baseLayers = visibleLayers.filter((layer) => !layer.declutter);
40
- for (const layer of baseLayers) {
41
- renderLayer(layer);
42
- }
43
39
  const declutterTree = new RBush();
44
- const layersToDeclutter = [...visibleLayers].filter((layer) => !!layer.declutter).reverse();
45
- for (const layer of layersToDeclutter) {
46
- renderLayer(layer, declutterTree);
40
+ for (const layer of visibleLayers) {
41
+ if (layer.declutter) {
42
+ renderLayer(layer, declutterTree);
43
+ } else {
44
+ renderLayer(layer);
45
+ }
47
46
  }
48
47
  replaceChildren(this._element, mapElements);
49
48
  }
@@ -43,10 +43,12 @@ class TextLayerRenderer {
43
43
  x: relativeX * viewPortSize[0],
44
44
  y: relativeY * viewPortSize[1]
45
45
  });
46
- if (declutterTree.collides(bbox)) {
47
- continue;
46
+ if (declutterTree) {
47
+ if (declutterTree.collides(bbox)) {
48
+ continue;
49
+ }
50
+ declutterTree.insert(bbox);
48
51
  }
49
- declutterTree.insert(bbox);
50
52
  if (this.layer.drawCollisionBoxes) {
51
53
  const collisionBoxDebugElement = this.getCollisionBoxElement(bbox);
52
54
  textElements.push(collisionBoxDebugElement);
@@ -1,13 +1,13 @@
1
- const optionPicker = "_optionPicker_1b561_1";
2
- const title = "_title_1b561_13";
3
- const options = "_options_1b561_20";
4
- const option = "_option_1b561_1";
5
- const selected = "_selected_1b561_46";
6
- const optionIconContainer = "_optionIconContainer_1b561_55";
7
- const optionIcon = "_optionIcon_1b561_55";
8
- const optionTitle = "_optionTitle_1b561_67";
9
- const checkmark = "_checkmark_1b561_78";
10
- const checkmarkPath = "_checkmarkPath_1b561_82";
1
+ const optionPicker = "_optionPicker_1c1rh_1";
2
+ const title = "_title_1c1rh_13";
3
+ const options = "_options_1c1rh_20";
4
+ const option = "_option_1c1rh_1";
5
+ const selected = "_selected_1c1rh_47";
6
+ const optionIconContainer = "_optionIconContainer_1c1rh_56";
7
+ const optionIcon = "_optionIcon_1c1rh_56";
8
+ const optionTitle = "_optionTitle_1c1rh_68";
9
+ const checkmark = "_checkmark_1c1rh_79";
10
+ const checkmarkPath = "_checkmarkPath_1c1rh_83";
11
11
  const defaultStyles = {
12
12
  optionPicker,
13
13
  title,
@@ -1,5 +1,6 @@
1
- export function Ticker({ maxItems, onStateChange, children }: {
1
+ export function Ticker({ maxItems, onStateChange, verticalAtMobile, children, }: {
2
2
  maxItems?: number;
3
3
  onStateChange: any;
4
+ verticalAtMobile?: boolean;
4
5
  children: any;
5
6
  }): import("preact").JSX.Element;
@@ -1,19 +1,20 @@
1
1
  import { jsxs, jsx } from "preact/jsx-runtime";
2
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";
3
+ import { useState, useRef, useLayoutEffect, useMemo, useEffect, useCallback } from "preact/hooks";
4
+ import { useContainerSize } from "../../../shared/hooks/useContainerSize.js";
5
+ import { TickerControlsDesktop } from "./lib/TickerControlsDesktop.js";
6
+ import { TickerControlsMobileVertical } from "./lib/TickerControlsMobileVertical.js";
7
+ import { getOffsetDistance } from "./lib/helpers/tickerHelper.js";
9
8
  import styles from "./style.module.scss.js";
10
- function Ticker({ maxItems = 20, onStateChange, children }) {
9
+ function Ticker({
10
+ maxItems = 20,
11
+ onStateChange,
12
+ verticalAtMobile = false,
13
+ children
14
+ }) {
11
15
  const [pageIndex, setPageIndex] = useState(0);
12
- const [pageWidth, setPageWidth] = useState(0);
16
+ const [scrollElWidth, setScrollElWidth] = useState(0);
13
17
  const [numberOfPages, setNumberOfPages] = useState(0);
14
- const offsetWidth = useMemo(() => {
15
- return -pageIndex * (pageWidth || 0);
16
- }, [pageIndex, pageWidth]);
17
18
  const tickerRef = useRef();
18
19
  const tickerItemsRef = useRef();
19
20
  const tickerScrollRef = useRef();
@@ -21,20 +22,33 @@ function Ticker({ maxItems = 20, onStateChange, children }) {
21
22
  const [hideButtons, setHideButtons] = useState(false);
22
23
  const [expanded, setExpanded] = useState(false);
23
24
  const childArray = toChildArray(children);
25
+ const containerSize = useContainerSize(tickerRef);
26
+ const mobLandscapeW = 480;
27
+ const containerWidth = containerSize ? containerSize.width : 600;
28
+ const isMobile = containerWidth < mobLandscapeW;
29
+ const pageWidthModifier = 0.75;
24
30
  useLayoutEffect(() => {
25
31
  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
- );
32
+ const containerWidth2 = tickerItemsContainer.clientWidth * pageWidthModifier;
33
+ const tickerScrollEl = tickerScrollRef.current;
34
+ setScrollElWidth(tickerScrollEl.scrollWidth);
35
+ const numberOfPages2 = tickerScrollEl.scrollWidth / containerWidth2;
31
36
  setNumberOfPages(numberOfPages2);
32
37
  }, [childArray]);
33
- useLayoutEffect(() => {
38
+ const offsetWidth = useMemo(() => {
39
+ let res = getOffsetDistance(
40
+ pageIndex,
41
+ numberOfPages,
42
+ scrollElWidth,
43
+ pageWidthModifier
44
+ );
45
+ return res;
46
+ }, [pageIndex, numberOfPages, scrollElWidth]);
47
+ useEffect(() => {
34
48
  const hideButtons2 = childArray.length < 4;
35
49
  setHideButtons(hideButtons2);
36
50
  }, [childArray]);
37
- function toggleExpandedState() {
51
+ const toggleExpandedState = useCallback(() => {
38
52
  if (expanded) {
39
53
  tickerRef.current.scrollIntoView({ behavior: "smooth", alignToTop: true });
40
54
  }
@@ -43,54 +57,44 @@ function Ticker({ maxItems = 20, onStateChange, children }) {
43
57
  if (onStateChange) onStateChange({ expanded: newState });
44
58
  return newState;
45
59
  });
46
- }
60
+ }, [expanded, onStateChange]);
47
61
  return /* @__PURE__ */ jsxs(
48
62
  "div",
49
63
  {
50
64
  ref: tickerRef,
51
- className: styles.ticker,
65
+ className: verticalAtMobile ? styles.tickerVertical : styles.ticker,
52
66
  style: `--ticker-offset: ${offsetWidth}px;`,
53
67
  "data-expanded": expanded,
54
68
  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(
69
+ /* @__PURE__ */ jsx("div", { ref: tickerItemsRef, className: styles.tickerItems, children: /* @__PURE__ */ jsx(
60
70
  "div",
61
71
  {
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
- ]
72
+ ref: tickerScrollRef,
73
+ className: verticalAtMobile ? styles.tickerScrollVertical : styles.tickerScroll,
74
+ children: childArray.map((child, index) => {
75
+ var _a;
76
+ return /* @__PURE__ */ jsx("div", { className: styles.tickerItem, children: child }, ((_a = child == null ? void 0 : child.props) == null ? void 0 : _a.id) ?? index);
77
+ })
78
+ }
79
+ ) }),
80
+ isMobile && !verticalAtMobile && /* @__PURE__ */ jsx("div", { className: styles.gradientHorizontal }),
81
+ isMobile && verticalAtMobile && /* @__PURE__ */ jsx(
82
+ TickerControlsMobileVertical,
83
+ {
84
+ hideButtons,
85
+ controlsRef,
86
+ toggleExpandedState,
87
+ buttonText: expanded ? "Show fewer" : `Show ${maxItems} most recent`
88
+ }
89
+ ),
90
+ !isMobile && /* @__PURE__ */ jsx(
91
+ TickerControlsDesktop,
92
+ {
93
+ hideButtons,
94
+ controlsRef,
95
+ setPageIndex,
96
+ pageIndex,
97
+ numberOfPages
94
98
  }
95
99
  )
96
100
  ]
@@ -0,0 +1,7 @@
1
+ export function TickerControlsDesktop({ hideButtons, controlsRef, setPageIndex, pageIndex, numberOfPages, }: {
2
+ hideButtons: any;
3
+ controlsRef: any;
4
+ setPageIndex: any;
5
+ pageIndex: any;
6
+ numberOfPages: any;
7
+ }): import("preact").JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { jsxs, jsx } from "preact/jsx-runtime";
2
+ import { Gradient } from "../gradient/index.js";
3
+ import "preact/hooks";
4
+ import "../../../particles/info-button/index.js";
5
+ import "../../../particles/relative-time-sentence/index.js";
6
+ import { ArrowButton } from "../../../particles/arrow-button/index.js";
7
+ import styles from "../style.module.scss.js";
8
+ const TickerControlsDesktop = ({
9
+ hideButtons,
10
+ controlsRef,
11
+ setPageIndex,
12
+ pageIndex,
13
+ numberOfPages
14
+ }) => {
15
+ const getDisabled = (indx, numPages) => {
16
+ if (indx === 0 && numPages > 1) {
17
+ return false;
18
+ }
19
+ return indx >= Math.floor(numPages) - 1;
20
+ };
21
+ return /* @__PURE__ */ jsxs(
22
+ "div",
23
+ {
24
+ ref: controlsRef,
25
+ className: styles.controls,
26
+ style: hideButtons && { display: "none" },
27
+ children: [
28
+ /* @__PURE__ */ jsx("div", { className: styles.gradient, children: /* @__PURE__ */ jsx(Gradient, {}) }),
29
+ /* @__PURE__ */ jsxs("div", { className: styles.buttons, children: [
30
+ /* @__PURE__ */ jsx(
31
+ ArrowButton,
32
+ {
33
+ onClick: () => setPageIndex((d) => d + 1),
34
+ disabled: getDisabled(pageIndex, numberOfPages)
35
+ }
36
+ ),
37
+ /* @__PURE__ */ jsx(
38
+ ArrowButton,
39
+ {
40
+ direction: "left",
41
+ onClick: () => setPageIndex((d) => d - 1),
42
+ disabled: pageIndex <= 0
43
+ }
44
+ )
45
+ ] })
46
+ ]
47
+ }
48
+ );
49
+ };
50
+ export {
51
+ TickerControlsDesktop
52
+ };
@@ -0,0 +1,6 @@
1
+ export function TickerControlsMobileVertical({ hideButtons, controlsRef, toggleExpandedState, buttonText, }: {
2
+ hideButtons: any;
3
+ controlsRef: any;
4
+ toggleExpandedState: any;
5
+ buttonText: any;
6
+ }): import("preact").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { jsxs, jsx } from "preact/jsx-runtime";
2
+ import { Gradient } from "../gradient/index.js";
3
+ import "preact/hooks";
4
+ import "../../../particles/info-button/index.js";
5
+ import "../../../particles/relative-time-sentence/index.js";
6
+ import { Button } from "../../../particles/button/index.js";
7
+ import styles from "../style.module.scss.js";
8
+ const TickerControlsMobileVertical = ({
9
+ hideButtons,
10
+ controlsRef,
11
+ toggleExpandedState,
12
+ buttonText
13
+ }) => {
14
+ return /* @__PURE__ */ jsxs(
15
+ "div",
16
+ {
17
+ ref: controlsRef,
18
+ className: styles.controls,
19
+ style: hideButtons && { display: "none" },
20
+ children: [
21
+ /* @__PURE__ */ jsx("div", { className: styles.gradient, children: /* @__PURE__ */ jsx(Gradient, {}) }),
22
+ /* @__PURE__ */ jsx("div", { className: styles.button, children: /* @__PURE__ */ jsx(
23
+ Button,
24
+ {
25
+ type: "regular",
26
+ styles: { buttonInner: styles.buttonInner },
27
+ onClick: toggleExpandedState,
28
+ children: buttonText
29
+ }
30
+ ) })
31
+ ]
32
+ }
33
+ );
34
+ };
35
+ export {
36
+ TickerControlsMobileVertical
37
+ };
@@ -0,0 +1 @@
1
+ export function getOffsetDistance(pageIndex: any, numberOfPages: any, scrollElWidth: any, pageWidthModifier: any): number;
@@ -0,0 +1,17 @@
1
+ const getOffsetDistance = (pageIndex, numberOfPages, scrollElWidth, pageWidthModifier) => {
2
+ const onlyOnePush = numberOfPages > 1 && numberOfPages <= 2;
3
+ const defaultPushDistance = onlyOnePush ? scrollElWidth / numberOfPages * pageWidthModifier : scrollElWidth / Math.floor(numberOfPages);
4
+ const finalPushDistance = defaultPushDistance * (numberOfPages % 1);
5
+ if (pageIndex === 0) {
6
+ return 0;
7
+ } else if (pageIndex === 1 && onlyOnePush) {
8
+ return -finalPushDistance;
9
+ } else if (pageIndex === Math.floor(numberOfPages) - 1) {
10
+ return -pageIndex * defaultPushDistance + finalPushDistance;
11
+ } else if (pageIndex < Math.floor(numberOfPages)) {
12
+ return -pageIndex * defaultPushDistance;
13
+ }
14
+ };
15
+ export {
16
+ getOffsetDistance
17
+ };
@@ -1,19 +1,25 @@
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";
1
+ const tickerVertical = "_tickerVertical_ozku7_9";
2
+ const ticker = "_ticker_ozku7_9";
3
+ const tickerItems = "_tickerItems_ozku7_27";
4
+ const tickerScrollVertical = "_tickerScrollVertical_ozku7_32";
5
+ const tickerScroll = "_tickerScroll_ozku7_32";
6
+ const tickerItem = "_tickerItem_ozku7_27";
7
+ const controls = "_controls_ozku7_75";
8
+ const gradient = "_gradient_ozku7_90";
9
+ const gradientHorizontal = "_gradientHorizontal_ozku7_102";
10
+ const buttons = "_buttons_ozku7_116";
11
+ const button = "_button_ozku7_116";
12
+ const buttonInner = "_buttonInner_ozku7_142";
10
13
  const styles = {
14
+ tickerVertical,
11
15
  ticker,
12
16
  tickerItems,
17
+ tickerScrollVertical,
13
18
  tickerScroll,
14
19
  tickerItem,
15
20
  controls,
16
21
  gradient,
22
+ gradientHorizontal,
17
23
  buttons,
18
24
  button,
19
25
  buttonInner
@@ -25,8 +31,11 @@ export {
25
31
  controls,
26
32
  styles as default,
27
33
  gradient,
34
+ gradientHorizontal,
28
35
  ticker,
29
36
  tickerItem,
30
37
  tickerItems,
31
- tickerScroll
38
+ tickerScroll,
39
+ tickerScrollVertical,
40
+ tickerVertical
32
41
  };
package/dist/style.css CHANGED
@@ -3009,7 +3009,7 @@ body.android {
3009
3009
  cursor: auto;
3010
3010
  background-color: var(--tertiary-bg-color);
3011
3011
  }
3012
- ._optionPicker_1b561_1 {
3012
+ ._optionPicker_1c1rh_1 {
3013
3013
  background-color: rgba(255, 255, 255, 0.6);
3014
3014
  border: 1px solid var(--border-divider-color);
3015
3015
  border-radius: 8px;
@@ -3021,31 +3021,32 @@ body.android {
3021
3021
  row-gap: 4px;
3022
3022
  }
3023
3023
 
3024
- ._title_1b561_13 {
3024
+ ._title_1c1rh_13 {
3025
3025
  color: var(--secondary-text-color);
3026
3026
  font-family: var(--text-sans);
3027
3027
  font-size: var(--sans-xxsmall);
3028
3028
  line-height: var(--sans-line-height);
3029
3029
  }
3030
3030
 
3031
- ._options_1b561_20 {
3031
+ ._options_1c1rh_20 {
3032
3032
  display: flex;
3033
3033
  flex-direction: row;
3034
3034
  justify-content: stretch;
3035
3035
  gap: var(--space-2);
3036
3036
  }
3037
3037
 
3038
- ._options_1b561_20.vertical {
3038
+ ._options_1c1rh_20.vertical {
3039
3039
  flex-direction: column;
3040
3040
  }
3041
3041
 
3042
- ._option_1b561_1 {
3042
+ ._option_1c1rh_1 {
3043
+ flex: 1;
3044
+
3043
3045
  display: flex;
3044
3046
  flex-direction: column;
3045
3047
  align-items: center;
3046
3048
  gap: var(--space-2);
3047
3049
  min-height: 70px;
3048
- max-width: 124px;
3049
3050
 
3050
3051
  border: 1px solid var(--border-divider-color);
3051
3052
  border-radius: 8px;
@@ -3054,16 +3055,16 @@ body.android {
3054
3055
  background-color: var(--primary-bg-color);
3055
3056
  }
3056
3057
 
3057
- ._option_1b561_1._selected_1b561_46 {
3058
+ ._option_1c1rh_1._selected_1c1rh_47 {
3058
3059
  border: 1px solid var(--primary-text-color);
3059
3060
  }
3060
3061
 
3061
- ._option_1b561_1:hover:enabled {
3062
+ ._option_1c1rh_1:hover:enabled {
3062
3063
  background-color: var(--news-grey-05);
3063
3064
  cursor: pointer;
3064
3065
  }
3065
3066
 
3066
- ._optionIconContainer_1b561_55 {
3067
+ ._optionIconContainer_1c1rh_56 {
3067
3068
  width: 100%;
3068
3069
  display: flex;
3069
3070
  flex-direction: row;
@@ -3071,26 +3072,26 @@ body.android {
3071
3072
  gap: var(--space-1);
3072
3073
  }
3073
3074
 
3074
- ._optionIcon_1b561_55 {
3075
+ ._optionIcon_1c1rh_56 {
3075
3076
  width: 100%;
3076
3077
  }
3077
3078
 
3078
- ._optionTitle_1b561_67 {
3079
+ ._optionTitle_1c1rh_68 {
3079
3080
  color: var(--primary-text-color);
3080
3081
  font-family: var(--text-sans);
3081
3082
  font-size: var(--sans-xxsmall);
3082
3083
  line-height: var(--sans-line-height);
3083
3084
  }
3084
3085
 
3085
- ._option_1b561_1._selected_1b561_46 ._optionTitle_1b561_67 {
3086
+ ._option_1c1rh_1._selected_1c1rh_47 ._optionTitle_1c1rh_68 {
3086
3087
  font-weight: 700;
3087
3088
  }
3088
3089
 
3089
- ._checkmark_1b561_78 {
3090
+ ._checkmark_1c1rh_79 {
3090
3091
  width: 11px;
3091
3092
  }
3092
3093
 
3093
- ._checkmarkPath_1b561_82 {
3094
+ ._checkmarkPath_1c1rh_83 {
3094
3095
  fill: var(--primary-text-color);
3095
3096
  }
3096
3097
  body {
@@ -3199,24 +3200,30 @@ body.android {
3199
3200
  --top-inset: 58px;
3200
3201
  }
3201
3202
 
3202
- ._ticker_15ezr_9 {
3203
+ ._tickerVertical_ozku7_9 {
3203
3204
  position: relative;
3204
3205
  padding-bottom: 44px;
3205
3206
  --ticker-item-width: 100%;
3206
3207
  }
3207
3208
  @media (min-width: 30em) {
3208
- ._ticker_15ezr_9 {
3209
- --ticker-item-width: 200px;
3209
+ ._tickerVertical_ozku7_9 {
3210
+ --ticker-item-width: auto;
3210
3211
  padding: 0;
3211
3212
  }
3212
3213
  }
3213
3214
 
3214
- ._tickerItems_15ezr_21 {
3215
+ ._ticker_ozku7_9 {
3216
+ position: relative;
3217
+ --ticker-item-width: 200px;
3218
+ padding: 0;
3219
+ }
3220
+
3221
+ ._tickerItems_ozku7_27 {
3215
3222
  width: 100%;
3216
3223
  overflow: clip;
3217
3224
  }
3218
3225
 
3219
- ._tickerScroll_15ezr_26 {
3226
+ ._tickerScrollVertical_ozku7_32 {
3220
3227
  display: flex;
3221
3228
  flex-direction: column;
3222
3229
  row-gap: var(--space-2);
@@ -3225,7 +3232,7 @@ body.android {
3225
3232
  overflow: visible;
3226
3233
  }
3227
3234
  @media (min-width: 30em) {
3228
- ._tickerScroll_15ezr_26 {
3235
+ ._tickerScrollVertical_ozku7_32 {
3229
3236
  flex-direction: row;
3230
3237
  column-gap: var(--space-2);
3231
3238
  transform: translateX(var(--ticker-offset));
@@ -3233,19 +3240,40 @@ body.android {
3233
3240
  }
3234
3241
  }
3235
3242
 
3236
- ._tickerItem_15ezr_21 {
3243
+ ._tickerScroll_ozku7_32 {
3244
+ display: flex;
3245
+ flex-direction: row;
3246
+ flex-wrap: nowrap;
3247
+ scrollbar-width: none;
3248
+ overflow-x: scroll;
3249
+ column-gap: var(--space-2);
3250
+ transform: translateX(var(--ticker-offset));
3251
+ transition: transform 0.5s ease-in-out;
3252
+ width: auto;
3253
+ padding-right: 50px;
3254
+ }
3255
+ ._tickerScroll_ozku7_32:-webkit-scrollbar {
3256
+ display: none; /* for Chrome, Safari, and Opera */
3257
+ }
3258
+ @media (min-width: 30em) {
3259
+ ._tickerScroll_ozku7_32 {
3260
+ width: fit-content;
3261
+ }
3262
+ }
3263
+
3264
+ ._tickerItem_ozku7_27 {
3237
3265
  width: var(--ticker-item-width);
3238
3266
  flex-shrink: 0;
3239
3267
  }
3240
3268
 
3241
- ._controls_15ezr_48 {
3269
+ ._controls_ozku7_75 {
3242
3270
  position: absolute;
3243
3271
  bottom: 0;
3244
3272
  width: 100%;
3245
3273
  height: 130px;
3246
3274
  }
3247
3275
  @media (min-width: 30em) {
3248
- ._controls_15ezr_48 {
3276
+ ._controls_ozku7_75 {
3249
3277
  top: 0;
3250
3278
  right: 0;
3251
3279
  width: 86px;
@@ -3253,23 +3281,37 @@ body.android {
3253
3281
  }
3254
3282
  }
3255
3283
 
3256
- ._gradient_15ezr_63 {
3284
+ ._gradient_ozku7_90 {
3257
3285
  width: 100%;
3258
3286
  height: 86px;
3259
3287
  }
3260
3288
  @media (min-width: 30em) {
3261
- ._gradient_15ezr_63 {
3289
+ ._gradient_ozku7_90 {
3262
3290
  width: auto;
3263
3291
  height: 100%;
3264
3292
  right: 0;
3265
3293
  }
3266
3294
  }
3267
3295
 
3268
- ._buttons_15ezr_75 {
3296
+ ._gradientHorizontal_ozku7_102 {
3297
+ width: 60px;
3298
+ height: 100%;
3299
+ right: 0;
3300
+ top: 0;
3301
+ position: absolute;
3302
+ background: linear-gradient(to right, transparent 0%, var(--tertiary-bg-color) 80%, var(--tertiary-bg-color));
3303
+ }
3304
+ @media (min-width: 30em) {
3305
+ ._gradientHorizontal_ozku7_102 {
3306
+ width: auto;
3307
+ }
3308
+ }
3309
+
3310
+ ._buttons_ozku7_116 {
3269
3311
  display: none;
3270
3312
  }
3271
3313
  @media (min-width: 30em) {
3272
- ._buttons_15ezr_75 {
3314
+ ._buttons_ozku7_116 {
3273
3315
  position: absolute;
3274
3316
  top: 0;
3275
3317
  right: var(--space-5);
@@ -3280,36 +3322,36 @@ body.android {
3280
3322
  }
3281
3323
  }
3282
3324
 
3283
- ._button_15ezr_75 {
3325
+ ._button_ozku7_116 {
3284
3326
  min-height: 40px;
3285
3327
  background-color: var(--tertiary-bg-color);
3286
3328
  padding-bottom: 20px;
3287
3329
  }
3288
3330
  @media (min-width: 30em) {
3289
- ._button_15ezr_75 {
3331
+ ._button_ozku7_116 {
3290
3332
  display: none;
3291
3333
  }
3292
3334
  }
3293
3335
 
3294
- ._buttonInner_15ezr_101 {
3336
+ ._buttonInner_ozku7_142 {
3295
3337
  background-color: var(--tertiary-bg-color);
3296
3338
  }
3297
3339
 
3298
- ._ticker_15ezr_9[data-expanded=true] {
3340
+ ._tickerVertical_ozku7_9[data-expanded=true] {
3299
3341
  padding-bottom: 0;
3300
3342
  }
3301
3343
 
3302
- ._ticker_15ezr_9[data-expanded=true] ._tickerScroll_15ezr_26 {
3344
+ ._tickerVertical_ozku7_9[data-expanded=true] ._tickerScrollVertical_ozku7_32 {
3303
3345
  max-height: fit-content;
3304
3346
  margin-bottom: -40px;
3305
3347
  }
3306
3348
 
3307
- ._ticker_15ezr_9[data-expanded=true] ._controls_15ezr_48 {
3349
+ ._tickerVertical_ozku7_9[data-expanded=true] ._controls_ozku7_75 {
3308
3350
  position: sticky;
3309
3351
  margin-top: -40px;
3310
3352
  }
3311
3353
 
3312
- ._ticker_15ezr_9[data-expanded=true] ._button_15ezr_75 {
3354
+ ._tickerVertical_ozku7_9[data-expanded=true] ._button_ozku7_116 {
3313
3355
  position: absolute;
3314
3356
  width: 100%;
3315
3357
  left: 0;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@guardian/interactive-component-library",
3
3
  "private": false,
4
- "version": "0.4.3",
4
+ "version": "0.4.5",
5
5
  "packageManager": "pnpm@8.4.0",
6
6
  "repository": {
7
7
  "type": "git",