@uob-web-and-digital/component-library 2.20.18 → 2.20.20

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.
@@ -22,3 +22,4 @@ export declare const Default: Story;
22
22
  export declare const DarkBackground: Story;
23
23
  export declare const WithoutComponentHeading: Story;
24
24
  export declare const FewPoints: Story;
25
+ export declare const OptionalLabelAndDescription: Story;
@@ -9,17 +9,17 @@ export interface TimelinePointLink {
9
9
  }
10
10
  export interface TimelinePoint {
11
11
  /**
12
- * Date or short label shown in the gold badge (required, max 20 characters)
12
+ * Optional date or short label shown in the gold badge (max 20 characters)
13
13
  */
14
- label: string;
14
+ label?: string;
15
15
  /**
16
16
  * Optional point heading (max 30 characters)
17
17
  */
18
18
  heading?: string;
19
19
  /**
20
- * Description text (required, max 100 characters)
20
+ * Optional description text (max 100 characters)
21
21
  */
22
- description: string;
22
+ description?: string;
23
23
  /**
24
24
  * Optional link rendered with a trailing arrow (max 25 characters)
25
25
  */
@@ -1,3 +1,4 @@
1
+ import { RefObject } from 'react';
1
2
  import { TimelinePoint } from './TimelineItem';
2
3
  import { TimelinePage } from './timelineLayout';
3
4
  export interface TimelineEmbla {
@@ -22,5 +23,9 @@ export interface TimelineEmbla {
22
23
  * staggered, paged, no-partials packing Embla cannot express). Each page is one Embla
23
24
  * slide, so Embla snaps page-by-page on desktop and point-by-point on mobile. Pages are
24
25
  * recomputed from the live viewport width, and Embla is re-initialised when they change.
26
+ *
27
+ * The prev/next button refs are needed for end-of-track focus handling: when activating a
28
+ * button scrolls to an end it becomes disabled, and a disabled element cannot keep focus,
29
+ * so focus is moved to the opposite (still-enabled) button - the standard carousel pattern.
25
30
  */
26
- export declare function useTimelineEmbla(points: TimelinePoint[]): TimelineEmbla;
31
+ export declare function useTimelineEmbla(points: TimelinePoint[], prevButtonRef: RefObject<HTMLButtonElement>, nextButtonRef: RefObject<HTMLButtonElement>): TimelineEmbla;