@sequencing/design-system 1.0.62 → 1.0.63
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.
- package/dist/documentation.json +60 -60
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Organisms/Header/Header.d.ts +38 -39
- package/dist/esm/types/components/Organisms/Header/_components/HeaderChip/HeaderChip.d.ts +1 -1
- package/dist/esm/types/components/Organisms/Header/_components/HeaderLink/HeaderLink.d.ts +25 -0
- package/dist/esm/types/components/Organisms/Header/_components/HeaderLinkDropdown/HeaderLinkDropdown.d.ts +2 -24
- package/dist/esm/types/components/Organisms/Header/_components/HeaderLinkSection/HeaderLinkSection.d.ts +7 -3
- package/dist/esm/types/components/Organisms/index.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +61 -63
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/components/Organisms/Header/Header.d.ts +38 -39
- package/dist/types/components/Organisms/Header/_components/HeaderChip/HeaderChip.d.ts +1 -1
- package/dist/types/components/Organisms/Header/_components/HeaderLink/HeaderLink.d.ts +25 -0
- package/dist/types/components/Organisms/Header/_components/HeaderLinkDropdown/HeaderLinkDropdown.d.ts +2 -24
- package/dist/types/components/Organisms/Header/_components/HeaderLinkSection/HeaderLinkSection.d.ts +7 -3
- package/dist/types/components/Organisms/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
import { HeaderLinkData } from "./_components/HeaderLinkDropdown/HeaderLinkDropdown";
|
|
3
2
|
interface User {
|
|
4
3
|
name: string;
|
|
5
4
|
avatarImageUrl?: string;
|
|
@@ -8,11 +7,6 @@ export interface HeaderFunctions {
|
|
|
8
7
|
closeMobileMenu: () => void;
|
|
9
8
|
}
|
|
10
9
|
export interface HeaderProps {
|
|
11
|
-
/**
|
|
12
|
-
* A React node with the links to be rendered on the right side of the header,
|
|
13
|
-
* it will be rendered after the search bar toggle button (if provided)
|
|
14
|
-
*/
|
|
15
|
-
auxiliaryLinks?: ReactNode | HeaderLinkData[];
|
|
16
10
|
/**
|
|
17
11
|
* A React node with an optional banner to be rendered above the header.
|
|
18
12
|
* The total header height is dynamic calculated and includes the banner's height
|
|
@@ -21,32 +15,28 @@ export interface HeaderProps {
|
|
|
21
15
|
/** Custom css class to customize the stylings */
|
|
22
16
|
customClass?: string;
|
|
23
17
|
/**
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
* - A button to toggle the visibility of the search bar
|
|
34
|
-
* - A div with the search bar implementation
|
|
35
|
-
*/
|
|
36
|
-
searchComponent?: ReactNode;
|
|
37
|
-
/**
|
|
38
|
-
* If the user is authenticated, pass their name and avatar image here,
|
|
39
|
-
* otherwise, `loggedOutButton` will be displayed instead.
|
|
18
|
+
* The URL of the site's home page. It will be used when the user clicks on the site's logo.
|
|
19
|
+
*
|
|
20
|
+
* PLEASE NOTE: If you want to use the SOFT navigation from your framework (React, NextJs, etc), you should
|
|
21
|
+
* path the `onRequestHomePage` prop and call the navigation method in the callback.
|
|
22
|
+
* e.g. for NextJs `onRequestHomePage={(url) => router.push(url)}`
|
|
23
|
+
* WARNING: Do not change or modify url argument inside your callback, because you will have undocumented behavior
|
|
24
|
+
* with your navigation. Your goal is only call the navigation method with the url argument.
|
|
25
|
+
* Default value is `/`.
|
|
26
|
+
* Without the `onRequestHomePage` prop, the component will use the default behavior of the anchor tag.
|
|
40
27
|
*/
|
|
41
|
-
|
|
28
|
+
homePageUrl?: string;
|
|
42
29
|
/** Displays loading skeleton animation when set to `true` */
|
|
43
30
|
isLoading?: boolean;
|
|
44
|
-
/**
|
|
31
|
+
/** The URL of user's account page */
|
|
32
|
+
myAccountUrl: string;
|
|
33
|
+
/** Specify number of skeleton links to display during loading. Default value is 6 */
|
|
45
34
|
numberOfSkeletonLinks?: number;
|
|
46
|
-
/**
|
|
35
|
+
/** Link clicks callback. Use it together with ``preventHardNavigation``
|
|
36
|
+
* to support different routers (Next, react-router-dom, etc.).
|
|
37
|
+
* NOTE: When ``preventHardNavigation`` is disabled, it has no effect.
|
|
38
|
+
*/
|
|
47
39
|
onLinkClick?: (url: string) => void;
|
|
48
|
-
/** Called when an authenticated user clicks on the Sign Out button inside the main right HeaderChip */
|
|
49
|
-
onRequestSignOut?: () => void;
|
|
50
40
|
/**
|
|
51
41
|
* Called when a user clicks on the site's logo, provide url argument to callback.
|
|
52
42
|
* Typically used to make soft navigation in your framework (React, NextJs, etc).
|
|
@@ -54,20 +44,28 @@ export interface HeaderProps {
|
|
|
54
44
|
* url argument is the `homePageUrl` prop value.
|
|
55
45
|
*/
|
|
56
46
|
onRequestHomePage?: (url: string) => void;
|
|
57
|
-
/**
|
|
58
|
-
* The URL of the site's home page. It will be used when the user clicks on the site's logo.
|
|
59
|
-
*
|
|
60
|
-
* PLEASE NOTE: If you want to use the SOFT navigation from your framework (React, NextJs, etc), you should
|
|
61
|
-
* path the `onRequestHomePage` prop and call the navigation method in the callback.
|
|
62
|
-
* e.g. for NextJs `onRequestHomePage={(url) => router.push(url)}`
|
|
63
|
-
* WARNING: Do not change or modify url argument inside your callback, because you will have undocumented behavior
|
|
64
|
-
* with your navigation. Your goal is only call the navigation method with the url argument.
|
|
65
|
-
* Default value is `/`.
|
|
66
|
-
* Without the `onRequestHomePage` prop, the component will use the default behavior of the anchor tag.
|
|
67
|
-
*/
|
|
68
|
-
homePageUrl?: string;
|
|
69
47
|
/** Called when an authenticated user clicks on the My Account link inside the main right HeaderChip */
|
|
70
48
|
onRequestMyAccount?: () => void;
|
|
49
|
+
/** Called when an anonymous user clicks on the Sign In button inside the auxiliary links section */
|
|
50
|
+
onRequestSignIn?: () => void;
|
|
51
|
+
/** Called when an authenticated user clicks on the Sign Out button inside the main right HeaderChip */
|
|
52
|
+
onRequestSignOut?: () => void;
|
|
53
|
+
/**
|
|
54
|
+
* A React node with the search component containing:
|
|
55
|
+
* - A button to toggle the visibility of the search bar
|
|
56
|
+
* - A div with the search bar implementation
|
|
57
|
+
*/
|
|
58
|
+
searchComponent?: ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* If the user is authenticated, pass their name and avatar image here
|
|
61
|
+
*/
|
|
62
|
+
user?: User;
|
|
63
|
+
/**
|
|
64
|
+
* When enabled, it avoids setting ``document.location.href`` upon link clicks and you will be
|
|
65
|
+
* responsible for handling the navigation through the ``onLinkClick`` function.
|
|
66
|
+
* This enables soft navigation for apps that want to support it.
|
|
67
|
+
*/
|
|
68
|
+
preventHardNavigation?: boolean;
|
|
71
69
|
}
|
|
72
70
|
/**
|
|
73
71
|
* This is the default header for Sequencing.
|
|
@@ -75,6 +73,7 @@ export interface HeaderProps {
|
|
|
75
73
|
* and two group of links. The main links are rendered on the left side of the bar,
|
|
76
74
|
* next to the company's logo and the auxiliary links appear on the right side.
|
|
77
75
|
* On the mobile view, all links appear stacked up in a slidein/slide-out menu.
|
|
76
|
+
* If want to use soft navigation for links, enable the ``preventHardNavigation`` flag.
|
|
78
77
|
* The header is rendered on z-index 5.
|
|
79
78
|
* When logged in, it will render a HeaderChip component with a link to the My Account page
|
|
80
79
|
* and a button for sign-out.
|
|
@@ -29,7 +29,7 @@ interface ChipProps {
|
|
|
29
29
|
*/
|
|
30
30
|
showLabelStateIcon?: boolean;
|
|
31
31
|
/** The HeaderChip button's label. Usually, it's the username */
|
|
32
|
-
label
|
|
32
|
+
label?: string;
|
|
33
33
|
/** The list of floating options to appear when the user clicks on the HeaderChip button */
|
|
34
34
|
dropdownItems?: ChipDropdownItemProps[];
|
|
35
35
|
/** Disable the click when set to `true` */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface HeaderLink {
|
|
2
|
+
/** Absolute or relative link URL. */
|
|
3
|
+
pathOrUrl?: string;
|
|
4
|
+
/** Link label. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Custom classname. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Custom onClick, takes priority over main onLinkClick prop. */
|
|
9
|
+
onClick?: (url: string) => void;
|
|
10
|
+
/** A list of nested link objects. */
|
|
11
|
+
items?: Array<{
|
|
12
|
+
/** Absolute or relative link URL. */
|
|
13
|
+
pathOrUrl?: string;
|
|
14
|
+
/** Link label. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Custom classname. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Custom onClick, takes priority over main onLinkClick prop. */
|
|
19
|
+
onClick?: (url: string) => void;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
export declare const anonMainNavData: HeaderLink[];
|
|
23
|
+
export declare const userMainNavData: HeaderLink[];
|
|
24
|
+
export declare const userAuxiliaryNavData: HeaderLink[];
|
|
25
|
+
export declare const anonAuxiliaryNavData: HeaderLink[];
|
|
@@ -1,28 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
path: string;
|
|
5
|
-
/** Link label. */
|
|
6
|
-
label: string;
|
|
7
|
-
/** Custom classname. */
|
|
8
|
-
className?: string;
|
|
9
|
-
/** Custom onClick, takes priority over main onLinkClick prop. */
|
|
10
|
-
onClick?: (url: string) => void;
|
|
11
|
-
/** A list of nested link objects. */
|
|
12
|
-
items?: Array<{
|
|
13
|
-
/** Absolute URL, used for outside links. Will be ignored if ``path`` prop is non-empty. */
|
|
14
|
-
url?: string;
|
|
15
|
-
/** Relative URL, used for links with the app. Takes precedence over ``url`` prop. */
|
|
16
|
-
path?: string;
|
|
17
|
-
/** Link label. */
|
|
18
|
-
label: string;
|
|
19
|
-
/** Custom classname. */
|
|
20
|
-
className?: string;
|
|
21
|
-
/** Custom onClick, takes priority over main onLinkClick prop. */
|
|
22
|
-
onClick?: (url: string) => void;
|
|
23
|
-
}>;
|
|
24
|
-
}
|
|
25
|
-
interface HeaderLinkDropdownProps extends HeaderLinkData {
|
|
2
|
+
import { HeaderLink } from '../HeaderLink/HeaderLink';
|
|
3
|
+
interface HeaderLinkDropdownProps extends HeaderLink {
|
|
26
4
|
/** Link click handler. */
|
|
27
5
|
onLinkClick?: (url: string) => void;
|
|
28
6
|
}
|
package/dist/types/components/Organisms/Header/_components/HeaderLinkSection/HeaderLinkSection.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { HeaderLink } from '../HeaderLink/HeaderLink';
|
|
3
3
|
interface HeaderLinkSectionProps {
|
|
4
4
|
/** List of links, or an element to display. */
|
|
5
|
-
links: ReactNode |
|
|
6
|
-
/** Link click handler. Will not be triggered if the ``links`` props is
|
|
5
|
+
links: ReactNode | HeaderLink[];
|
|
6
|
+
/** Link click handler. Will not be triggered if the ``links`` props is a ``ReactNode``
|
|
7
|
+
* or if ``preventHardNavigation`` is false.
|
|
8
|
+
*/
|
|
7
9
|
onLinkClick?: (url: string) => void;
|
|
10
|
+
/** Prevents setting ``document.location.href`` upon link clicks and instead, calls ``onLinkClick`` */
|
|
11
|
+
preventHardNavigation?: boolean;
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* The HeaderLinkSection component is a block of links in the Header.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { HeaderProps, HeaderFunctions } from "./Header/Header";
|
|
2
|
-
export type {
|
|
2
|
+
export type { HeaderLink } from "./Header/_components/HeaderLink/HeaderLink";
|
|
3
3
|
export { default as Header } from "./Header/Header";
|
|
4
4
|
export { default as Footer } from "./Footer/Footer";
|