@pantheon-systems/pds-toolkit-react 1.0.0-dev.213 → 1.0.0-dev.214
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/CodeBlock/CodeBlock.d.ts +56 -0
- package/_dist/components/CodeBlock/code-examples.d.ts +5 -0
- package/_dist/components/CodeBlock/themes/index.d.ts +2 -0
- package/_dist/components/CodeBlock/themes/pdsDark.d.ts +2 -0
- package/_dist/components/CodeBlock/themes/pdsLight.d.ts +2 -0
- package/_dist/components/buttons/ClipboardButton/ClipboardButton.d.ts +31 -0
- package/_dist/components/buttons/IconButton/IconButton.d.ts +1 -1
- package/_dist/css/component-css/pds-clipboard-button.css +0 -0
- package/_dist/css/component-css/pds-code-block.css +1 -0
- package/_dist/css/component-css/pds-dropdown-menu.css +1 -1
- package/_dist/css/component-css/pds-icon-button.css +13 -7
- package/_dist/css/component-css/pds-index.css +19 -15
- package/_dist/css/component-css/pds-nav-menu.css +2 -4
- package/_dist/css/component-css/pds-select.css +1 -1
- package/_dist/css/component-css/pds-side-nav-compact.css +1 -1
- package/_dist/css/component-css/pds-side-nav.css +1 -1
- package/_dist/css/component-css/pds-tab-menu.css +2 -2
- package/_dist/css/component-css/pds-workspace-selector.css +1 -1
- package/_dist/css/design-tokens/pds-design-tokens-dark-mode.css +17 -2
- package/_dist/css/design-tokens/pds-design-tokens-light-mode.css +15 -2
- package/_dist/css/design-tokens/pds-design-tokens.css +1 -0
- package/_dist/css/pds-components.css +19 -15
- package/_dist/css/pds-core.css +2 -2
- package/_dist/index.css +1 -1
- package/_dist/index.d.ts +3 -0
- package/_dist/index.js +4941 -3708
- package/_dist/index.js.map +1 -1
- package/_dist/utilities/hooks/useClipboard.d.ts +6 -0
- package/package.json +6 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import 'prismjs/components/prism-bash';
|
|
3
|
+
import 'prismjs/components/prism-diff';
|
|
4
|
+
import './code-block.css';
|
|
5
|
+
type SupportedLanguages = 'bash' | 'css' | 'diff' | 'html' | 'js' | 'json' | 'jsx' | 'ts' | 'tsx' | 'yaml';
|
|
6
|
+
/**
|
|
7
|
+
* Prop types for CodeBlock
|
|
8
|
+
*/
|
|
9
|
+
export interface CodeBlockProps extends ComponentPropsWithoutRef<'div'> {
|
|
10
|
+
/**
|
|
11
|
+
* Code to display.
|
|
12
|
+
*/
|
|
13
|
+
code: string;
|
|
14
|
+
/**
|
|
15
|
+
* Color type. Default is dark.
|
|
16
|
+
*/
|
|
17
|
+
colorType?: 'dark' | 'light';
|
|
18
|
+
/**
|
|
19
|
+
* Copy button label. Aria-label and tooltip text for the copy button.
|
|
20
|
+
*/
|
|
21
|
+
copyButtonLabel?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Show copy button.
|
|
24
|
+
*/
|
|
25
|
+
hasCopyButton?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Show line numbers.
|
|
28
|
+
*/
|
|
29
|
+
hasLineNumbers?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Show prompt. A prompt and and line numbers cannot be shown at the same time.
|
|
32
|
+
* If both are set to true, line numbers will be shown.
|
|
33
|
+
*/
|
|
34
|
+
hasPrompt?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Language for optional syntax highlighting.
|
|
37
|
+
*/
|
|
38
|
+
language?: SupportedLanguages;
|
|
39
|
+
/**
|
|
40
|
+
* Maximum height for the code block in `rem`.
|
|
41
|
+
*/
|
|
42
|
+
maxHeight?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Prompt symbol. Default is '$'.
|
|
45
|
+
*/
|
|
46
|
+
promptSymbol?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Additional class names
|
|
49
|
+
*/
|
|
50
|
+
className?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* CodeBlock UI component
|
|
54
|
+
*/
|
|
55
|
+
export declare const CodeBlock: ({ code, colorType, copyButtonLabel, hasCopyButton, hasLineNumbers, hasPrompt, language, maxHeight, promptSymbol, className, ...props }: CodeBlockProps) => React.JSX.Element;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const logExample = "Already have image (with digest): us-docker.pkg.dev/prod-decoupled-shared/build-tools/pantheon-build:v1.0.8-node20\nThe framework expected according to the configuration is: gatsby.\nThe framework detected from the code is: vite\nERROR: Invalid option: false\ndeprecated-tools [options]\nUsage:\n deprecated-tools -t node --min-version 18 [--max-version 20] --message-format \"Node version should be between %s and %s\" --message-data \"18 20\"\n deprecated-tools -f .nvmrc --message-format \"The file %s is deprecated\" --message-data \".nvmrc\"\n\n -t, --tool <tool> Check if a tool is deprecated\n --min-version <ver> Minimum version supported for the tool\n --max-version <ver> Max version supported for the tool\n --message-format <format> Format of the deprecation message\n --message-data <data> Array of data to use in the deprecation message\n -f, --file <file> Check if a file is deprecated\n --message-format <format> Format of the deprecation message\n --message-data <data> Array of data to use in the deprecation message\n -h, --help Display this help message\nnpm WARN deprecated rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported\nnpm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported\n\n> @pantheon-systems/pds-toolkit-react@1.0.0-dev.213 prepare\n> husky install\n\nhusky - Git hooks installed";
|
|
2
|
+
export declare const reactExample = "export const ControlledExample = () => {\n const defaultValue = 'This is a default value';\n const [value, setValue] = useState(defaultValue);\n\n // This is a comment for this component.\n return (\n <TextInput\n id='text-input-controlled-example'\n label='Controlled Input example'\n type='text'\n hasClearButton={true}\n onClear={() => {\n setValue('');\n }}\n onChange={(event: ChangeEvent<HTMLInputElement>) => setValue(event.target.value)}\n value={value}\n />\n );\n};";
|
|
3
|
+
export declare const cssExample = "@design-tokens url('node_modules://@pantheon-systems/pds-design-tokens/build/json/pds-design-tokens.json') format('style-dictionary3');\n\n.pds-file-diff {\n align-items: center;\n display: flex;\n gap: 0.25rem;\n height: 1.0625rem;\n max-width: 100%;\n width: 100%;\n\n .pds-file-diff__total-changes {\n color: var(--pds-color-foreground-default-secondary);\n font-size: token('typography.size.XS' to rem);\n }\n\n .pds-file-diff__bars {\n align-items: center;\n display: flex;\n gap: 0.125rem;\n width: 100%;\n }\n\n .pds-file-diff__behind {\n position: relative;\n\n .pds-file-diff__behind-bar {\n background-color: var(--pds-color-status-critical-utility);\n border-bottom-left-radius: 6.25rem;\n border-top-left-radius: 6.25rem;\n height: 8px;\n min-width: 1px;\n right: 0px;\n transition: width 0.3s ease;\n width: 100%;\n }\n }\n\n .pds-file-diff__ahead {\n position: relative;\n\n .pds-file-diff__ahead-bar {\n background-color: var(--pds-color-status-success-utility);\n border-bottom-right-radius: 6.25rem;\n border-top-right-radius: 6.25rem;\n height: 8px;\n left: 0px;\n min-width: 1px;\n transition: width 0.3s ease;\n width: 100%;\n }\n }\n\n .pds-file-diff__tooltip {\n display: block;\n padding-inline: 0;\n }\n}\n";
|
|
4
|
+
export declare const diffExample = "diff --git a/influitive/index.css b/influitive/index.css\nindex 2069af6..b347ca3 100644\n--- a/influitive/index.css\n+++ b/influitive/index.css\n@@ -1,4 +1,4 @@\n #nav-container ul li.c-nav-list-item a.c-nav-item {\n font-weight: 500 !important;\n- font-family: 'Poppins', san-serif !important;\n+ font-family: 'Poppins', sans-serif !important;\n }";
|
|
5
|
+
export declare const twigExample = "<div class=\"pds-status-badge pds-status-badge--{{ color|default('transparent')}}{% if extra_classes %} {{ extra_classes }}{% endif %}\">\n\n {% if has_status_indicator %}\n <span class=\"pds-status-badge__status pds-status-badge__status--{{ status_type }}\">\n {% if status_type %}\n <span class=\"visually-hidden\">Status: {{ status_type }}</span>\n {% endif %}\n </span>\n {% endif %}\n\n <span class=\"pds-status-badge__label\">{{ label }}</span>\n</div>";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import './clipboard-button.css';
|
|
3
|
+
/**
|
|
4
|
+
* Prop types for ClipboardButton
|
|
5
|
+
*/
|
|
6
|
+
export interface ClipboardButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
7
|
+
/**
|
|
8
|
+
* Translation string for aria-label attribute and tooltip text.
|
|
9
|
+
*/
|
|
10
|
+
ariaLabel: string;
|
|
11
|
+
/**
|
|
12
|
+
* Text to copy to clipboard.
|
|
13
|
+
*/
|
|
14
|
+
clipboardText?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Is the button disabled?
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Which variant of button to render.
|
|
21
|
+
*/
|
|
22
|
+
variant?: 'standard' | 'reverse';
|
|
23
|
+
/**
|
|
24
|
+
* Additional class names
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* ClipboardButton UI component
|
|
30
|
+
*/
|
|
31
|
+
export declare const ClipboardButton: ({ ariaLabel, clipboardText, disabled, variant, className, ...props }: ClipboardButtonProps) => React.JSX.Element;
|
|
@@ -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' | 'critical-hover';
|
|
40
|
+
variant?: 'standard' | 'reverse' | 'critical' | 'critical-hover';
|
|
41
41
|
/**
|
|
42
42
|
* Additional class names.
|
|
43
43
|
*/
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pds-code-block{--code-block-padding:1.25rem;--code-block-background:var(--pds-color-code-block-dark-background);--code-block-foreground:var(--pds-color-code-block-dark-foreground);--code-block-line-prefix:var(--pds-color-code-block-dark-line-prefix);--code-block-focus-color:var(--pds-color-interactive-reverse-focus);background-color:var(--code-block-background);border-radius:.375rem;display:flex;font-family:var(--pds-typography-font-code);font-size:.9rem;font-weight:400;justify-content:space-between;line-height:165%}.pds-code-block__code{flex-grow:1;margin:0;overflow:auto;padding:1.25rem}.pds-code-block__code:focus-visible{border-radius:.375rem;outline:2px solid var(--code-block-focus-color)}.pds-code-block__code .token.plain{color:var(--code-block-foreground)}.pds-code-block__line{column-gap:.64rem;display:table-row}.pds-code-block__number,.pds-code-block__prompt{color:var(--code-block-line-prefix);display:table-cell;padding-inline-end:1rem;text-align:right}.pds-code-block__copy{padding:.8rem}.pds-code-block--dark{--code-block-background:var(--pds-color-code-block-dark-background);--code-block-foreground:var(--pds-color-code-block-dark-foreground);--code-block-line-prefix:var(--pds-color-code-block-dark-line-prefix);--code-block-focus-color:var(--pds-color-interactive-reverse-focus)}.pds-code-block--light{--code-block-background:var(--pds-color-code-block-light-background);--code-block-foreground:var(--pds-color-code-block-light-foreground);--code-block-line-prefix:var(--pds-color-code-block-light-line-prefix);--code-block-focus-color:var(--pds-color-interactive-focus)}.pds-code-block--light button.pds-clipboard-button{color:var(--pds-color-code-block-light-foreground)}.pds-code-block--light button.pds-clipboard-button:hover{background-color:var(--pds-color-code-block-light-highlight)}.pds-code-block--light button.pds-clipboard-button:active{background-color:#d0d2d5}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.pds-dropdown-menu{position:relative}.pds-dropdown-menu__heading{font-size:1rem;font-weight:600;margin-block-end:.64rem}.pds-dropdown-menu__heading a{color:var(--pds-color-foreground-default);text-decoration:none}.pds-dropdown-menu__heading a:hover{color:var(--pds-color-interactive-link-hover)}.pds-dropdown-menu__trigger{align-items:center;background-color:var(--pds-color-background-default);border:1px solid var(--pds-color-border-input);border-radius:.1875rem;color:var(--pds-color-foreground-default);cursor:pointer;display:flex;height:var(--pds-spacing-input-height);justify-content:space-between;padding:0 .64rem;text-align:left;width:100%}.pds-dropdown-menu__trigger:focus-visible{outline:1px solid var(--pds-color-interactive-focus)}.pds-dropdown-menu__trigger-icon{color:var(--pds-color-nav-
|
|
1
|
+
.pds-dropdown-menu{position:relative}.pds-dropdown-menu__heading{font-size:1rem;font-weight:600;margin-block-end:.64rem}.pds-dropdown-menu__heading a{color:var(--pds-color-foreground-default);text-decoration:none}.pds-dropdown-menu__heading a:hover{color:var(--pds-color-interactive-link-hover)}.pds-dropdown-menu__trigger{align-items:center;background-color:var(--pds-color-background-default);border:1px solid var(--pds-color-border-input);border-radius:.1875rem;color:var(--pds-color-foreground-default);cursor:pointer;display:flex;height:var(--pds-spacing-input-height);justify-content:space-between;padding:0 .64rem;text-align:left;width:100%}.pds-dropdown-menu__trigger:focus-visible{outline:1px solid var(--pds-color-interactive-focus)}.pds-dropdown-menu__trigger-icon{color:var(--pds-color-nav-item-default-foreground-trigger);transition:transform .2s ease-in-out 0s}.pds-dropdown-menu__trigger[aria-expanded=true]
|
|
2
2
|
.pds-dropdown-menu__trigger-icon{transform:rotate(180deg);transition:transform .2s ease-in-out 0s}.pds-dropdown-menu__dropdown{background-color:var(--pds-color-dropdown-background);border-radius:.1875rem;box-shadow:var(--pds-elevation-overlay);list-style-type:none;margin-block-start:.64rem;max-height:30rem;overflow-y:scroll;padding:0;position:absolute;width:100%;z-index:200}.pds-dropdown-menu__dropdown a{color:var(--pds-color-dropdown-foreground);display:flex;padding:.64rem 1rem;text-decoration:none}.pds-dropdown-menu__dropdown:focus{outline:none}.pds-dropdown-menu__item:focus,.pds-dropdown-menu__item:hover{background-color:var(--pds-color-dropdown-item-background-hover);outline:none}.pds-dropdown-menu__item:focus a:active,.pds-dropdown-menu__item:hover a:active{background-color:var(--pds-color-dropdown-item-background-active)}.pds-dropdown-menu__item--second-level a{padding-inline-start:2.441rem}.pds-dropdown-menu__item--third-level a{padding-inline-start:4.004rem}.pds-dropdown-menu__item--fourth-level a{padding-inline-start:5.567rem}.pds-dropdown-menu__active-label{display:flex;padding-inline-start:.25rem}.pds-dropdown-menu__item--active{align-items:center;background-color:var(--pds-color-dropdown-item-background-selected);color:var(--pds-color-foreground-default);display:flex;justify-content:space-between}.pds-dropdown-menu__active-icon{flex-shrink:0;margin-inline:1rem}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
button.pds-icon-button{--
|
|
2
|
-
--pds-color-
|
|
3
|
-
);--
|
|
4
|
-
--pds-color-
|
|
5
|
-
);background-color:transparent;border:none;border-radius:.1875rem;color:var(--
|
|
6
|
-
--pds-color-
|
|
7
|
-
);--
|
|
1
|
+
button.pds-icon-button{--icon-button-size:2.25rem;--icon-button-foreground:var(--pds-color-foreground-default);--icon-button-background-hover:var(
|
|
2
|
+
--pds-color-icon-button-standard-background-hover
|
|
3
|
+
);--icon-button-background-active:var(
|
|
4
|
+
--pds-color-icon-button-standard-background-active
|
|
5
|
+
);background-color:transparent;border:none;border-radius:.1875rem;color:var(--icon-button-foreground);height:var(--icon-button-size);padding:0;width:var(--icon-button-size)}.pds-icon-button__content,button.pds-icon-button{align-items:center;display:flex;justify-content:center}.pds-icon-button__content{align-content:stretch;height:100%}.pds-icon-button:disabled .pds-icon-button__content{cursor:not-allowed;opacity:45%}button.pds-icon-button:hover:enabled{background-color:var(--icon-button-background-hover)}button.pds-icon-button:active:enabled{background-color:var(--icon-button-background-active)}button.pds-icon-button:focus-visible{outline:1px solid var(--pds-color-interactive-focus)}button.pds-icon-button--reverse{--icon-button-foreground:var(--pds-color-foreground-reverse);--icon-button-background-hover:var(
|
|
6
|
+
--pds-color-icon-button-reverse-background-hover
|
|
7
|
+
);--icon-button-background-active:var(
|
|
8
|
+
--pds-color-icon-button-reverse-background-active
|
|
9
|
+
)}button.pds-icon-button--reverse:focus-visible{outline-color:var(--pds-color-interactive-reverse-focus)}button.pds-icon-button--critical{--icon-button-foreground:var(--pds-color-status-critical-foreground)}button.pds-icon-button--critical,button.pds-icon-button--critical-hover{--icon-button-background-hover:var(
|
|
10
|
+
--pds-color-icon-button-critical-background-hover
|
|
11
|
+
);--icon-button-background-active:var(
|
|
12
|
+
--pds-color-icon-button-critical-background-active
|
|
13
|
+
)}button.pds-icon-button--critical-hover:active,button.pds-icon-button--critical-hover:hover{--icon-button-foreground:var(--pds-color-status-critical-foreground)}button.pds-icon-button--sm{--icon-button-size:2rem}button.pds-icon-button--lg{--icon-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)}}
|