@sequencing/design-system 1.0.50 → 1.0.52

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,7 +1,13 @@
1
1
  import React, { PropsWithChildren } from "react";
2
2
  export type CustomLink = {
3
- label: string;
3
+ /** Link's url */
4
4
  url?: string;
5
+ /** Link's label */
6
+ label: string;
7
+ /**
8
+ * The callback function for when the link is clicked.
9
+ * Note it suppress the native HTML event and only returns the set `url`
10
+ */
5
11
  onClick?: (url?: string) => void;
6
12
  };
7
13
  export interface LinkProps {
@@ -1,5 +1,12 @@
1
- import React from "react";
1
+ import React, { ReactNode } from "react";
2
2
  import { CustomLink } from "../../Atoms/Link/Link";
3
+ type CustomLinkWithIcon = CustomLink & {
4
+ /**
5
+ * You can pass any React element to be rendered as an addornment. Note you'll have full control over this property,
6
+ * meaning you are responsible for placing in the page selector
7
+ */
8
+ addornment?: ReactNode;
9
+ };
3
10
  interface PageSelectorProps {
4
11
  /**
5
12
  * If pageLinks' length is greater than this value, only mobile views, a fly over menu will appear
@@ -8,10 +15,11 @@ interface PageSelectorProps {
8
15
  */
9
16
  minimumLinksToDisplayFlyOverMenu?: number;
10
17
  /**
11
- * Array of `CustomLink` to work as page selectors
18
+ * Array of `CustomLink` to work as page selectors plus an optional ReactNode
19
+ * that can be used as an addornment for the page selector
12
20
  * @see {@link CustomLink}
13
21
  */
14
- pageLinks: CustomLink[];
22
+ pageLinks: CustomLinkWithIcon[];
15
23
  /**
16
24
  * The index of the selected `pageLink`. This item will appear in a `selected` state.
17
25
  * The look and feel of the item is determined by the `variant`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequencing/design-system",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "Sequencing Design System",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\"",