@pantheon-systems/pds-toolkit-react 1.0.0-dev.196 → 1.0.0-dev.197

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.
@@ -0,0 +1,35 @@
1
+ import React, { ComponentPropsWithoutRef } from 'react';
2
+ import './file-diff.css';
3
+ /**
4
+ * Prop types for FileDiff
5
+ */
6
+ export interface FileDiffProps extends ComponentPropsWithoutRef<'div'> {
7
+ /**
8
+ * Number of added lines (green bar).
9
+ */
10
+ additions: number;
11
+ /**
12
+ * Number of removed lines (red bar).
13
+ */
14
+ deletions: number;
15
+ /**
16
+ * Object with strings for tooltips and screen reader labels.
17
+ */
18
+ labelStrings?: {
19
+ linesChanged?: string;
20
+ additions?: string;
21
+ deletions?: string;
22
+ };
23
+ /**
24
+ * Custom width in rems for the component. This will override the default.
25
+ */
26
+ componentWidth?: number;
27
+ /**
28
+ * Additional class names
29
+ */
30
+ className?: string;
31
+ }
32
+ /**
33
+ * FileDiff UI component
34
+ */
35
+ export declare const FileDiff: ({ additions, deletions, labelStrings, className, componentWidth, ...props }: FileDiffProps) => React.JSX.Element;
@@ -0,0 +1,46 @@
1
+ import React, { ComponentPropsWithoutRef } from 'react';
2
+ import './refresh-checker.css';
3
+ /**
4
+ * Enum for RefreshChecker states
5
+ */
6
+ export declare enum RefreshCheckerState {
7
+ DEFAULT = "default",
8
+ WORKING = "working",
9
+ CHECKED = "checked"
10
+ }
11
+ /**
12
+ * Prop types for RefreshChecker
13
+ */
14
+ interface RefreshCheckerProps extends ComponentPropsWithoutRef<'div'> {
15
+ /**
16
+ * Custom width in rems for the component. This will override the default.
17
+ */
18
+ componentWidth?: number;
19
+ /**
20
+ * Internationalization props for labels
21
+ */
22
+ labelStrings?: {
23
+ checkForUpdates?: string;
24
+ checking?: string;
25
+ checked?: string;
26
+ tooltipContent?: string;
27
+ ariaLabel?: string;
28
+ };
29
+ /**
30
+ * Last checked timestamp
31
+ */
32
+ lastChecked?: Date;
33
+ /**
34
+ * Callback function when check is triggered
35
+ */
36
+ onCheck?: () => Promise<void>;
37
+ /**
38
+ * Additional class names
39
+ */
40
+ className?: string;
41
+ }
42
+ /**
43
+ * RefreshChecker UI component
44
+ */
45
+ export declare const RefreshChecker: ({ componentWidth, labelStrings, lastChecked, onCheck, className, ...props }: RefreshCheckerProps) => React.JSX.Element;
46
+ export {};
@@ -15,7 +15,7 @@ export interface IndicatorBadgeProps extends ComponentPropsWithoutRef<'span'> {
15
15
  /**
16
16
  * Badge size
17
17
  */
18
- size: 'sm' | 'md';
18
+ size?: 'sm' | 'md';
19
19
  /**
20
20
  * Additional class names
21
21
  */
@@ -37,7 +37,7 @@ interface IconButtonProps extends ComponentPropsWithoutRef<'button'> {
37
37
  /**
38
38
  * Which variant of button to render.
39
39
  */
40
- variant?: 'standard' | 'critical';
40
+ variant?: 'standard' | 'critical' | 'critical-hover';
41
41
  /**
42
42
  * Additional class names.
43
43
  */
@@ -1,19 +1,43 @@
1
- export function NavMenu({ ariaLabel, colorType, menuItems, mobileMenuMaxWidth, className, ...props }: {
2
- [x: string]: any;
3
- ariaLabel?: string;
4
- colorType?: string;
5
- menuItems: any;
1
+ import React, { ComponentPropsWithoutRef } from 'react';
2
+ import './nav-menu.css';
3
+ /**
4
+ * Prop types for MenuItem
5
+ */
6
+ export interface MenuItem {
7
+ id?: string;
8
+ label: string;
9
+ links?: MenuItem[];
10
+ linkContent?: React.ReactNode;
11
+ isActive?: boolean;
12
+ isSeparator?: boolean;
13
+ }
14
+ /**
15
+ * Prop types for NavMenu
16
+ */
17
+ interface NavMenuProps extends ComponentPropsWithoutRef<'nav'> {
18
+ /**
19
+ * Aria label for `nav` element.
20
+ */
21
+ ariaLabel: string;
22
+ /**
23
+ * Color scheme.
24
+ */
25
+ colorType?: 'default' | 'reverse';
26
+ /**
27
+ * Menu Items.
28
+ */
29
+ menuItems?: MenuItem[];
30
+ /**
31
+ * Mobile menu will be enabled when viewport is at or below this number in pixels.
32
+ */
6
33
  mobileMenuMaxWidth?: number;
7
- className: any;
8
- }): React.JSX.Element;
9
- export namespace NavMenu {
10
- namespace propTypes {
11
- let ariaLabel: PropTypes.Validator<string>;
12
- let colorType: PropTypes.Requireable<string>;
13
- let menuItems: PropTypes.Requireable<any[]>;
14
- let mobileMenuMaxWidth: PropTypes.Requireable<number>;
15
- let className: PropTypes.Requireable<string>;
16
- }
34
+ /**
35
+ * Additional class names
36
+ */
37
+ className?: string;
17
38
  }
18
- import React from 'react';
19
- import PropTypes from 'prop-types';
39
+ /**
40
+ * NavMenu UI component
41
+ */
42
+ export declare const NavMenu: ({ ariaLabel, colorType, menuItems, mobileMenuMaxWidth, className, ...props }: NavMenuProps) => React.JSX.Element;
43
+ export {};
@@ -1,14 +1,24 @@
1
- export function NavMenuDropdown({ items, label, mobileMenuMaxWidth }: {
2
- items: any;
3
- label: any;
1
+ import React, { ComponentPropsWithoutRef } from 'react';
2
+ import { MenuItem } from './NavMenu';
3
+ /**
4
+ * Prop types for NavMenuDropdown
5
+ */
6
+ interface NavMenuDropdownProps extends ComponentPropsWithoutRef<'button'> {
7
+ /**
8
+ * Dropdown items.
9
+ */
10
+ items?: MenuItem[];
11
+ /**
12
+ * Dropdown label.
13
+ */
14
+ label?: string;
15
+ /**
16
+ * Mobile menu will be enabled when viewport is at or below this number in pixels.
17
+ */
4
18
  mobileMenuMaxWidth?: number;
5
- }): React.JSX.Element;
6
- export namespace NavMenuDropdown {
7
- namespace propTypes {
8
- let items: PropTypes.Requireable<any[]>;
9
- let label: PropTypes.Requireable<string>;
10
- let mobileMenuMaxWidth: PropTypes.Requireable<number>;
11
- }
12
19
  }
13
- import React from 'react';
14
- import PropTypes from 'prop-types';
20
+ /**
21
+ * NavMenuDropdown UI component
22
+ */
23
+ export declare const NavMenuDropdown: ({ items, label, mobileMenuMaxWidth, }: NavMenuDropdownProps) => React.JSX.Element;
24
+ export {};
@@ -78,4 +78,4 @@ a.pds-button,button.pds-button{--pds-button-color-background:var(
78
78
  --pds-color-button-navbar-foreground-hover
79
79
  )}a.pds-button.pds-button--navbar:active,button.pds-button.pds-button--navbar:active:enabled{--pds-button-color-background:transparent;--pds-button-color-border:transparent;--pds-button-color-foreground:var(
80
80
  --pds-color-button-navbar-foreground-active
81
- )}button.pds-button.pds-button--inline{background-color:transparent;border:none;border-radius:0;color:var(--pds-color-interactive-link-default);font-size:inherit;font-weight:400;height:unset;justify-content:unset;max-height:unset;padding:0;text-decoration:underline;transition:all .2s ease-in-out 0s}button.pds-button.pds-button--inline .pds-button__loading-indicator{--pds-spinner-color-1:#23232d;--pds-spinner-color-2:#6d6d78;--pds-spinner-color-3:#cfcfd3}button.pds-button.pds-button--inline:hover:enabled{color:var(--pds-color-interactive-link-hover);text-decoration:none}button.pds-button.pds-button--inline:focus-visible{outline:.0625rem solid var(--pds-color-interactive-focus);outline-offset:.125rem;text-decoration:none}.pds-button-group,.pds-button-group--lg{display:flex;flex-direction:column;row-gap:1rem;width:100%}.pds-button-group a.pds-button.pds-button--subtle,.pds-button-group button.pds-button.pds-button--subtle,.pds-button-group--lg a.pds-button.pds-button--subtle,.pds-button-group--lg button.pds-button.pds-button--subtle{margin-block:-.512rem}@media (min-width:641px){.pds-button-group a.pds-button.pds-button--subtle,.pds-button-group button.pds-button.pds-button--subtle,.pds-button-group--lg a.pds-button.pds-button--subtle,.pds-button-group--lg button.pds-button.pds-button--subtle{margin-block:unset;margin-inline:-.25rem}.pds-button-group{column-gap:1.25rem;flex-direction:row;width:unset}.pds-button-group--lg{column-gap:1.563rem}}
81
+ )}button.pds-button.pds-button--inline{background-color:transparent;border:none;border-radius:0;color:var(--pds-color-interactive-link-default);font-size:inherit;font-weight:400;height:unset;justify-content:unset;letter-spacing:0;max-height:unset;padding:0;transition:all .2s ease-in-out 0s}button.pds-button.pds-button--inline .pds-button__loading-indicator{--pds-spinner-color-1:#23232d;--pds-spinner-color-2:#6d6d78;--pds-spinner-color-3:#cfcfd3}button.pds-button.pds-button--inline:hover:enabled{color:var(--pds-color-interactive-link-hover);text-decoration:underline}button.pds-button.pds-button--inline:focus-visible{outline:.0625rem solid var(--pds-color-interactive-focus);outline-offset:.125rem;text-decoration:none}.pds-button-group,.pds-button-group--lg{display:flex;flex-direction:column;row-gap:1rem;width:100%}.pds-button-group a.pds-button.pds-button--subtle,.pds-button-group button.pds-button.pds-button--subtle,.pds-button-group--lg a.pds-button.pds-button--subtle,.pds-button-group--lg button.pds-button.pds-button--subtle{margin-block:-.512rem}@media (min-width:641px){.pds-button-group a.pds-button.pds-button--subtle,.pds-button-group button.pds-button.pds-button--subtle,.pds-button-group--lg a.pds-button.pds-button--subtle,.pds-button-group--lg button.pds-button.pds-button--subtle{margin-block:unset;margin-inline:-.25rem}.pds-button-group{column-gap:1.25rem;flex-direction:row;width:unset}.pds-button-group--lg{column-gap:1.563rem}}
@@ -0,0 +1 @@
1
+ .pds-file-diff{align-items:center;display:flex;gap:.25rem;height:1.0625rem;max-width:100%;width:100%}.pds-file-diff .pds-file-diff__total-changes{color:var(--pds-color-text-default-secondary);font-size:.694rem}.pds-file-diff .pds-file-diff__bars{align-items:center;display:flex;gap:.125rem;width:100%}.pds-file-diff .pds-file-diff__behind{position:relative}.pds-file-diff .pds-file-diff__behind .pds-file-diff__behind-bar{background-color:var(--pds-color-semantic-critical-foreground);border-bottom-left-radius:6.25rem;border-top-left-radius:6.25rem;height:8px;min-width:1px;right:0;transition:width .3s ease;width:100%}.pds-file-diff .pds-file-diff__ahead{position:relative}.pds-file-diff .pds-file-diff__ahead .pds-file-diff__ahead-bar{background-color:var(--pds-color-semantic-success-utility);border-bottom-right-radius:6.25rem;border-top-right-radius:6.25rem;height:8px;left:0;min-width:1px;transition:width .3s ease;width:100%}.pds-file-diff .pds-file-diff__tooltip{display:block;padding-inline:0}
@@ -14,4 +14,12 @@ button.pds-icon-button{--pds-button-size:2.25rem;--pds-button-color-foreground:v
14
14
  --pds-color-icon-button-critical-background-active
15
15
  );--pds-button-color-foreground:var(
16
16
  --pds-color-icon-button-critical-foreground-default
17
+ )}button.pds-icon-button--critical-hover{--pds-button-color-background:var(
18
+ --pds-color-icon-button-standard-background-default
19
+ );--pds-button-color-background-hover:var(
20
+ --pds-color-icon-button-critical-background-hover
21
+ );--pds-button-color-background-active:var(
22
+ --pds-color-icon-button-critical-background-active
23
+ )}button.pds-icon-button--critical-hover:hover{--pds-button-color-foreground:var(
24
+ --pds-color-icon-button-critical-foreground-default
17
25
  )}button.pds-icon-button--sm{--pds-button-size:2rem}button.pds-icon-button--lg{--pds-button-size:3rem}.pds-icon-button__tooltip .pds-tooltip__container{padding:.328rem .512rem}.pds-icon-button__icon-wrapper{align-items:center;display:flex;justify-content:center;position:absolute}.pds-icon-button--fadeOut{-webkit-animation:scale-down-center .4s cubic-bezier(.25,.46,.45,.94) both;animation:scale-down-center .4s cubic-bezier(.25,.46,.45,.94) both;opacity:0;transition:.2s ease-in}.pds-icon-button--hide{display:none}.pds-icon-button--scaleIn{-webkit-animation:scale-in-center .2s cubic-bezier(.175,.885,.32,1.275) both;animation:scale-in-center .2s cubic-bezier(.175,.885,.32,1.275) both}@keyframes scale-in-center{0%{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}