@pantheon-systems/pds-toolkit-react 1.0.0-dev.160 → 1.0.0-dev.162
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/components/Avatar/Avatar.d.ts +1 -1
- package/_dist/components/Icon/Icon.d.ts +1 -1
- package/_dist/components/buttons/SegmentedButton/SegmentedButton.d.ts +14 -5
- package/_dist/components/navigation/DashboardNav/DashboardNav.d.ts +1 -2
- package/_dist/components/navigation/DashboardNav/dashboard-nav-sample-content.d.ts +3 -0
- package/_dist/components/navigation/UserMenu/UserMenu.d.ts +66 -41
- package/_dist/components/navigation/UserMenu/user-menu-sample-content.d.ts +2 -0
- package/_dist/components/progress-indicators/ProgressBar/ProgressBar.d.ts +50 -32
- package/_dist/components/progress-indicators/ProgressRing/ProgressRing.d.ts +38 -22
- package/_dist/css/component-css/pds-avatar.css +1 -1
- package/_dist/css/component-css/pds-index.css +2 -2
- package/_dist/css/component-css/pds-user-menu.css +1 -1
- package/_dist/css/pds-components.css +2 -2
- package/_dist/css/pds-layouts.css +1 -1
- package/_dist/index.css +1 -1
- package/_dist/index.d.ts +3 -3
- package/_dist/index.js +1874 -2018
- package/_dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PDSIcon } from '@components/Icon/Icon';
|
|
3
3
|
import './segmented-button.css';
|
|
4
|
+
/**
|
|
5
|
+
* Structure for each option in the SegmentedButton component.
|
|
6
|
+
*/
|
|
7
|
+
interface OptionType {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
iconName?: PDSIcon;
|
|
11
|
+
tally?: {
|
|
12
|
+
label: string | number;
|
|
13
|
+
type: 'neutral' | 'critical' | 'warning' | 'info' | 'success';
|
|
14
|
+
};
|
|
15
|
+
}
|
|
4
16
|
/**
|
|
5
17
|
* Prop types for SegmentedButton
|
|
6
18
|
*/
|
|
@@ -29,11 +41,7 @@ export interface SegmentedButtonProps {
|
|
|
29
41
|
/**
|
|
30
42
|
* Array of button options — must be between 2 and 6 options.
|
|
31
43
|
*/
|
|
32
|
-
options:
|
|
33
|
-
value: string;
|
|
34
|
-
label: string;
|
|
35
|
-
iconName?: PDSIcon;
|
|
36
|
-
}[];
|
|
44
|
+
options: OptionType[];
|
|
37
45
|
/**
|
|
38
46
|
* Additional class names
|
|
39
47
|
*/
|
|
@@ -43,3 +51,4 @@ export interface SegmentedButtonProps {
|
|
|
43
51
|
* SegmentedButton UI component
|
|
44
52
|
*/
|
|
45
53
|
export declare const SegmentedButton: ({ disabled, id, initialSelection, label, onChange, options, className, ...props }: SegmentedButtonProps) => React.JSX.Element;
|
|
54
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import React, { ComponentPropsWithoutRef } from 'react';
|
|
|
2
2
|
import { NavigationItem } from '@components/navigation/navigation-types';
|
|
3
3
|
import { PDSIcon } from '@components/Icon/Icon';
|
|
4
4
|
import './dashboard-nav.css';
|
|
5
|
-
type DashboardNavItem = NavigationItem & {
|
|
5
|
+
export type DashboardNavItem = NavigationItem & {
|
|
6
6
|
/**
|
|
7
7
|
* Icon to display next to the link content.
|
|
8
8
|
*/
|
|
@@ -40,4 +40,3 @@ export interface DashboardNavProps extends ComponentPropsWithoutRef<'nav'> {
|
|
|
40
40
|
* DashboardNav UI component
|
|
41
41
|
*/
|
|
42
42
|
export declare const DashboardNav: ({ ariaLabel, labels, menuItems, mobileMenuSelectTextFallback, className, ...props }: DashboardNavProps) => React.JSX.Element;
|
|
43
|
-
export {};
|
|
@@ -1,44 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { PDSIcon } from '@components/Icon/Icon';
|
|
3
|
+
import './user-menu.css';
|
|
4
|
+
/**
|
|
5
|
+
* Prop types for UserMenuItem
|
|
6
|
+
*/
|
|
7
|
+
export type UserMenuItem = {
|
|
8
|
+
/**
|
|
9
|
+
* Use if the menu item should perform an action. This should be a function to be called when the menu item is clicked. Do not use if `linkContent` is provided.
|
|
10
|
+
*/
|
|
11
|
+
callback?: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Is the menu item disabled?
|
|
14
|
+
*/
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Icon name for the menu item.
|
|
18
|
+
*/
|
|
19
|
+
iconName?: PDSIcon;
|
|
20
|
+
/**
|
|
21
|
+
* Unique ID for the menu item. Optional.
|
|
22
|
+
*/
|
|
23
|
+
id?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The text to be displayed as the menu item label if a `callback` is provided.
|
|
26
|
+
*/
|
|
27
|
+
label?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Use if the menu item should navigate to another location. This should be a fully-formed link using the router of your choice. Should be used in place of `callback` and `label`.
|
|
30
|
+
*/
|
|
31
|
+
linkContent?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Prop types for UserMenu
|
|
35
|
+
*/
|
|
36
|
+
export interface UserMenuProps extends ComponentPropsWithoutRef<'span'> {
|
|
37
|
+
/**
|
|
38
|
+
* Aria label for the user menu.
|
|
39
|
+
*/
|
|
3
40
|
ariaLabel?: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Array of menu items.
|
|
43
|
+
*/
|
|
44
|
+
menuItems?: UserMenuItem[];
|
|
45
|
+
/**
|
|
46
|
+
* User email address.
|
|
47
|
+
*/
|
|
48
|
+
userEmail?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Image source for the user avatar.
|
|
51
|
+
*/
|
|
52
|
+
userImageSrc?: string;
|
|
53
|
+
/**
|
|
54
|
+
* User display name.
|
|
55
|
+
*/
|
|
56
|
+
userName?: string;
|
|
57
|
+
/**
|
|
58
|
+
* If true, the workspace selector will be styled and rendered to work with the mobile version of the navbar menu. Defaults to true.
|
|
59
|
+
*/
|
|
8
60
|
withinNavbar?: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let ariaLabel: PropTypes.Requireable<string>;
|
|
14
|
-
let menuItems: PropTypes.Requireable<PropTypes.InferProps<{
|
|
15
|
-
/**
|
|
16
|
-
* Callback function for the menu item.
|
|
17
|
-
*/
|
|
18
|
-
callback: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
-
/**
|
|
20
|
-
* Is the menu item disabled?
|
|
21
|
-
*/
|
|
22
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
23
|
-
/**
|
|
24
|
-
* Icon name for the menu item.
|
|
25
|
-
*/
|
|
26
|
-
iconName: PropTypes.Requireable<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Unique ID for the menu item. Optional.
|
|
29
|
-
*/
|
|
30
|
-
id: PropTypes.Requireable<string>;
|
|
31
|
-
/**
|
|
32
|
-
* Label for the menu item.
|
|
33
|
-
*/
|
|
34
|
-
label: PropTypes.Requireable<string>;
|
|
35
|
-
}>[]>;
|
|
36
|
-
let userEmail: PropTypes.Requireable<string>;
|
|
37
|
-
let userImageSrc: PropTypes.Requireable<string>;
|
|
38
|
-
let userName: PropTypes.Requireable<string>;
|
|
39
|
-
let withinNavbar: PropTypes.Requireable<boolean>;
|
|
40
|
-
let className: PropTypes.Requireable<string>;
|
|
41
|
-
}
|
|
61
|
+
/**
|
|
62
|
+
* Additional class names.
|
|
63
|
+
*/
|
|
64
|
+
className?: string;
|
|
42
65
|
}
|
|
43
|
-
|
|
44
|
-
|
|
66
|
+
/**
|
|
67
|
+
* UserMenu UI component
|
|
68
|
+
*/
|
|
69
|
+
export declare const UserMenu: ({ ariaLabel, menuItems, userEmail, userImageSrc, userName, withinNavbar, className, ...props }: UserMenuProps) => React.JSX.Element;
|
|
@@ -1,35 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import './progress-bar.css';
|
|
3
|
+
interface ProgressBarBreakpoint {
|
|
4
|
+
colorType: 'neutral' | 'info' | 'success' | 'warning' | 'critical';
|
|
5
|
+
percentage: number;
|
|
6
|
+
}
|
|
7
|
+
interface ProgressBarProps extends ComponentPropsWithoutRef<'div'> {
|
|
8
|
+
/**
|
|
9
|
+
* Array of color breakpoints. Each breakpoint should have a `colorType` and `percentage` value.
|
|
10
|
+
*/
|
|
11
|
+
colorBreakpoints: ProgressBarBreakpoint[];
|
|
12
|
+
/**
|
|
13
|
+
* ID of the Progress Bar. If not provided, a unique ID will be generated.
|
|
14
|
+
*/
|
|
15
|
+
id?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Progress Bar label. Will be available to screen readers if `showLabel` is false.
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* Message or description used to help clarify the usage of the progress bar.
|
|
22
|
+
*/
|
|
23
|
+
message?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Position of the message relative to the progress bar.
|
|
26
|
+
*/
|
|
27
|
+
messagePosition?: 'above' | 'below';
|
|
28
|
+
/**
|
|
29
|
+
* Percent complete.
|
|
30
|
+
*/
|
|
31
|
+
percentage: number;
|
|
32
|
+
/**
|
|
33
|
+
* Should the label be visible? If false, it will render for screen readers only.
|
|
34
|
+
*/
|
|
12
35
|
showLabel?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Should the percentage label be visible?
|
|
38
|
+
*/
|
|
13
39
|
showPercentage?: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}>[]>;
|
|
23
|
-
let id: PropTypes.Requireable<string>;
|
|
24
|
-
let label: PropTypes.Validator<string>;
|
|
25
|
-
let message: PropTypes.Requireable<string>;
|
|
26
|
-
let messagePosition: PropTypes.Requireable<string>;
|
|
27
|
-
let percentage: PropTypes.Validator<number>;
|
|
28
|
-
let showLabel: PropTypes.Requireable<boolean>;
|
|
29
|
-
let showPercentage: PropTypes.Requireable<boolean>;
|
|
30
|
-
let size: PropTypes.Requireable<string>;
|
|
31
|
-
let className: PropTypes.Requireable<string>;
|
|
32
|
-
}
|
|
40
|
+
/**
|
|
41
|
+
* Size of the progress bar.
|
|
42
|
+
*/
|
|
43
|
+
size?: 'sm' | 'md' | 'lg';
|
|
44
|
+
/**
|
|
45
|
+
* Additional class names
|
|
46
|
+
*/
|
|
47
|
+
className?: string;
|
|
33
48
|
}
|
|
34
|
-
|
|
35
|
-
|
|
49
|
+
/**
|
|
50
|
+
* ProgressBar UI component
|
|
51
|
+
*/
|
|
52
|
+
export declare const ProgressBar: ({ colorBreakpoints, id, label, message, messagePosition, percentage, showLabel, showPercentage, size, className, ...props }: ProgressBarProps) => React.JSX.Element;
|
|
53
|
+
export {};
|
|
@@ -1,25 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import './progress-ring.css';
|
|
3
|
+
interface ProgressRingProps extends ComponentPropsWithoutRef<'div'> {
|
|
4
|
+
/**
|
|
5
|
+
* ID of the Progress Ring. If not provided, a unique ID will be generated.
|
|
6
|
+
*/
|
|
7
|
+
id?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Inner label for the Progress Ring. May be used for showing a percentage or a count of steps.
|
|
10
|
+
*/
|
|
11
|
+
innerLabel?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Label for the Progress Ring. Will be available to screen readers if `showLabel` is false.
|
|
14
|
+
*/
|
|
15
|
+
label: string;
|
|
16
|
+
/**
|
|
17
|
+
* Percentage of progress.
|
|
18
|
+
*/
|
|
19
|
+
percentage: number;
|
|
20
|
+
/**
|
|
21
|
+
* Should the label be visible? If false, it will render for screen readers only.
|
|
22
|
+
*/
|
|
7
23
|
showLabel?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Should the percentage be visible? Will be overridden by `innerLabel` if one is provided.
|
|
26
|
+
*/
|
|
8
27
|
showPercentage?: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let percentage: PropTypes.Validator<number>;
|
|
18
|
-
let showLabel: PropTypes.Requireable<boolean>;
|
|
19
|
-
let showPercentage: PropTypes.Requireable<boolean>;
|
|
20
|
-
let size: PropTypes.Requireable<string>;
|
|
21
|
-
let className: PropTypes.Requireable<string>;
|
|
22
|
-
}
|
|
28
|
+
/**
|
|
29
|
+
* Size of the progress ring.
|
|
30
|
+
*/
|
|
31
|
+
size?: 'sm' | 'md' | 'lg';
|
|
32
|
+
/**
|
|
33
|
+
* Additional class names
|
|
34
|
+
*/
|
|
35
|
+
className?: string;
|
|
23
36
|
}
|
|
24
|
-
|
|
25
|
-
|
|
37
|
+
/**
|
|
38
|
+
* ProgressRing UI component
|
|
39
|
+
*/
|
|
40
|
+
export declare const ProgressRing: ({ id, innerLabel, label, percentage, showLabel, showPercentage, size, className, ...props }: ProgressRingProps) => React.JSX.Element;
|
|
41
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.pds-avatar{
|
|
1
|
+
.pds-avatar{--pds-avatar-size:1.953rem;align-items:center;border:.0625rem solid transparent;border-radius:100%;display:inline-flex;justify-content:center}.pds-avatar__content{border-radius:100%;display:flex;height:var(--pds-avatar-size);width:var(--pds-avatar-size)}.pds-avatar__content--link:hover{cursor:pointer;outline:1px solid var(--pds-color-interactive-link-hover);outline-offset:.09375rem}.pds-avatar__content--link:focus-visible{outline:1px solid var(--pds-color-interactive-focus);outline-offset:.09375rem}.pds-avatar--image{border-color:var(--pds-color-border-default)}.pds-avatar--image img{border-radius:100%;height:100%;width:auto}.pds-avatar--xs{--pds-avatar-size:1rem}.pds-avatar--sm{--pds-avatar-size:1.563rem}.pds-avatar--md{--pds-avatar-size:1.953rem}.pds-avatar--lg{--pds-avatar-size:2.441rem}
|