@pantheon-systems/pds-toolkit-react 1.0.0-dev.264 → 1.0.0-dev.266

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,4 +1,5 @@
1
- import React, { ComponentPropsWithoutRef } from 'react';
1
+ import React, { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { Popover } from '@components/Popover/Popover';
2
3
  import { SitePlanLevel, SiteType } from '@libs/types/custom-types';
3
4
  import './site-dashboard-heading.css';
4
5
  /**
@@ -21,8 +22,32 @@ export interface SiteDashboardHeadingProps extends ComponentPropsWithoutRef<'div
21
22
  * Additional class names
22
23
  */
23
24
  className?: string;
25
+ /**
26
+ * Function to handle popover content.
27
+ */
28
+ popoverContent?: ReactNode;
29
+ /**
30
+ * Title for the popover.
31
+ */
32
+ popoverTitle?: string;
33
+ /**
34
+ * Function to handle popover open state.
35
+ */
36
+ popoverIsOpen?: boolean;
37
+ /**
38
+ * Function to set popover open state.
39
+ */
40
+ setPopoverIsOpen?: (isOpen: boolean) => void;
41
+ /**
42
+ * Function to handle site plan level click.
43
+ */
44
+ handleSitePlanLevelClick?: () => void;
45
+ /**
46
+ * Additional props to pass to the trigger component.
47
+ */
48
+ triggerProps?: Omit<ComponentPropsWithoutRef<typeof Popover>, 'content' | 'title' | 'placement' | 'triggerIcon'>;
24
49
  }
25
50
  /**
26
51
  * SiteDashboardHeading UI component
27
52
  */
28
- export declare const SiteDashboardHeading: ({ siteName, sitePlanLevel, siteType, className, ...props }: SiteDashboardHeadingProps) => React.JSX.Element;
53
+ export declare const SiteDashboardHeading: ({ siteName, sitePlanLevel, siteType, className, popoverContent, popoverTitle, popoverIsOpen, setPopoverIsOpen, triggerProps, ...props }: SiteDashboardHeadingProps) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import React, { ComponentPropsWithoutRef } from 'react';
1
+ import React, { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  import { ContainerWidth } from '@libs/types/custom-types';
3
3
  import './site-footer.css';
4
4
  interface SiteFooterProps extends ComponentPropsWithoutRef<'footer'> {
@@ -9,7 +9,11 @@ interface SiteFooterProps extends ComponentPropsWithoutRef<'footer'> {
9
9
  /**
10
10
  * Footer content.
11
11
  */
12
- children?: React.ReactNode;
12
+ children?: ReactNode;
13
+ /**
14
+ * Should the footer have a top border?
15
+ */
16
+ hasTopBorder?: boolean;
13
17
  /**
14
18
  * Legal policy links.
15
19
  */
@@ -22,5 +26,5 @@ interface SiteFooterProps extends ComponentPropsWithoutRef<'footer'> {
22
26
  /**
23
27
  * SiteFooter UI component
24
28
  */
25
- export declare const SiteFooter: ({ containerWidth, children, legalLinks, className, ...props }: SiteFooterProps) => React.JSX.Element;
29
+ export declare const SiteFooter: ({ containerWidth, children, hasTopBorder, legalLinks, className, ...props }: SiteFooterProps) => React.JSX.Element;
26
30
  export {};
@@ -10,7 +10,7 @@ export type DashboardNavItemProps = NavigationItem & {
10
10
  /**
11
11
  * Flag indicating whether the sidebar is expanded.
12
12
  */
13
- isSidebarExpanded: boolean;
13
+ isSidebarExpanded?: boolean;
14
14
  /**
15
15
  * Labels for translatable strings.
16
16
  */
@@ -0,0 +1,50 @@
1
+ import React, { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { SideNavGlobalItemProps } from './SideNavGlobalItem';
3
+ import './side-nav-global.css';
4
+ /**
5
+ * Prop types for SideNavGlobal
6
+ */
7
+ export interface SideNavGlobalProps extends ComponentPropsWithoutRef<'div'> {
8
+ /**
9
+ * Aria label for the navigation.
10
+ */
11
+ ariaLabel: string;
12
+ /**
13
+ * Should the Pantheon logo be displayed above the menu items?
14
+ * It will not be displayed in the mobile view regardless of this value.
15
+ */
16
+ hasLogo?: boolean;
17
+ /**
18
+ * Is the sidebar collapsed?
19
+ */
20
+ isSidebarCollapsed?: boolean;
21
+ /**
22
+ * Labels for translatable strings.
23
+ */
24
+ labels?: {
25
+ submenu: string;
26
+ toggle: string;
27
+ };
28
+ /**
29
+ * Where should the logo link to? A fully-formed link element.
30
+ * Only necessary if `hasLogo` is true.
31
+ * If the logo should not be a link, leave blank.
32
+ */
33
+ logoLinkContent?: ReactNode;
34
+ /**
35
+ * Menu items to render.
36
+ */
37
+ menuItems?: SideNavGlobalItemProps[];
38
+ /**
39
+ * Text to display in the mobile menu trigger button when no active link is found.
40
+ */
41
+ mobileMenuSelectTextFallback?: string;
42
+ /**
43
+ * Additional class names
44
+ */
45
+ className?: string;
46
+ }
47
+ /**
48
+ * SideNavGlobal UI component
49
+ */
50
+ export declare const SideNavGlobal: ({ ariaLabel, hasLogo, isSidebarCollapsed, labels, logoLinkContent, menuItems, mobileMenuSelectTextFallback, className, ...props }: SideNavGlobalProps) => React.JSX.Element;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { NavigationItem } from '@components/navigation/navigation-types';
3
+ import { PDSIcon } from '@components/icons/Icon/Icon';
4
+ import './side-nav-global.css';
5
+ export type SideNavGlobalItemProps = NavigationItem & {
6
+ /**
7
+ * Icon to display next to the link content.
8
+ */
9
+ icon?: PDSIcon;
10
+ /**
11
+ * Flag indicating whether the sidebar is collapsed.
12
+ */
13
+ isSidebarCollapsed?: boolean;
14
+ /**
15
+ * Labels for translatable strings.
16
+ */
17
+ labels?: {
18
+ submenu: string;
19
+ toggle: string;
20
+ };
21
+ };
22
+ /**
23
+ * SideNavGlobalItem UI component
24
+ */
25
+ export declare const SideNavGlobalItem: ({ icon, isActive, isSidebarCollapsed, labels, linkContent, links, }: SideNavGlobalItemProps) => React.JSX.Element;
@@ -1,6 +1,8 @@
1
+ import { PDSIcon } from '@components/icons/Icon/Icon';
1
2
  import { NavigationItem } from '@components/navigation/navigation-types';
2
3
  export declare const isActiveItem: (item: NavigationItem) => boolean;
3
4
  export declare const isActiveTrail: (item: NavigationItem) => boolean;
4
5
  export declare const getActiveLink: (items: NavigationItem[]) => JSX.Element | null;
5
6
  export declare const getLinkContentString: (linkContent: JSX.Element | string) => string;
6
7
  export declare const processNavLinkContent: (linkContent: JSX.Element | string, links?: NavigationItem[]) => JSX.Element | string;
8
+ export declare const processSideNavGlobalLinkContent: (baseClass: string, linkContent: JSX.Element | string, links?: NavigationItem[], icon?: PDSIcon) => JSX.Element;