@redocly/theme 0.57.0-next.2 → 0.57.0-next.3
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/lib/components/CodeBlock/CodeBlockControls.js +6 -5
- package/lib/components/Tooltip/TooltipWrapper.d.ts +2 -2
- package/lib/components/Tooltip/TooltipWrapper.js +2 -4
- package/lib/icons/PlayIcon/PlayIcon.d.ts +9 -0
- package/lib/icons/PlayIcon/PlayIcon.js +21 -0
- package/lib/icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon.d.ts +9 -0
- package/lib/icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon.js +23 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/layouts/ThreePanelLayout.js +1 -4
- package/package.json +3 -3
- package/src/components/CodeBlock/CodeBlockControls.tsx +18 -5
- package/src/components/Tooltip/TooltipWrapper.tsx +4 -6
- package/src/icons/PlayIcon/PlayIcon.tsx +22 -0
- package/src/icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon.tsx +32 -0
- package/src/index.ts +2 -0
- package/src/layouts/ThreePanelLayout.tsx +1 -4
|
@@ -20,7 +20,8 @@ const CodeBlockDropdown_1 = require("../../components/CodeBlock/CodeBlockDropdow
|
|
|
20
20
|
function CodeBlockControls({ children, className, title, controls, tabs, dropdown, }) {
|
|
21
21
|
var _a, _b, _c, _d, _e;
|
|
22
22
|
const { codeSnippet } = (0, hooks_1.useThemeConfig)();
|
|
23
|
-
const { useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
23
|
+
const { useTelemetry, useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
24
|
+
const { translate } = useTranslate();
|
|
24
25
|
const telemetry = useTelemetry();
|
|
25
26
|
const controlsType = (codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.elementFormat) || 'icon';
|
|
26
27
|
const { copy, expand, collapse, select, deselect, report } = controls || {
|
|
@@ -37,15 +38,15 @@ function CodeBlockControls({ children, className, title, controls, tabs, dropdow
|
|
|
37
38
|
tabs && react_1.default.createElement(CodeBlockTabs_1.CodeBlockTabs, { tabs: tabs }),
|
|
38
39
|
react_1.default.createElement(ControlsWrapper, null,
|
|
39
40
|
dropdown && react_1.default.createElement(CodeBlockDropdown_1.CodeBlockDropdown, Object.assign({}, dropdown)),
|
|
40
|
-
report && !((_a = report === null || report === void 0 ? void 0 : report.props) === null || _a === void 0 ? void 0 : _a.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, {
|
|
41
|
+
report && !((_a = report === null || report === void 0 ? void 0 : report.props) === null || _a === void 0 ? void 0 : _a.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, { tip: translate('codeSnippet.report.tooltipText', 'Report a problem'), placement: "top" },
|
|
41
42
|
react_1.default.createElement(ControlButton, Object.assign({ variant: "text", size: "small", "data-testid": "report-button", icon: controlsType === 'icon' ? react_1.default.createElement(WarningSquareIcon_1.WarningSquareIcon, { size: "18px" }) : undefined }, report.props), controlsType != 'icon' && (((_b = report.props) === null || _b === void 0 ? void 0 : _b.buttonText) || 'Report')))) : null,
|
|
42
|
-
expand && !((_c = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.expand) === null || _c === void 0 ? void 0 : _c.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, {
|
|
43
|
+
expand && !((_c = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.expand) === null || _c === void 0 ? void 0 : _c.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, { tip: translate('codeSnippet.expand.tooltipText', 'Expand all'), placement: "top" },
|
|
43
44
|
react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "expand-all", icon: controlsType === 'icon' ? react_1.default.createElement(MaximizeIcon_1.MaximizeIcon, null) : undefined, onClick: expand === null || expand === void 0 ? void 0 : expand.onClick }, controlsType !== 'icon' && ((expand === null || expand === void 0 ? void 0 : expand.label) || 'Expand all')))) : null,
|
|
44
|
-
collapse && !((_d = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.collapse) === null || _d === void 0 ? void 0 : _d.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, {
|
|
45
|
+
collapse && !((_d = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.collapse) === null || _d === void 0 ? void 0 : _d.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, { tip: translate('codeSnippet.collapse.tooltipText', 'Collapse all'), placement: "top" },
|
|
45
46
|
react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "collapse-all", icon: controlsType === 'icon' ? react_1.default.createElement(MinimizeIcon_1.MinimizeIcon, null) : undefined, onClick: collapse === null || collapse === void 0 ? void 0 : collapse.onClick }, controlsType !== 'icon' && ((expand === null || expand === void 0 ? void 0 : expand.label) || 'Collapse all')))) : null,
|
|
46
47
|
select ? (react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "select-all", icon: controlsType === 'icon' ? react_1.default.createElement(SelectIcon_1.SelectIcon, null) : undefined, onClick: select === null || select === void 0 ? void 0 : select.onClick }, controlsType !== 'icon' && (select === null || select === void 0 ? void 0 : select.label) ? select.label : 'Select all')) : null,
|
|
47
48
|
deselect ? (react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "clear-all", icon: controlsType === 'icon' ? react_1.default.createElement(DeselectIcon_1.DeselectIcon, null) : undefined, onClick: deselect === null || deselect === void 0 ? void 0 : deselect.onClick }, controlsType !== 'icon' && (deselect === null || deselect === void 0 ? void 0 : deselect.label) ? deselect.label : 'Clear all')) : null,
|
|
48
|
-
copy && !((_e = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.copy) === null || _e === void 0 ? void 0 : _e.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, {
|
|
49
|
+
copy && !((_e = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.copy) === null || _e === void 0 ? void 0 : _e.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, { tip: translate('codeSnippet.copy.tooltipText', 'Copy to clipboard'), placement: "top" },
|
|
49
50
|
react_1.default.createElement(StyledCopyButton, { data: copy.data, "data-source": copy.dataSource, "data-hash": copy.dataHash, type: controlsType, toasterPlacement: copy.toasterPlacement, toasterDuration: copy.toasterDuration, buttonText: copy.label, onCopyClick: () => {
|
|
50
51
|
var _a;
|
|
51
52
|
// If there already is a click handler, events should be handled there, cause they pass additional data
|
|
@@ -2,11 +2,11 @@ import type { JSX, ReactElement } from 'react';
|
|
|
2
2
|
import type { TooltipProps } from '../../components/Tooltip/Tooltip';
|
|
3
3
|
export type TooltipWrapperProps = {
|
|
4
4
|
children: ReactElement;
|
|
5
|
-
|
|
5
|
+
tip: string;
|
|
6
6
|
placement?: TooltipProps['placement'];
|
|
7
7
|
width?: string;
|
|
8
8
|
className?: string;
|
|
9
9
|
showOnHover?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare function TooltipWrapper({ children,
|
|
12
|
+
export declare function TooltipWrapper({ children, tip, placement, width, className, showOnHover, disabled, }: TooltipWrapperProps): JSX.Element;
|
|
@@ -8,10 +8,8 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const hooks_1 = require("../../core/hooks");
|
|
10
10
|
const Tooltip_1 = require("../../components/Tooltip/Tooltip");
|
|
11
|
-
function TooltipWrapper({ children,
|
|
12
|
-
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
11
|
+
function TooltipWrapper({ children, tip, placement = 'top', width = 'max-content', className = '', showOnHover = true, disabled = false, }) {
|
|
13
12
|
const tooltip = (0, hooks_1.useControl)();
|
|
14
|
-
const { translate } = useTranslate();
|
|
15
13
|
const handleMouseEnter = () => {
|
|
16
14
|
if (showOnHover && !disabled) {
|
|
17
15
|
tooltip.handleOpen();
|
|
@@ -27,7 +25,7 @@ function TooltipWrapper({ children, tooltipTranslationKey, placement = 'top', wi
|
|
|
27
25
|
tooltip.handleClose();
|
|
28
26
|
}
|
|
29
27
|
};
|
|
30
|
-
return (react_1.default.createElement(Tooltip_1.Tooltip, { className: className, tip:
|
|
28
|
+
return (react_1.default.createElement(Tooltip_1.Tooltip, { className: className, tip: tip, isOpen: tooltip.isOpened, placement: placement, width: width },
|
|
31
29
|
react_1.default.createElement(TooltipEventWrapper, { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onClick: handleClick }, children)));
|
|
32
30
|
}
|
|
33
31
|
const TooltipEventWrapper = styled_components_1.default.div `
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const PlayIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
|
|
4
|
+
'data-component-name': string;
|
|
5
|
+
} & {
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
} & React.SVGProps<SVGSVGElement>, "data-component-name">;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PlayIcon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const utils_1 = require("../../core/utils");
|
|
10
|
+
const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
11
|
+
react_1.default.createElement("path", { d: "M3.0625 12.25C2.94647 12.25 2.83519 12.2039 2.75314 12.1219C2.67109 12.0398 2.625 11.9286 2.625 11.8125V2.18753C2.62499 2.1115 2.6448 2.03678 2.68247 1.97074C2.72014 1.9047 2.77437 1.84961 2.83981 1.81092C2.90526 1.77222 2.97965 1.75124 3.05567 1.75005C3.13169 1.74887 3.20671 1.76751 3.27333 1.80415L12.0233 6.61665C12.092 6.6544 12.1492 6.70989 12.1891 6.77733C12.229 6.84476 12.25 6.92167 12.25 7.00001C12.25 7.07835 12.229 7.15526 12.1891 7.22269C12.1492 7.29013 12.092 7.34562 12.0233 7.38337L3.27333 12.1959C3.20874 12.2314 3.13622 12.25 3.0625 12.25ZM3.5 2.9273V11.0726L10.9046 7.00003L3.5 2.9273Z" })));
|
|
12
|
+
exports.PlayIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
13
|
+
'data-component-name': 'icons/PlayIcon/PlayIcon',
|
|
14
|
+
})) `
|
|
15
|
+
path {
|
|
16
|
+
fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
17
|
+
}
|
|
18
|
+
height: ${({ size }) => size || '16px'};
|
|
19
|
+
width: ${({ size }) => size || '16px'};
|
|
20
|
+
`;
|
|
21
|
+
//# sourceMappingURL=PlayIcon.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const WorkflowHierarchyIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
|
|
4
|
+
'data-component-name': string;
|
|
5
|
+
} & {
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
} & React.SVGProps<SVGSVGElement>, "data-component-name">;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WorkflowHierarchyIcon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const utils_1 = require("../../core/utils");
|
|
10
|
+
const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
11
|
+
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.5 6.5H13.5C13.7651 6.4997 14.0193 6.39424 14.2068 6.20677C14.3942 6.0193 14.4997 5.76512 14.5 5.5V2.5C14.4997 2.23488 14.3942 1.9807 14.2068 1.79323C14.0193 1.60576 13.7651 1.5003 13.5 1.5H2.5C2.23488 1.5003 1.9807 1.60576 1.79323 1.79323C1.60576 1.9807 1.5003 2.23488 1.5 2.5V5.5C1.5003 5.76512 1.60576 6.0193 1.79323 6.20677C1.9807 6.39424 2.23488 6.4997 2.5 6.5H3.5H4.5ZM13.5 2.5H2.5V5.5H13.5V2.5Z" }),
|
|
12
|
+
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.5 9.5H8.5C8.23488 9.5003 7.9807 9.60576 7.79323 9.79323C7.60576 9.9807 7.5003 10.2349 7.5 10.5V11.5H4.5V9.29295V8.5V6.5H3.5V9.29295V11.5C3.5003 11.7651 3.60576 12.0193 3.79323 12.2068C3.9807 12.3942 4.23488 12.4997 4.5 12.5H7.5V13.5C7.5003 13.7651 7.60576 14.0193 7.79323 14.2068C7.9807 14.3942 8.23488 14.4997 8.5 14.5H13.5C13.7651 14.4997 14.0193 14.3942 14.2068 14.2068C14.3942 14.0193 14.4997 13.7651 14.5 13.5V10.5C14.4997 10.2349 14.3942 9.9807 14.2068 9.79323C14.0193 9.60576 13.7651 9.5003 13.5 9.5ZM8.5 10.5V13.5H13.5V10.5H8.5Z" })));
|
|
13
|
+
exports.WorkflowHierarchyIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
14
|
+
'data-component-name': 'icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon',
|
|
15
|
+
})) `
|
|
16
|
+
path {
|
|
17
|
+
fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
height: ${({ size }) => size || '16px'};
|
|
21
|
+
width: ${({ size }) => size || '16px'};
|
|
22
|
+
`;
|
|
23
|
+
//# sourceMappingURL=WorkflowHierarchyIcon.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -238,6 +238,7 @@ export * from './icons/CharacterIcon/CharacterIcon';
|
|
|
238
238
|
export * from './icons/FileIcon/FileIcon';
|
|
239
239
|
export * from './icons/ExportIcon/ExportIcon';
|
|
240
240
|
export * from './icons/CertificateIcon/CertificateIcon';
|
|
241
|
+
export * from './icons/PlayIcon/PlayIcon';
|
|
241
242
|
export * from './icons/PlaylistIcon/PlaylistIcon';
|
|
242
243
|
export * from './icons/WorkflowAutomationIcon/WorkflowAutomationIcon';
|
|
243
244
|
export * from './icons/TaskViewIcon/TaskViewIcon';
|
|
@@ -254,6 +255,7 @@ export * from './icons/RabbitMQIcon/RabbitMQIcon';
|
|
|
254
255
|
export * from './icons/CurveAutoColonIcon/CurveAutoColonIcon';
|
|
255
256
|
export * from './icons/AiStarsIcon/AiStarsIcon';
|
|
256
257
|
export * from './icons/AiStarsGradientIcon/AiStarsGradientIcon';
|
|
258
|
+
export * from './icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon';
|
|
257
259
|
export * from './icons/GenericIcon/GenericIcon';
|
|
258
260
|
export * from './layouts/RootLayout';
|
|
259
261
|
export * from './layouts/PageLayout';
|
package/lib/index.js
CHANGED
|
@@ -291,6 +291,7 @@ __exportStar(require("./icons/CharacterIcon/CharacterIcon"), exports);
|
|
|
291
291
|
__exportStar(require("./icons/FileIcon/FileIcon"), exports);
|
|
292
292
|
__exportStar(require("./icons/ExportIcon/ExportIcon"), exports);
|
|
293
293
|
__exportStar(require("./icons/CertificateIcon/CertificateIcon"), exports);
|
|
294
|
+
__exportStar(require("./icons/PlayIcon/PlayIcon"), exports);
|
|
294
295
|
__exportStar(require("./icons/PlaylistIcon/PlaylistIcon"), exports);
|
|
295
296
|
__exportStar(require("./icons/WorkflowAutomationIcon/WorkflowAutomationIcon"), exports);
|
|
296
297
|
__exportStar(require("./icons/TaskViewIcon/TaskViewIcon"), exports);
|
|
@@ -307,6 +308,7 @@ __exportStar(require("./icons/RabbitMQIcon/RabbitMQIcon"), exports);
|
|
|
307
308
|
__exportStar(require("./icons/CurveAutoColonIcon/CurveAutoColonIcon"), exports);
|
|
308
309
|
__exportStar(require("./icons/AiStarsIcon/AiStarsIcon"), exports);
|
|
309
310
|
__exportStar(require("./icons/AiStarsGradientIcon/AiStarsGradientIcon"), exports);
|
|
311
|
+
__exportStar(require("./icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon"), exports);
|
|
310
312
|
__exportStar(require("./icons/GenericIcon/GenericIcon"), exports);
|
|
311
313
|
/* Layouts */
|
|
312
314
|
__exportStar(require("./layouts/RootLayout"), exports);
|
|
@@ -54,14 +54,11 @@ const Wrapper = styled_components_1.default.div `
|
|
|
54
54
|
margin: 0 auto;
|
|
55
55
|
width: 100%;
|
|
56
56
|
|
|
57
|
-
${({ layout = config_1.LayoutVariant.THREE_PANEL
|
|
57
|
+
${({ layout = config_1.LayoutVariant.THREE_PANEL }) => {
|
|
58
58
|
return (0, styled_components_1.css) `
|
|
59
59
|
max-width: ${layout === config_1.LayoutVariant.THREE_PANEL ? '100%' : ''};
|
|
60
60
|
|
|
61
61
|
@media screen and (min-width: ${media_css_1.breakpoints.small}) {
|
|
62
|
-
width: ${collapsedSidebar
|
|
63
|
-
? `var(--layout-${layout}-small-max-width)`
|
|
64
|
-
: 'calc(100% - var(--sidebar-width))'};
|
|
65
62
|
max-width: var(--layout-${layout}-small-max-width);
|
|
66
63
|
}
|
|
67
64
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.57.0-next.
|
|
3
|
+
"version": "0.57.0-next.3",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"nprogress": "0.2.0",
|
|
87
87
|
"react-calendar": "5.1.0",
|
|
88
88
|
"react-date-picker": "11.0.0",
|
|
89
|
-
"@redocly/
|
|
90
|
-
"@redocly/
|
|
89
|
+
"@redocly/realm-asyncapi-sdk": "0.3.0-next.0",
|
|
90
|
+
"@redocly/config": "0.28.0"
|
|
91
91
|
},
|
|
92
92
|
"scripts": {
|
|
93
93
|
"watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
@@ -66,7 +66,8 @@ export function CodeBlockControls({
|
|
|
66
66
|
dropdown,
|
|
67
67
|
}: CodeBlockControlsProps): JSX.Element | null {
|
|
68
68
|
const { codeSnippet } = useThemeConfig();
|
|
69
|
-
const { useTelemetry } = useThemeHooks();
|
|
69
|
+
const { useTelemetry, useTranslate } = useThemeHooks();
|
|
70
|
+
const { translate } = useTranslate();
|
|
70
71
|
const telemetry = useTelemetry();
|
|
71
72
|
const controlsType = (codeSnippet?.elementFormat as ControlItemType) || 'icon';
|
|
72
73
|
const { copy, expand, collapse, select, deselect, report } = controls || {
|
|
@@ -87,7 +88,10 @@ export function CodeBlockControls({
|
|
|
87
88
|
<ControlsWrapper>
|
|
88
89
|
{dropdown && <CodeBlockDropdown {...dropdown} />}
|
|
89
90
|
{report && !report?.props?.hide ? (
|
|
90
|
-
<TooltipWrapper
|
|
91
|
+
<TooltipWrapper
|
|
92
|
+
tip={translate('codeSnippet.report.tooltipText', 'Report a problem')}
|
|
93
|
+
placement="top"
|
|
94
|
+
>
|
|
91
95
|
<ControlButton
|
|
92
96
|
variant="text"
|
|
93
97
|
size="small"
|
|
@@ -101,7 +105,10 @@ export function CodeBlockControls({
|
|
|
101
105
|
) : null}
|
|
102
106
|
|
|
103
107
|
{expand && !codeSnippet?.expand?.hide ? (
|
|
104
|
-
<TooltipWrapper
|
|
108
|
+
<TooltipWrapper
|
|
109
|
+
tip={translate('codeSnippet.expand.tooltipText', 'Expand all')}
|
|
110
|
+
placement="top"
|
|
111
|
+
>
|
|
105
112
|
<ControlButton
|
|
106
113
|
variant="text"
|
|
107
114
|
size="small"
|
|
@@ -115,7 +122,10 @@ export function CodeBlockControls({
|
|
|
115
122
|
) : null}
|
|
116
123
|
|
|
117
124
|
{collapse && !codeSnippet?.collapse?.hide ? (
|
|
118
|
-
<TooltipWrapper
|
|
125
|
+
<TooltipWrapper
|
|
126
|
+
tip={translate('codeSnippet.collapse.tooltipText', 'Collapse all')}
|
|
127
|
+
placement="top"
|
|
128
|
+
>
|
|
119
129
|
<ControlButton
|
|
120
130
|
variant="text"
|
|
121
131
|
size="small"
|
|
@@ -153,7 +163,10 @@ export function CodeBlockControls({
|
|
|
153
163
|
) : null}
|
|
154
164
|
|
|
155
165
|
{copy && !codeSnippet?.copy?.hide ? (
|
|
156
|
-
<TooltipWrapper
|
|
166
|
+
<TooltipWrapper
|
|
167
|
+
tip={translate('codeSnippet.copy.tooltipText', 'Copy to clipboard')}
|
|
168
|
+
placement="top"
|
|
169
|
+
>
|
|
157
170
|
<StyledCopyButton
|
|
158
171
|
data={copy.data}
|
|
159
172
|
data-source={copy.dataSource}
|
|
@@ -4,12 +4,12 @@ import React from 'react';
|
|
|
4
4
|
import type { JSX, ReactElement } from 'react';
|
|
5
5
|
import type { TooltipProps } from '@redocly/theme/components/Tooltip/Tooltip';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useControl } from '@redocly/theme/core/hooks';
|
|
8
8
|
import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
|
|
9
9
|
|
|
10
10
|
export type TooltipWrapperProps = {
|
|
11
11
|
children: ReactElement;
|
|
12
|
-
|
|
12
|
+
tip: string;
|
|
13
13
|
placement?: TooltipProps['placement'];
|
|
14
14
|
width?: string;
|
|
15
15
|
className?: string;
|
|
@@ -19,16 +19,14 @@ export type TooltipWrapperProps = {
|
|
|
19
19
|
|
|
20
20
|
export function TooltipWrapper({
|
|
21
21
|
children,
|
|
22
|
-
|
|
22
|
+
tip,
|
|
23
23
|
placement = 'top',
|
|
24
24
|
width = 'max-content',
|
|
25
25
|
className = '',
|
|
26
26
|
showOnHover = true,
|
|
27
27
|
disabled = false,
|
|
28
28
|
}: TooltipWrapperProps): JSX.Element {
|
|
29
|
-
const { useTranslate } = useThemeHooks();
|
|
30
29
|
const tooltip = useControl();
|
|
31
|
-
const { translate } = useTranslate();
|
|
32
30
|
|
|
33
31
|
const handleMouseEnter = (): void => {
|
|
34
32
|
if (showOnHover && !disabled) {
|
|
@@ -51,7 +49,7 @@ export function TooltipWrapper({
|
|
|
51
49
|
return (
|
|
52
50
|
<Tooltip
|
|
53
51
|
className={className}
|
|
54
|
-
tip={
|
|
52
|
+
tip={tip}
|
|
55
53
|
isOpen={tooltip.isOpened}
|
|
56
54
|
placement={placement}
|
|
57
55
|
width={width}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path d="M3.0625 12.25C2.94647 12.25 2.83519 12.2039 2.75314 12.1219C2.67109 12.0398 2.625 11.9286 2.625 11.8125V2.18753C2.62499 2.1115 2.6448 2.03678 2.68247 1.97074C2.72014 1.9047 2.77437 1.84961 2.83981 1.81092C2.90526 1.77222 2.97965 1.75124 3.05567 1.75005C3.13169 1.74887 3.20671 1.76751 3.27333 1.80415L12.0233 6.61665C12.092 6.6544 12.1492 6.70989 12.1891 6.77733C12.229 6.84476 12.25 6.92167 12.25 7.00001C12.25 7.07835 12.229 7.15526 12.1891 7.22269C12.1492 7.29013 12.092 7.34562 12.0233 7.38337L3.27333 12.1959C3.20874 12.2314 3.13622 12.25 3.0625 12.25ZM3.5 2.9273V11.0726L10.9046 7.00003L3.5 2.9273Z" />
|
|
11
|
+
</svg>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const PlayIcon = styled(Icon).attrs(() => ({
|
|
15
|
+
'data-component-name': 'icons/PlayIcon/PlayIcon',
|
|
16
|
+
}))<IconProps>`
|
|
17
|
+
path {
|
|
18
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
19
|
+
}
|
|
20
|
+
height: ${({ size }) => size || '16px'};
|
|
21
|
+
width: ${({ size }) => size || '16px'};
|
|
22
|
+
`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
fillRule="evenodd"
|
|
12
|
+
clipRule="evenodd"
|
|
13
|
+
d="M4.5 6.5H13.5C13.7651 6.4997 14.0193 6.39424 14.2068 6.20677C14.3942 6.0193 14.4997 5.76512 14.5 5.5V2.5C14.4997 2.23488 14.3942 1.9807 14.2068 1.79323C14.0193 1.60576 13.7651 1.5003 13.5 1.5H2.5C2.23488 1.5003 1.9807 1.60576 1.79323 1.79323C1.60576 1.9807 1.5003 2.23488 1.5 2.5V5.5C1.5003 5.76512 1.60576 6.0193 1.79323 6.20677C1.9807 6.39424 2.23488 6.4997 2.5 6.5H3.5H4.5ZM13.5 2.5H2.5V5.5H13.5V2.5Z"
|
|
14
|
+
/>
|
|
15
|
+
<path
|
|
16
|
+
fillRule="evenodd"
|
|
17
|
+
clipRule="evenodd"
|
|
18
|
+
d="M13.5 9.5H8.5C8.23488 9.5003 7.9807 9.60576 7.79323 9.79323C7.60576 9.9807 7.5003 10.2349 7.5 10.5V11.5H4.5V9.29295V8.5V6.5H3.5V9.29295V11.5C3.5003 11.7651 3.60576 12.0193 3.79323 12.2068C3.9807 12.3942 4.23488 12.4997 4.5 12.5H7.5V13.5C7.5003 13.7651 7.60576 14.0193 7.79323 14.2068C7.9807 14.3942 8.23488 14.4997 8.5 14.5H13.5C13.7651 14.4997 14.0193 14.3942 14.2068 14.2068C14.3942 14.0193 14.4997 13.7651 14.5 13.5V10.5C14.4997 10.2349 14.3942 9.9807 14.2068 9.79323C14.0193 9.60576 13.7651 9.5003 13.5 9.5ZM8.5 10.5V13.5H13.5V10.5H8.5Z"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const WorkflowHierarchyIcon = styled(Icon).attrs(() => ({
|
|
24
|
+
'data-component-name': 'icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon',
|
|
25
|
+
}))<IconProps>`
|
|
26
|
+
path {
|
|
27
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
height: ${({ size }) => size || '16px'};
|
|
31
|
+
width: ${({ size }) => size || '16px'};
|
|
32
|
+
`;
|
package/src/index.ts
CHANGED
|
@@ -264,6 +264,7 @@ export * from '@redocly/theme/icons/CharacterIcon/CharacterIcon';
|
|
|
264
264
|
export * from '@redocly/theme/icons/FileIcon/FileIcon';
|
|
265
265
|
export * from '@redocly/theme/icons/ExportIcon/ExportIcon';
|
|
266
266
|
export * from '@redocly/theme/icons/CertificateIcon/CertificateIcon';
|
|
267
|
+
export * from '@redocly/theme/icons/PlayIcon/PlayIcon';
|
|
267
268
|
export * from '@redocly/theme/icons/PlaylistIcon/PlaylistIcon';
|
|
268
269
|
export * from '@redocly/theme/icons/WorkflowAutomationIcon/WorkflowAutomationIcon';
|
|
269
270
|
export * from '@redocly/theme/icons/TaskViewIcon/TaskViewIcon';
|
|
@@ -280,6 +281,7 @@ export * from '@redocly/theme/icons/RabbitMQIcon/RabbitMQIcon';
|
|
|
280
281
|
export * from '@redocly/theme/icons/CurveAutoColonIcon/CurveAutoColonIcon';
|
|
281
282
|
export * from '@redocly/theme/icons/AiStarsIcon/AiStarsIcon';
|
|
282
283
|
export * from '@redocly/theme/icons/AiStarsGradientIcon/AiStarsGradientIcon';
|
|
284
|
+
export * from '@redocly/theme/icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon';
|
|
283
285
|
export * from '@redocly/theme/icons/GenericIcon/GenericIcon';
|
|
284
286
|
/* Layouts */
|
|
285
287
|
export * from '@redocly/theme/layouts/RootLayout';
|
|
@@ -30,14 +30,11 @@ const Wrapper = styled.div<{ collapsedSidebar?: boolean; layout?: LayoutVariant
|
|
|
30
30
|
margin: 0 auto;
|
|
31
31
|
width: 100%;
|
|
32
32
|
|
|
33
|
-
${({ layout = LayoutVariant.THREE_PANEL
|
|
33
|
+
${({ layout = LayoutVariant.THREE_PANEL }) => {
|
|
34
34
|
return css`
|
|
35
35
|
max-width: ${layout === LayoutVariant.THREE_PANEL ? '100%' : ''};
|
|
36
36
|
|
|
37
37
|
@media screen and (min-width: ${breakpoints.small}) {
|
|
38
|
-
width: ${collapsedSidebar
|
|
39
|
-
? `var(--layout-${layout}-small-max-width)`
|
|
40
|
-
: 'calc(100% - var(--sidebar-width))'};
|
|
41
38
|
max-width: var(--layout-${layout}-small-max-width);
|
|
42
39
|
}
|
|
43
40
|
|