@redocly/theme 0.69.0-next.5 → 0.69.0-next.7
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/Accordion/variables.js +1 -1
- package/lib/components/Admonition/variables.js +1 -1
- package/lib/components/Banner/variables.dark.js +2 -0
- package/lib/components/Banner/variables.js +3 -1
- package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
- package/lib/components/Breadcrumbs/variables.js +1 -1
- package/lib/components/Button/ButtonGroup.d.ts +3 -5
- package/lib/components/Button/ButtonGroup.js +25 -5
- package/lib/components/Button/variables.js +27 -4
- package/lib/components/Buttons/ConnectMCPButton.js +15 -128
- package/lib/components/Buttons/CopyButton.js +12 -1
- package/lib/components/Buttons/variables.d.ts +0 -1
- package/lib/components/Buttons/variables.js +3 -44
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.js +1 -0
- package/lib/components/Catalog/variables.js +5 -5
- package/lib/components/CatalogClassic/variables.js +2 -2
- package/lib/components/CodeBlock/CodeBlock.js +2 -1
- package/lib/components/CodeBlock/CodeBlockContainer.js +1 -0
- package/lib/components/Dropdown/Dropdown.d.ts +10 -20
- package/lib/components/Dropdown/Dropdown.js +13 -2
- package/lib/components/Dropdown/DropdownMenuItemContent.d.ts +9 -0
- package/lib/components/Dropdown/DropdownMenuItemContent.js +56 -0
- package/lib/components/Dropdown/variables.js +19 -2
- package/lib/components/Feedback/Mood.js +18 -14
- package/lib/components/Feedback/Rating.js +18 -13
- package/lib/components/Feedback/Scale.js +27 -22
- package/lib/components/Feedback/Sentiment.js +17 -13
- package/lib/components/Filter/FilterSelect.js +1 -0
- package/lib/components/Filter/variables.js +2 -2
- package/lib/components/Image/variables.js +5 -3
- package/lib/components/LanguagePicker/variables.js +1 -1
- package/lib/components/Markdown/variables.js +1 -1
- package/lib/components/Menu/variables.js +1 -1
- package/lib/components/Navbar/variables.js +1 -1
- package/lib/components/PageActions/PageActions.js +4 -6
- package/lib/components/PageActions/PageActionsMenuItem.d.ts +4 -4
- package/lib/components/PageActions/PageActionsMenuItem.js +27 -43
- package/lib/components/Panel/variables.js +1 -1
- package/lib/components/Product/variables.js +2 -1
- package/lib/components/ReplayGate/ReplayGate.d.ts +1 -0
- package/lib/components/Search/SearchAiDialog.js +1 -1
- package/lib/components/Search/SearchAiMessage.js +1 -1
- package/lib/components/Search/SearchAiNegativeFeedbackForm.js +2 -2
- package/lib/components/Search/SearchDialog.js +2 -2
- package/lib/components/Search/SearchItem.js +1 -0
- package/lib/components/Search/SearchRecent.js +1 -0
- package/lib/components/Search/SearchSuggestedPages.js +1 -0
- package/lib/components/Search/variables.js +8 -5
- package/lib/components/Segmented/Segmented.js +3 -3
- package/lib/components/Select/Select.js +20 -18
- package/lib/components/Select/variables.js +3 -3
- package/lib/components/SplitButton/SplitButton.d.ts +21 -0
- package/lib/components/SplitButton/SplitButton.js +37 -0
- package/lib/components/Switch/variables.dark.js +2 -2
- package/lib/components/Switch/variables.js +2 -2
- package/lib/components/Tag/variables.js +2 -2
- package/lib/components/Tags/variables.js +1 -1
- package/lib/components/Toast/variables.js +1 -1
- package/lib/components/Tooltip/AnchorTooltip.js +2 -2
- package/lib/components/Tooltip/JsTooltip.js +2 -2
- package/lib/components/UserMenu/variables.js +1 -1
- package/lib/core/constants/mcp.d.ts +2 -0
- package/lib/core/constants/mcp.js +3 -1
- package/lib/core/constants/search.js +2 -2
- package/lib/core/hooks/use-control.js +3 -0
- package/lib/core/hooks/use-mcp-config.d.ts +2 -0
- package/lib/core/hooks/use-mcp-config.js +14 -4
- package/lib/core/styles/global.js +11 -11
- package/lib/core/styles/palette.js +2 -0
- package/lib/core/types/button-group.d.ts +2 -0
- package/lib/core/types/button-group.js +3 -0
- package/lib/core/types/catalog.d.ts +2 -6
- package/lib/core/types/common.d.ts +2 -0
- package/lib/core/types/hooks.d.ts +1 -0
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/utils/RenderWithLink.d.ts +2 -0
- package/lib/core/utils/RenderWithLink.js +20 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/icons/LinkIcon/LinkIcon.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/layouts/McpNotAllowed.js +5 -7
- package/lib/markdoc/components/Cards/variables.js +6 -4
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +1 -1
- package/lib/markdoc/components/CodeWalkthrough/variables.js +2 -1
- package/lib/markdoc/components/Tabs/TabList.js +6 -2
- package/lib/markdoc/components/Tabs/Tabs.js +4 -2
- package/lib/markdoc/components/Tabs/variables.js +4 -4
- package/package.json +8 -8
- package/src/components/Accordion/variables.ts +1 -1
- package/src/components/Admonition/variables.ts +1 -1
- package/src/components/Banner/variables.dark.ts +2 -0
- package/src/components/Banner/variables.ts +3 -1
- package/src/components/Breadcrumbs/Breadcrumb.tsx +1 -1
- package/src/components/Breadcrumbs/variables.ts +1 -1
- package/src/components/Button/ButtonGroup.tsx +28 -10
- package/src/components/Button/variables.ts +27 -4
- package/src/components/Buttons/ConnectMCPButton.tsx +63 -150
- package/src/components/Buttons/CopyButton.tsx +14 -2
- package/src/components/Buttons/variables.ts +2 -44
- package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
- package/src/components/Catalog/CatalogFilter/CatalogFilterSelect.tsx +1 -0
- package/src/components/Catalog/variables.ts +5 -5
- package/src/components/CatalogClassic/variables.ts +2 -2
- package/src/components/CodeBlock/CodeBlock.tsx +2 -1
- package/src/components/CodeBlock/CodeBlockContainer.tsx +1 -0
- package/src/components/Dropdown/Dropdown.tsx +25 -4
- package/src/components/Dropdown/DropdownMenuItemContent.tsx +72 -0
- package/src/components/Dropdown/variables.ts +19 -2
- package/src/components/Feedback/Mood.tsx +22 -15
- package/src/components/Feedback/Rating.tsx +22 -14
- package/src/components/Feedback/Scale.tsx +40 -32
- package/src/components/Feedback/Sentiment.tsx +21 -14
- package/src/components/Filter/FilterSelect.tsx +1 -0
- package/src/components/Filter/variables.ts +2 -2
- package/src/components/Image/variables.ts +5 -3
- package/src/components/LanguagePicker/variables.ts +1 -1
- package/src/components/Markdown/variables.ts +1 -1
- package/src/components/Menu/variables.ts +1 -1
- package/src/components/Navbar/variables.ts +1 -1
- package/src/components/PageActions/PageActions.tsx +22 -23
- package/src/components/PageActions/PageActionsMenuItem.tsx +41 -55
- package/src/components/Panel/variables.ts +1 -1
- package/src/components/Product/variables.ts +2 -1
- package/src/components/ReplayGate/ReplayGate.tsx +3 -0
- package/src/components/Search/SearchAiDialog.tsx +1 -1
- package/src/components/Search/SearchAiMessage.tsx +1 -1
- package/src/components/Search/SearchAiNegativeFeedbackForm.tsx +2 -2
- package/src/components/Search/SearchDialog.tsx +2 -2
- package/src/components/Search/SearchItem.tsx +1 -0
- package/src/components/Search/SearchRecent.tsx +1 -0
- package/src/components/Search/SearchSuggestedPages.tsx +1 -0
- package/src/components/Search/variables.ts +8 -5
- package/src/components/Segmented/Segmented.tsx +6 -3
- package/src/components/Select/Select.tsx +24 -16
- package/src/components/Select/variables.ts +3 -3
- package/src/components/SplitButton/SplitButton.tsx +95 -0
- package/src/components/Switch/variables.dark.ts +2 -2
- package/src/components/Switch/variables.ts +2 -2
- package/src/components/Tag/variables.ts +2 -2
- package/src/components/Tags/variables.ts +1 -1
- package/src/components/Toast/variables.ts +1 -1
- package/src/components/Tooltip/AnchorTooltip.tsx +2 -2
- package/src/components/Tooltip/JsTooltip.tsx +2 -2
- package/src/components/UserMenu/variables.ts +1 -1
- package/src/core/constants/mcp.ts +4 -0
- package/src/core/constants/search.ts +2 -2
- package/src/core/hooks/use-control.ts +5 -1
- package/src/core/hooks/use-mcp-config.ts +15 -4
- package/src/core/openapi/index.ts +1 -1
- package/src/core/styles/global.ts +12 -12
- package/src/core/styles/palette.ts +2 -0
- package/src/core/types/button-group.ts +2 -0
- package/src/core/types/catalog.ts +2 -7
- package/src/core/types/common.ts +3 -0
- package/src/core/types/hooks.ts +1 -0
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +8 -1
- package/src/core/utils/RenderWithLink.tsx +19 -0
- package/src/core/utils/index.ts +1 -0
- package/src/icons/LinkIcon/LinkIcon.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/layouts/McpNotAllowed.tsx +33 -9
- package/src/markdoc/components/Cards/variables.ts +6 -4
- package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +1 -0
- package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/variables.ts +2 -1
- package/src/markdoc/components/Tabs/TabList.tsx +6 -2
- package/src/markdoc/components/Tabs/Tabs.tsx +4 -2
- package/src/markdoc/components/Tabs/variables.ts +4 -4
|
@@ -52,6 +52,9 @@ exports.Dropdown = (0, react_1.forwardRef)(({ children, className, active, trigg
|
|
|
52
52
|
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
53
53
|
};
|
|
54
54
|
const handleClose = () => {
|
|
55
|
+
if (!isOpen) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
55
58
|
setIsOpen(false);
|
|
56
59
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
57
60
|
};
|
|
@@ -109,9 +112,10 @@ exports.Dropdown = (0, react_1.forwardRef)(({ children, className, active, trigg
|
|
|
109
112
|
};
|
|
110
113
|
}, [portalled, isOpen, updateMenuPosition]);
|
|
111
114
|
(0, hooks_1.useOutsideClick)(portalled ? [wrapperRef, menuRef] : wrapperRef, handleClose);
|
|
115
|
+
const menuContent = typeof children === 'function' ? children({ close: handleClose, isOpen }) : children;
|
|
112
116
|
const triggerChild = react_1.default.Children.only(trigger);
|
|
113
|
-
const dropdownTrigger = (0, react_1.cloneElement)(triggerChild, Object.assign(Object.assign(Object.assign({ onClick: triggerEvent === 'click' ? handleToggle : undefined, icon: withArrow ? isOpen ? react_1.default.createElement(ChevronUpIcon_1.ChevronUpIcon, null) : react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, null) : undefined }, (withArrow ? { iconPosition: 'right' } : {})), triggerChild.props), { onKeyDown: triggerEvent === 'click' ? handleKeyDown : undefined }));
|
|
114
|
-
const menu = (react_1.default.createElement(ChildrenWrapper, { ref: menuRef, $placement: placement, $alignment: alignment, $isOpen: isOpen, $portalled: portalled, style: portalled ? menuStyle : undefined, onClick: closeOnClick ? handleChildClick : undefined },
|
|
117
|
+
const dropdownTrigger = (0, react_1.cloneElement)(triggerChild, Object.assign(Object.assign(Object.assign({ onClick: triggerEvent === 'click' ? handleToggle : undefined, 'aria-expanded': isOpen, icon: withArrow ? isOpen ? react_1.default.createElement(ChevronUpIcon_1.ChevronUpIcon, null) : react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, null) : undefined }, (withArrow ? { iconPosition: 'right' } : {})), triggerChild.props), { onKeyDown: triggerEvent === 'click' ? handleKeyDown : undefined }));
|
|
118
|
+
const menu = (react_1.default.createElement(ChildrenWrapper, { ref: menuRef, $placement: placement, $alignment: alignment, $isOpen: isOpen, $portalled: portalled, style: portalled ? menuStyle : undefined, onClick: closeOnClick ? handleChildClick : undefined }, menuContent));
|
|
115
119
|
const portalledMenu = isOpen && typeof document !== 'undefined' ? (0, react_dom_1.createPortal)(menu, document.body) : null;
|
|
116
120
|
return (react_1.default.createElement(DropdownWrapper, Object.assign({ "data-component-name": "Dropdown/Dropdown", "data-testid": "dropdown" }, dataAttributes, { className: className, ref: wrapperRef, onPointerEnter: triggerEvent === 'hover' ? handleOpen : undefined, onPointerLeave: triggerEvent === 'hover' ? handleClose : undefined, onClick: onClick }),
|
|
117
121
|
dropdownTrigger,
|
|
@@ -132,6 +136,13 @@ const DropdownWrapper = styled_components_1.default.div `
|
|
|
132
136
|
position: relative;
|
|
133
137
|
|
|
134
138
|
text-decoration: none;
|
|
139
|
+
|
|
140
|
+
/* The trigger keeps its hovered appearance while the menu is open. */
|
|
141
|
+
> .button[aria-expanded='true'] {
|
|
142
|
+
background-color: var(--button-bg-color-hover);
|
|
143
|
+
color: var(--button-color-hover);
|
|
144
|
+
border-color: var(--button-border-color-hover);
|
|
145
|
+
}
|
|
135
146
|
`;
|
|
136
147
|
const ChildrenWrapper = styled_components_1.default.div `
|
|
137
148
|
padding-top: var(--dropdown-menu-padding-top);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { JSX } from 'react';
|
|
3
|
+
export type DropdownMenuItemContentProps = {
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function DropdownMenuItemContent(props: DropdownMenuItemContentProps): JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
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.DropdownMenuItemContent = DropdownMenuItemContent;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
function DropdownMenuItemContent(props) {
|
|
10
|
+
const { title, icon, description, className } = props;
|
|
11
|
+
return (react_1.default.createElement(MenuItemContentWrapper, { "data-component-name": "Dropdown/DropdownMenuItemContent", className: className },
|
|
12
|
+
icon ? react_1.default.createElement(IconWrapper, null, icon) : null,
|
|
13
|
+
react_1.default.createElement(TextWrapper, null,
|
|
14
|
+
react_1.default.createElement(TitleWrapper, null, title),
|
|
15
|
+
description ? react_1.default.createElement(DescriptionWrapper, null, description) : null)));
|
|
16
|
+
}
|
|
17
|
+
const MenuItemContentWrapper = styled_components_1.default.div `
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: var(--dropdown-menu-item-content-gap);
|
|
22
|
+
padding: var(--dropdown-menu-item-content-padding);
|
|
23
|
+
`;
|
|
24
|
+
const IconWrapper = styled_components_1.default.div `
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
width: var(--dropdown-menu-item-content-icon-size);
|
|
30
|
+
height: var(--dropdown-menu-item-content-icon-size);
|
|
31
|
+
color: var(--dropdown-menu-item-content-icon-color);
|
|
32
|
+
border: var(--dropdown-menu-item-content-icon-border);
|
|
33
|
+
border-radius: var(--dropdown-menu-item-content-icon-border-radius);
|
|
34
|
+
`;
|
|
35
|
+
const TextWrapper = styled_components_1.default.div `
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
flex: 1;
|
|
39
|
+
gap: var(--dropdown-menu-item-content-text-gap);
|
|
40
|
+
`;
|
|
41
|
+
const TitleWrapper = styled_components_1.default.div `
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
gap: var(--dropdown-menu-item-content-title-icon-gap);
|
|
45
|
+
font-weight: var(--dropdown-menu-item-content-title-font-weight);
|
|
46
|
+
font-size: var(--dropdown-menu-item-content-title-font-size);
|
|
47
|
+
line-height: var(--dropdown-menu-item-content-title-line-height);
|
|
48
|
+
color: var(--dropdown-menu-item-content-title-color);
|
|
49
|
+
`;
|
|
50
|
+
const DescriptionWrapper = styled_components_1.default.div `
|
|
51
|
+
font-weight: var(--dropdown-menu-item-content-description-font-weight);
|
|
52
|
+
font-size: var(--dropdown-menu-item-content-description-font-size);
|
|
53
|
+
line-height: var(--dropdown-menu-item-content-description-line-height);
|
|
54
|
+
color: var(--dropdown-menu-item-content-description-color);
|
|
55
|
+
`;
|
|
56
|
+
//# sourceMappingURL=DropdownMenuItemContent.js.map
|
|
@@ -19,7 +19,7 @@ exports.dropdown = (0, styled_components_1.css) `
|
|
|
19
19
|
--dropdown-menu-max-width: 424px;
|
|
20
20
|
--dropdown-menu-max-height: 300px;
|
|
21
21
|
--dropdown-menu-padding: var(--spacing-xxs); // @presenter Spacing
|
|
22
|
-
--dropdown-menu-border-radius: var(--border-radius-
|
|
22
|
+
--dropdown-menu-border-radius: var(--border-radius-xl); // @presenter BorderRadius
|
|
23
23
|
--dropdown-menu-box-shadow: var(--bg-raised-shadow); // @presenter Shadow
|
|
24
24
|
--dropdown-menu-border-color: var(--border-color-secondary); // @presenter Color
|
|
25
25
|
--dropdown-menu-bg-color: var(--bg-color-raised); // @presenter Color
|
|
@@ -29,7 +29,7 @@ exports.dropdown = (0, styled_components_1.css) `
|
|
|
29
29
|
--dropdown-menu-item-padding-vertical: 5px; // @presenter Spacing
|
|
30
30
|
--dropdown-menu-item-separator-padding-top: var(--spacing-xs); // @presenter Spacing
|
|
31
31
|
--dropdown-menu-item-separator-padding-bottom: var(--spacing-xxs); // @presenter Spacing
|
|
32
|
-
--dropdown-menu-item-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
32
|
+
--dropdown-menu-item-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
33
33
|
--dropdown-menu-item-bg-color: transparent;
|
|
34
34
|
--dropdown-menu-item-bg-color-active: var(--bg-color-hover); // @presenter Color
|
|
35
35
|
--dropdown-menu-item-bg-color-hover: var(--bg-color-hover); // @presenter Color
|
|
@@ -47,6 +47,23 @@ exports.dropdown = (0, styled_components_1.css) `
|
|
|
47
47
|
--dropdown-menu-item-color-dangerous: var(--color-error-base);
|
|
48
48
|
|
|
49
49
|
--dropdown-menu-item-border-color-focused: var(--button-border-color-focused);
|
|
50
|
+
|
|
51
|
+
--dropdown-menu-item-content-gap: var(--spacing-sm); // @presenter Spacing
|
|
52
|
+
--dropdown-menu-item-content-padding: var(--spacing-xxs) 0; // @presenter Spacing
|
|
53
|
+
--dropdown-menu-item-content-icon-size: 32px;
|
|
54
|
+
--dropdown-menu-item-content-icon-color: var(--icon-color-secondary); // @presenter Color
|
|
55
|
+
--dropdown-menu-item-content-icon-border: 1px solid var(--border-color-secondary); // @presenter Border
|
|
56
|
+
--dropdown-menu-item-content-icon-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
57
|
+
--dropdown-menu-item-content-text-gap: var(--spacing-xxs); // @presenter Spacing
|
|
58
|
+
--dropdown-menu-item-content-title-icon-gap: var(--spacing-xxs); // @presenter Spacing
|
|
59
|
+
--dropdown-menu-item-content-title-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
60
|
+
--dropdown-menu-item-content-title-font-size: var(--font-size-base); // @presenter FontSize
|
|
61
|
+
--dropdown-menu-item-content-title-line-height: var(--line-height-base); // @presenter LineHeight
|
|
62
|
+
--dropdown-menu-item-content-title-color: var(--text-color-secondary); // @presenter Color
|
|
63
|
+
--dropdown-menu-item-content-description-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
64
|
+
--dropdown-menu-item-content-description-font-size: var(--font-size-sm); // @presenter FontSize
|
|
65
|
+
--dropdown-menu-item-content-description-line-height: var(--line-height-sm); // @presenter LineHeight
|
|
66
|
+
--dropdown-menu-item-content-description-color: var(--text-color-description); // @presenter Color
|
|
50
67
|
// @tokens End
|
|
51
68
|
`;
|
|
52
69
|
//# sourceMappingURL=variables.js.map
|
|
@@ -36,7 +36,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.MOOD_STATES = void 0;
|
|
37
37
|
exports.Mood = Mood;
|
|
38
38
|
const React = __importStar(require("react"));
|
|
39
|
-
const react_1 = require("react");
|
|
40
39
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
41
40
|
const Reasons_1 = require("../../components/Feedback/Reasons");
|
|
42
41
|
const hooks_1 = require("../../core/hooks");
|
|
@@ -115,33 +114,38 @@ function Mood({ settings, onSubmit, className }) {
|
|
|
115
114
|
return 'checkbox';
|
|
116
115
|
return (_a = reasonsSettings[score]) === null || _a === void 0 ? void 0 : _a.component;
|
|
117
116
|
};
|
|
117
|
+
const hasComment = !(commentSettings === null || commentSettings === void 0 ? void 0 : commentSettings.hide);
|
|
118
|
+
const hasOptionalEmail = !(optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.hide) && !(userData === null || userData === void 0 ? void 0 : userData.isAuthenticated);
|
|
118
119
|
const displayReasons = checkIfShouldDisplayReasons(score);
|
|
119
|
-
const displayComment = !!
|
|
120
|
+
const displayComment = !!score && hasComment;
|
|
120
121
|
const displaySubmitBnt = !!(score && (displayReasons || displayComment));
|
|
121
|
-
const displayFeedbackEmail = !!score &&
|
|
122
|
-
const
|
|
122
|
+
const displayFeedbackEmail = !!score && hasOptionalEmail;
|
|
123
|
+
const submitMood = (moodScore) => {
|
|
123
124
|
const trimmedComment = (comment === null || comment === void 0 ? void 0 : comment.trim()) || undefined;
|
|
124
125
|
const trimmedEmail = (email === null || email === void 0 ? void 0 : email.trim()) || undefined;
|
|
125
126
|
onSubmit({
|
|
126
|
-
score: remapScore(
|
|
127
|
+
score: remapScore(moodScore),
|
|
127
128
|
comment: trimmedComment,
|
|
128
129
|
reasons,
|
|
129
130
|
email: trimmedEmail,
|
|
130
131
|
});
|
|
131
132
|
setIsSubmitted(true);
|
|
132
133
|
};
|
|
134
|
+
const onSubmitMoodForm = () => {
|
|
135
|
+
submitMood(score);
|
|
136
|
+
};
|
|
137
|
+
const onScoreChange = (newScore) => {
|
|
138
|
+
setScore(newScore);
|
|
139
|
+
if (newScore && !checkIfShouldDisplayReasons(newScore) && !hasComment && !hasOptionalEmail) {
|
|
140
|
+
submitMood(newScore);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
133
143
|
const onCancelMoodForm = () => {
|
|
134
144
|
setScore('');
|
|
135
145
|
setComment('');
|
|
136
146
|
setReasons([]);
|
|
137
147
|
setEmail(undefined);
|
|
138
148
|
};
|
|
139
|
-
(0, react_1.useEffect)(() => {
|
|
140
|
-
if (score && !displayComment && !displayReasons && !displayFeedbackEmail) {
|
|
141
|
-
onSubmitMoodForm();
|
|
142
|
-
}
|
|
143
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
144
|
-
}, [score, displayComment, displayReasons, displayFeedbackEmail]);
|
|
145
149
|
if (isSubmitted) {
|
|
146
150
|
return (React.createElement(MoodWrapper, { "data-component-name": "Feedback/Mood" },
|
|
147
151
|
React.createElement(StyledFormMandatoryFields, null,
|
|
@@ -155,13 +159,13 @@ function Mood({ settings, onSubmit, className }) {
|
|
|
155
159
|
React.createElement(Label, { $standAlone: true, "data-translation-key": "feedback.settings.label" }, label || translate('feedback.settings.label', 'Was this helpful?')),
|
|
156
160
|
React.createElement(StyledMandatoryFieldContainer, null,
|
|
157
161
|
React.createElement(Button_1.Button, { "aria-label": MOOD_STATES.DISSATISFIED, type: "button", size: "medium", variant: score === MOOD_STATES.DISSATISFIED ? 'primary' : 'secondary', tone: score === MOOD_STATES.DISSATISFIED ? 'danger' : 'default', onClick: () => {
|
|
158
|
-
|
|
162
|
+
onScoreChange(MOOD_STATES.DISSATISFIED);
|
|
159
163
|
}, icon: React.createElement(FaceDissatisfiedIcon_1.FaceDissatisfiedIcon, null) }),
|
|
160
164
|
React.createElement(Button_1.Button, { "aria-label": MOOD_STATES.NEUTRAL, type: "button", variant: score === MOOD_STATES.NEUTRAL ? 'primary' : 'secondary', size: "medium", onClick: () => {
|
|
161
|
-
|
|
165
|
+
onScoreChange(MOOD_STATES.NEUTRAL);
|
|
162
166
|
}, icon: React.createElement(FaceNeutralIcon_1.FaceNeutralIcon, null) }),
|
|
163
167
|
React.createElement(Button_1.Button, { "aria-label": MOOD_STATES.SATISFIED, type: "button", variant: score === MOOD_STATES.SATISFIED ? 'primary' : 'secondary', size: "medium", onClick: () => {
|
|
164
|
-
|
|
168
|
+
onScoreChange(MOOD_STATES.SATISFIED);
|
|
165
169
|
}, icon: React.createElement(FaceSatisfiedIcon_1.FaceSatisfiedIcon, null) }))),
|
|
166
170
|
(displayReasons || displayComment) && (React.createElement(StyledFormOptionalFields, null,
|
|
167
171
|
displayReasons && (React.createElement(Reasons_1.Reasons, { settings: {
|
|
@@ -39,7 +39,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.FEEDBACK_MAX_RATING = void 0;
|
|
40
40
|
exports.Rating = Rating;
|
|
41
41
|
const React = __importStar(require("react"));
|
|
42
|
-
const react_1 = require("react");
|
|
43
42
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
44
43
|
const Reasons_1 = require("../../components/Feedback/Reasons");
|
|
45
44
|
const hooks_1 = require("../../core/hooks");
|
|
@@ -59,15 +58,18 @@ function Rating({ settings, onSubmit, className }) {
|
|
|
59
58
|
const { useTranslate, useUserMenu } = (0, hooks_1.useThemeHooks)();
|
|
60
59
|
const { userData } = useUserMenu();
|
|
61
60
|
const { translate } = useTranslate();
|
|
61
|
+
const hasReasons = !!(reasonsSettings && !reasonsSettings.hide);
|
|
62
|
+
const hasComment = !(commentSettings === null || commentSettings === void 0 ? void 0 : commentSettings.hide);
|
|
63
|
+
const hasOptionalEmail = !(optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.hide) && !(userData === null || userData === void 0 ? void 0 : userData.isAuthenticated);
|
|
62
64
|
const onEmailChange = (e) => {
|
|
63
65
|
const value = e.target.value;
|
|
64
66
|
setEmail(value || undefined);
|
|
65
67
|
};
|
|
66
|
-
const
|
|
68
|
+
const submitRating = (ratingScore) => {
|
|
67
69
|
const trimmedComment = (comment === null || comment === void 0 ? void 0 : comment.trim()) || undefined;
|
|
68
70
|
const trimmedEmail = (email === null || email === void 0 ? void 0 : email.trim()) || undefined;
|
|
69
71
|
onSubmit({
|
|
70
|
-
score,
|
|
72
|
+
score: ratingScore,
|
|
71
73
|
comment: trimmedComment,
|
|
72
74
|
reasons,
|
|
73
75
|
max: exports.FEEDBACK_MAX_RATING,
|
|
@@ -75,22 +77,25 @@ function Rating({ settings, onSubmit, className }) {
|
|
|
75
77
|
});
|
|
76
78
|
setIsSubmitted(true);
|
|
77
79
|
};
|
|
80
|
+
const onSubmitRatingForm = () => {
|
|
81
|
+
submitRating(score);
|
|
82
|
+
};
|
|
83
|
+
const onScoreChange = (newScore) => {
|
|
84
|
+
setScore(newScore);
|
|
85
|
+
if (newScore && !hasReasons && !hasComment && !hasOptionalEmail) {
|
|
86
|
+
submitRating(newScore);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
78
89
|
const onCancelRatingForm = () => {
|
|
79
90
|
setScore(0);
|
|
80
91
|
setComment('');
|
|
81
92
|
setReasons([]);
|
|
82
93
|
setEmail(undefined);
|
|
83
94
|
};
|
|
84
|
-
const displayReasons = !!
|
|
85
|
-
const displayComment = !!
|
|
95
|
+
const displayReasons = !!score && hasReasons;
|
|
96
|
+
const displayComment = !!score && hasComment;
|
|
86
97
|
const displaySubmitBnt = !!(score && (displayReasons || displayComment));
|
|
87
|
-
const displayFeedbackEmail = !!score &&
|
|
88
|
-
(0, react_1.useEffect)(() => {
|
|
89
|
-
if (score && !displayComment && !displayReasons && !displayFeedbackEmail) {
|
|
90
|
-
onSubmitRatingForm();
|
|
91
|
-
}
|
|
92
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
93
|
-
}, [score, displayComment, displayReasons, displayFeedbackEmail]);
|
|
98
|
+
const displayFeedbackEmail = !!score && hasOptionalEmail;
|
|
94
99
|
if (isSubmitted) {
|
|
95
100
|
return (React.createElement(RatingWrapper, { "data-component-name": "Feedback/Rating" },
|
|
96
101
|
React.createElement(StyledFormMandatoryFields, null,
|
|
@@ -103,7 +108,7 @@ function Rating({ settings, onSubmit, className }) {
|
|
|
103
108
|
React.createElement(StyledFormMandatoryFields, null,
|
|
104
109
|
React.createElement(Label, { "data-translation-key": "feedback.settings.label" }, label || translate('feedback.settings.label', 'Was this helpful?')),
|
|
105
110
|
React.createElement(StyledMandatoryFieldContainer, null,
|
|
106
|
-
React.createElement(Stars_1.Stars, { max: exports.FEEDBACK_MAX_RATING, onChange:
|
|
111
|
+
React.createElement(Stars_1.Stars, { max: exports.FEEDBACK_MAX_RATING, onChange: onScoreChange, value: score }))),
|
|
107
112
|
(displayReasons || displayComment) && (React.createElement(StyledFormOptionalFields, null,
|
|
108
113
|
displayReasons && (React.createElement(Reasons_1.Reasons, { settings: {
|
|
109
114
|
label: reasonsSettings === null || reasonsSettings === void 0 ? void 0 : reasonsSettings.label,
|
|
@@ -39,7 +39,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.MAX_SCALE = void 0;
|
|
40
40
|
exports.Scale = Scale;
|
|
41
41
|
const React = __importStar(require("react"));
|
|
42
|
-
const react_1 = require("react");
|
|
43
42
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
44
43
|
const utils_1 = require("../../core/utils");
|
|
45
44
|
const hooks_1 = require("../../core/hooks");
|
|
@@ -63,25 +62,14 @@ function Scale({ settings, onSubmit, className }) {
|
|
|
63
62
|
const value = e.target.value;
|
|
64
63
|
setEmail(value || undefined);
|
|
65
64
|
};
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const displayReasons = !!score && reasonsSettings && !reasonsSettings.hide;
|
|
71
|
-
const displayComment = !!(score && !(commentSettings === null || commentSettings === void 0 ? void 0 : commentSettings.hide));
|
|
72
|
-
const displaySubmitBnt = !!score && (displayReasons || displayComment);
|
|
73
|
-
const displayFeedbackEmail = !!score && !(optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.hide) && !userData.isAuthenticated;
|
|
74
|
-
const handleCancel = () => {
|
|
75
|
-
setScore(0);
|
|
76
|
-
setComment('');
|
|
77
|
-
setReasons([]);
|
|
78
|
-
setEmail(undefined);
|
|
79
|
-
};
|
|
80
|
-
const onSubmitScaleForm = () => {
|
|
65
|
+
const hasReasons = !!(reasonsSettings && !reasonsSettings.hide);
|
|
66
|
+
const hasComment = !(commentSettings === null || commentSettings === void 0 ? void 0 : commentSettings.hide);
|
|
67
|
+
const hasOptionalEmail = !(optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.hide) && !(userData === null || userData === void 0 ? void 0 : userData.isAuthenticated);
|
|
68
|
+
const submitScale = (scaleScore) => {
|
|
81
69
|
const trimmedComment = (comment === null || comment === void 0 ? void 0 : comment.trim()) || undefined;
|
|
82
70
|
const trimmedEmail = (email === null || email === void 0 ? void 0 : email.trim()) || undefined;
|
|
83
71
|
onSubmit({
|
|
84
|
-
score,
|
|
72
|
+
score: scaleScore,
|
|
85
73
|
comment: trimmedComment,
|
|
86
74
|
reasons,
|
|
87
75
|
max: exports.MAX_SCALE,
|
|
@@ -89,12 +77,29 @@ function Scale({ settings, onSubmit, className }) {
|
|
|
89
77
|
});
|
|
90
78
|
setIsSubmitted(true);
|
|
91
79
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
const onSubmitScaleForm = () => {
|
|
81
|
+
submitScale(score);
|
|
82
|
+
};
|
|
83
|
+
const onScoreChange = (newScore) => {
|
|
84
|
+
setScore(newScore);
|
|
85
|
+
if (newScore && !hasReasons && !hasComment && !hasOptionalEmail) {
|
|
86
|
+
submitScale(newScore);
|
|
95
87
|
}
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
};
|
|
89
|
+
const handleCancel = () => {
|
|
90
|
+
setScore(0);
|
|
91
|
+
setComment('');
|
|
92
|
+
setReasons([]);
|
|
93
|
+
setEmail(undefined);
|
|
94
|
+
};
|
|
95
|
+
const scaleOptions = [];
|
|
96
|
+
for (let i = 1; i <= exports.MAX_SCALE; i++) {
|
|
97
|
+
scaleOptions.push(React.createElement(Button_1.Button, { id: `scale-option-${i}`, key: `scale-option-${i}`, type: "button", onClick: () => onScoreChange(i), className: `${score === i ? 'active' : ''}` }, i));
|
|
98
|
+
}
|
|
99
|
+
const displayReasons = !!score && hasReasons;
|
|
100
|
+
const displayComment = !!score && hasComment;
|
|
101
|
+
const displaySubmitBnt = !!score && (displayReasons || displayComment);
|
|
102
|
+
const displayFeedbackEmail = !!score && hasOptionalEmail;
|
|
98
103
|
if (isSubmitted) {
|
|
99
104
|
return (React.createElement(ScaleWrapper, { "data-component-name": "Feedback/Scale" },
|
|
100
105
|
React.createElement(Label, { "data-translation-key": "feedback.settings.submitText" }, submitText ||
|
|
@@ -38,7 +38,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Sentiment = Sentiment;
|
|
40
40
|
const React = __importStar(require("react"));
|
|
41
|
-
const react_1 = require("react");
|
|
42
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
43
42
|
const Reasons_1 = require("../../components/Feedback/Reasons");
|
|
44
43
|
const hooks_1 = require("../../core/hooks");
|
|
@@ -82,10 +81,12 @@ function Sentiment({ settings, onSubmit, className }) {
|
|
|
82
81
|
}
|
|
83
82
|
return !(scoreSpecificReasonsSettings === null || scoreSpecificReasonsSettings === void 0 ? void 0 : scoreSpecificReasonsSettings.hide);
|
|
84
83
|
};
|
|
84
|
+
const hasComment = !(commentSettings === null || commentSettings === void 0 ? void 0 : commentSettings.hide);
|
|
85
|
+
const hasOptionalEmail = !(optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.hide) && !(userData === null || userData === void 0 ? void 0 : userData.isAuthenticated);
|
|
85
86
|
const displayReasons = checkIfShouldDisplayReasons(score);
|
|
86
|
-
const displayComment = !!
|
|
87
|
+
const displayComment = !!score && hasComment;
|
|
87
88
|
const displaySubmitBnt = !!(score && (displayReasons || displayComment));
|
|
88
|
-
const displayFeedbackEmail = !!score &&
|
|
89
|
+
const displayFeedbackEmail = !!score && hasOptionalEmail;
|
|
89
90
|
const commentLabel = score === 1
|
|
90
91
|
? (commentSettings && commentSettings.likeLabel) ||
|
|
91
92
|
translate('feedback.settings.comment.likeLabel', 'What was most helpful?')
|
|
@@ -105,29 +106,32 @@ function Sentiment({ settings, onSubmit, className }) {
|
|
|
105
106
|
const scoreSpecificReasonSettings = getScoreSpecificReasonSettings(score);
|
|
106
107
|
return scoreSpecificReasonSettings === null || scoreSpecificReasonSettings === void 0 ? void 0 : scoreSpecificReasonSettings.component;
|
|
107
108
|
};
|
|
108
|
-
const
|
|
109
|
+
const submitSentiment = (sentimentScore) => {
|
|
109
110
|
const trimmedComment = (comment === null || comment === void 0 ? void 0 : comment.trim()) || undefined;
|
|
110
111
|
const trimmedEmail = (email === null || email === void 0 ? void 0 : email.trim()) || undefined;
|
|
111
112
|
onSubmit({
|
|
112
|
-
score,
|
|
113
|
+
score: sentimentScore,
|
|
113
114
|
comment: trimmedComment,
|
|
114
115
|
reasons,
|
|
115
116
|
email: trimmedEmail,
|
|
116
117
|
});
|
|
117
118
|
setIsSubmitted(true);
|
|
118
119
|
};
|
|
120
|
+
const onSubmitSentimentForm = () => {
|
|
121
|
+
submitSentiment(score);
|
|
122
|
+
};
|
|
123
|
+
const onScoreChange = (newScore) => {
|
|
124
|
+
setScore(newScore);
|
|
125
|
+
if (newScore && !checkIfShouldDisplayReasons(newScore) && !hasComment && !hasOptionalEmail) {
|
|
126
|
+
submitSentiment(newScore);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
119
129
|
const onCancelSentimentForm = () => {
|
|
120
130
|
setScore(0);
|
|
121
131
|
setComment('');
|
|
122
132
|
setReasons([]);
|
|
123
133
|
setEmail(undefined);
|
|
124
134
|
};
|
|
125
|
-
(0, react_1.useEffect)(() => {
|
|
126
|
-
if (score && !displayComment && !displayReasons && !displayFeedbackEmail) {
|
|
127
|
-
onSubmitSentimentForm();
|
|
128
|
-
}
|
|
129
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
130
|
-
}, [score, displayComment, displayReasons, displayFeedbackEmail]);
|
|
131
135
|
if (isSubmitted) {
|
|
132
136
|
return (React.createElement(SentimentWrapper, { "data-component-name": "Feedback/Sentiment" },
|
|
133
137
|
React.createElement(StyledFormMandatoryFields, null,
|
|
@@ -141,10 +145,10 @@ function Sentiment({ settings, onSubmit, className }) {
|
|
|
141
145
|
React.createElement(Label, { "data-translation-key": "feedback.settings.label" }, label || translate('feedback.settings.label', 'Was this helpful?')),
|
|
142
146
|
React.createElement(StyledMandatoryFieldContainer, null,
|
|
143
147
|
React.createElement(Button_1.Button, { type: "button", size: "medium", variant: score === 1 ? 'primary' : 'secondary', onClick: () => {
|
|
144
|
-
|
|
148
|
+
onScoreChange(1);
|
|
145
149
|
}, "aria-label": translate('feedback.sentiment.thumbUp', 'Like'), icon: React.createElement(ThumbUpIcon_1.ThumbUpIcon, null) }),
|
|
146
150
|
React.createElement(Button_1.Button, { size: "medium", type: "button", variant: score === -1 ? 'primary' : 'secondary', tone: score === -1 ? 'danger' : 'default', onClick: () => {
|
|
147
|
-
|
|
151
|
+
onScoreChange(-1);
|
|
148
152
|
}, "aria-label": translate('feedback.sentiment.thumbDown', 'Dislike'), icon: React.createElement(ThumbDownIcon_1.ThumbDownIcon, null) }))),
|
|
149
153
|
(displayReasons || displayComment) && (React.createElement(StyledFormOptionalFields, null,
|
|
150
154
|
displayReasons && (React.createElement(Reasons_1.Reasons, { settings: {
|
|
@@ -53,6 +53,7 @@ const StyledSelect = (0, styled_components_1.default)(Select_1.Select) `
|
|
|
53
53
|
--select-text-color: var(--filter-select-color);
|
|
54
54
|
border: 1px solid var(--filter-select-border-color);
|
|
55
55
|
--select-border-radius: var(--filter-select-border-radius);
|
|
56
|
+
--select-input-border-radius: var(--filter-select-border-radius);
|
|
56
57
|
padding: var(--filter-select-padding);
|
|
57
58
|
|
|
58
59
|
&:hover {
|
|
@@ -74,7 +74,7 @@ exports.filter = (0, styled_components_1.css) `
|
|
|
74
74
|
--filter-select-max-width: 100%;
|
|
75
75
|
--filter-select-color: var(--text-color-primary);
|
|
76
76
|
--filter-select-border-color: var(--border-color-primary);
|
|
77
|
-
--filter-select-border-radius:
|
|
77
|
+
--filter-select-border-radius: var(--input-border-radius);
|
|
78
78
|
--filter-select-padding: 0;
|
|
79
79
|
--filter-select-border-color-hover: var(--text-color-primary);
|
|
80
80
|
--filter-select-option-margin: 0;
|
|
@@ -94,7 +94,7 @@ exports.filter = (0, styled_components_1.css) `
|
|
|
94
94
|
--filter-date-picker-icon-width: var(--spacing-sm);
|
|
95
95
|
--filter-date-picker-icon-stroke-hover: var(--text-color-primary);
|
|
96
96
|
--filter-date-picker-wrapper-border-color: var(--border-color-primary);
|
|
97
|
-
--filter-date-picker-wrapper-radius:
|
|
97
|
+
--filter-date-picker-wrapper-radius: var(--border-radius-md);
|
|
98
98
|
--filter-date-picker-wrapper-padding: calc(var(--spacing-xxs) / 2) var(--spacing-xs);
|
|
99
99
|
|
|
100
100
|
// @tokens End
|
|
@@ -12,7 +12,7 @@ exports.image = (0, styled_components_1.css) `
|
|
|
12
12
|
--image-frame-border-color: var(--border-color-secondary);
|
|
13
13
|
--image-frame-border-radius: var(--border-radius-xxl);
|
|
14
14
|
--image-frame-bg-color: var(--bg-color-raised);
|
|
15
|
-
--image-frame-image-border-radius: var(--border-radius-
|
|
15
|
+
--image-frame-image-border-radius: var(--border-radius-xl);
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @tokens Image caption
|
|
@@ -26,7 +26,7 @@ exports.image = (0, styled_components_1.css) `
|
|
|
26
26
|
/**
|
|
27
27
|
* @tokens Image gallery
|
|
28
28
|
*/
|
|
29
|
-
--image-gallery-border-radius: var(--border-radius-
|
|
29
|
+
--image-gallery-border-radius: var(--border-radius-xl);
|
|
30
30
|
--image-gallery-image-bg-color: var(--bg-color-tonal);
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -51,9 +51,11 @@ exports.image = (0, styled_components_1.css) `
|
|
|
51
51
|
--image-lightbox-close-size: 40px;
|
|
52
52
|
--image-lightbox-close-icon-size: 18px;
|
|
53
53
|
--image-lightbox-close-offset: var(--spacing-base);
|
|
54
|
-
--image-lightbox-close-border-radius: var(--border-radius-
|
|
54
|
+
--image-lightbox-close-border-radius: var(--border-radius-xl);
|
|
55
55
|
--image-lightbox-side-gutter: calc(
|
|
56
56
|
var(--image-lightbox-close-size) + var(--image-lightbox-close-offset) + var(--spacing-sm)
|
|
57
57
|
);
|
|
58
|
+
|
|
59
|
+
// @tokens End
|
|
58
60
|
`;
|
|
59
61
|
//# sourceMappingURL=variables.js.map
|
|
@@ -24,7 +24,7 @@ exports.languagePicker = (0, styled_components_1.css) `
|
|
|
24
24
|
--language-picker-dropdown-item-padding-vertical: var(--dropdown-menu-item-padding-vertical); // @presenter Spacing
|
|
25
25
|
--language-picker-dropdown-item-separator-padding-top: var(--dropdown-menu-item-separator-padding-top ); // @presenter Spacing
|
|
26
26
|
--language-picker-dropdown-item-separator-padding-bottom: var(--dropdown-menu-item-separator-padding-bottom ); // @presenter Spacing
|
|
27
|
-
--language-picker-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius
|
|
27
|
+
--language-picker-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius); // @presenter BorderRadius
|
|
28
28
|
--language-picker-dropdown-item-bg-color-active: var(--dropdown-menu-item-bg-color-active); // @presenter Color
|
|
29
29
|
--language-picker-dropdown-item-bg-color-hover: var(--dropdown-menu-item-bg-color-hover); // @presenter Color
|
|
30
30
|
--language-picker-dropdown-item-bg-color-disabled: var(--dropdown-menu-item-bg-color-disabled); // @presenter Color
|
|
@@ -42,7 +42,7 @@ exports.markdown = (0, styled_components_1.css) `
|
|
|
42
42
|
--md-table-line-height: var(--line-height-md); // @presenter FontSize
|
|
43
43
|
--md-table-margin-vertical: 20px; // @presenter Spacing
|
|
44
44
|
--md-table-bg-color: transparent; // @presenter Color
|
|
45
|
-
--md-table-border-radius: var(--border-radius);
|
|
45
|
+
--md-table-border-radius: var(--border-radius-xl);
|
|
46
46
|
|
|
47
47
|
--md-table-border-width: 1px;
|
|
48
48
|
--md-table-header-bg-color: var(--layer-color);
|
|
@@ -58,7 +58,7 @@ exports.menu = (0, styled_components_1.css) `
|
|
|
58
58
|
--menu-item-label-margin: var(--menu-item-label-margin-vertical) var(--menu-item-label-margin-horizontal);
|
|
59
59
|
--menu-item-label-padding: var(--menu-item-padding-vertical) var(--menu-item-padding-horizontal);
|
|
60
60
|
--menu-item-label-gap: var(--spacing-xxs);
|
|
61
|
-
--menu-item-label-border-radius:
|
|
61
|
+
--menu-item-label-border-radius: var(--border-radius-lg);
|
|
62
62
|
--menu-item-label-chevron-size: 12px;
|
|
63
63
|
--menu-item-label-chevron-offset: calc(var(--menu-item-label-gap) + var(--menu-item-label-chevron-size));
|
|
64
64
|
|
|
@@ -29,7 +29,7 @@ exports.navbar = (0, styled_components_1.css) `
|
|
|
29
29
|
|
|
30
30
|
--navbar-item-line-height: var(--line-height-base);
|
|
31
31
|
--navbar-item-bg-color-active: var(--bg-color-active);
|
|
32
|
-
--navbar-item-border-radius: var(--border-radius);
|
|
32
|
+
--navbar-item-border-radius: var(--border-radius-lg);
|
|
33
33
|
--navbar-item-bottom-border: none;
|
|
34
34
|
|
|
35
35
|
--navbar-item-text-color-hover: var(--text-color-primary);
|
|
@@ -51,9 +51,8 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
51
51
|
const PageActionsMenuItem_1 = require("../../components/PageActions/PageActionsMenuItem");
|
|
52
52
|
const DropdownMenuItem_1 = require("../../components/Dropdown/DropdownMenuItem");
|
|
53
53
|
const Link_1 = require("../../components/Link/Link");
|
|
54
|
-
const ButtonGroup_1 = require("../../components/Button/ButtonGroup");
|
|
55
54
|
const Button_1 = require("../../components/Button/Button");
|
|
56
|
-
const
|
|
55
|
+
const SplitButton_1 = require("../../components/SplitButton/SplitButton");
|
|
57
56
|
const DropdownMenu_1 = require("../../components/Dropdown/DropdownMenu");
|
|
58
57
|
const Spinner_1 = require("../../icons/Spinner/Spinner");
|
|
59
58
|
const CheckmarkFilledIcon_1 = require("../../icons/CheckmarkFilledIcon/CheckmarkFilledIcon");
|
|
@@ -61,6 +60,8 @@ const hooks_1 = require("../../core/hooks");
|
|
|
61
60
|
const ACTION_DONE_DISPLAY_DURATION = 1000;
|
|
62
61
|
function PageActions(props) {
|
|
63
62
|
const { pageSlug, mcpUrl } = props;
|
|
63
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
64
|
+
const { translate } = useTranslate();
|
|
64
65
|
const actions = (0, hooks_1.usePageActions)(pageSlug || '/', mcpUrl, props.actions);
|
|
65
66
|
const [actionState, setActionState] = (0, react_1.useState)('idle');
|
|
66
67
|
if (!actions.length) {
|
|
@@ -86,10 +87,7 @@ function PageActions(props) {
|
|
|
86
87
|
return (react_1.default.createElement(StyledDropdownMenuItem, { key: key, onAction: () => handleActionClick(action) }, content));
|
|
87
88
|
});
|
|
88
89
|
return (react_1.default.createElement(PageActionsWrapper, { "data-component-name": "PageActions/PageActions" },
|
|
89
|
-
react_1.default.createElement(
|
|
90
|
-
react_1.default.createElement(Button_1.Button, { icon: renderIcon(buttonAction, actionState), to: 'link' in buttonAction ? buttonAction.link : undefined, external: true, onClick: () => handleActionClick(buttonAction) }, buttonAction.buttonText),
|
|
91
|
-
actions.length > 1 ? (react_1.default.createElement(Dropdown_1.Dropdown, { withArrow: true, portalled: true, trigger: react_1.default.createElement(Button_1.Button, { "aria-label": "More actions" }), placement: "bottom", alignment: "end" },
|
|
92
|
-
react_1.default.createElement(StyledDropdownMenu, null, menuItems))) : null)));
|
|
90
|
+
react_1.default.createElement(SplitButton_1.SplitButton, { portalled: true, variant: "outlined", size: "medium", toggleAriaLabel: translate('page.actions.moreActions', 'More actions'), button: react_1.default.createElement(Button_1.Button, { variant: "outlined", icon: renderIcon(buttonAction, actionState), to: 'link' in buttonAction ? buttonAction.link : undefined, external: true, onClick: () => handleActionClick(buttonAction) }, buttonAction.buttonText) }, actions.length > 1 ? react_1.default.createElement(StyledDropdownMenu, null, menuItems) : null)));
|
|
93
91
|
}
|
|
94
92
|
function renderIcon(buttonAction, actionState) {
|
|
95
93
|
switch (actionState) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
2
|
import type { PageAction } from '../../core/types';
|
|
3
|
-
type PageActionsMenuItemProps = {
|
|
3
|
+
export type PageActionsMenuItemProps = {
|
|
4
4
|
pageAction: PageAction;
|
|
5
|
+
className?: string;
|
|
5
6
|
};
|
|
6
|
-
export declare function PageActionsMenuItem(props: PageActionsMenuItemProps):
|
|
7
|
-
export {};
|
|
7
|
+
export declare function PageActionsMenuItem(props: PageActionsMenuItemProps): JSX.Element;
|