@redocly/theme 0.9.0-beta.3 → 0.9.0-beta.5
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/Button/Button.d.ts +1 -1
- package/lib/Button/Button.js +14 -2
- package/lib/Cards/Card.d.ts +1 -0
- package/lib/Catalog/Catalog.d.ts +1 -0
- package/lib/Catalog/CatalogCard.d.ts +1 -0
- package/lib/Catalog/Filter.d.ts +1 -0
- package/lib/Catalog/Filter.js +1 -3
- package/lib/Catalog/Tags.d.ts +1 -0
- package/lib/ColorModeSwitcher/ColorModeSwitcher.d.ts +1 -0
- package/lib/CopyButton/CopyButton.d.ts +1 -0
- package/lib/EditPageButton/EditPageButton.d.ts +1 -0
- package/lib/Feedback/Comment.d.ts +1 -0
- package/lib/Feedback/Rating.d.ts +1 -0
- package/lib/Feedback/Reasons.d.ts +1 -0
- package/lib/Feedback/ReportDialog.d.ts +1 -0
- package/lib/Feedback/Sentiment.d.ts +1 -0
- package/lib/Feedback/Thumbs.d.ts +1 -0
- package/lib/Footer/CustomFooter.d.ts +1 -0
- package/lib/Footer/CustomFooterNavItem.d.ts +1 -0
- package/lib/Footer/Footer.d.ts +1 -0
- package/lib/Footer/FooterColumn.d.ts +1 -0
- package/lib/Footer/FooterColumns.d.ts +1 -0
- package/lib/Footer/FooterCopyright.d.ts +1 -0
- package/lib/LastUpdated/LastUpdated.d.ts +1 -0
- package/lib/Markdown/Admonition.d.ts +4 -1
- package/lib/Markdown/Admonition.js +2 -2
- package/lib/Markdown/CodeSample/CodeSample.d.ts +4 -1
- package/lib/Markdown/CodeSample/CodeSample.js +2 -2
- package/lib/Markdown/Heading.d.ts +3 -1
- package/lib/Markdown/Heading.js +6 -4
- package/lib/Markdown/Mermaid.d.ts +4 -1
- package/lib/Markdown/Mermaid.js +2 -2
- package/lib/Markdown/Tabs/Tab.d.ts +1 -0
- package/lib/Navbar/MobileNavbarDropdown.d.ts +1 -0
- package/lib/Navbar/MobileNavbarItem.d.ts +1 -0
- package/lib/Navbar/MobileNavbarMenuButton.d.ts +1 -0
- package/lib/Navbar/NavbarDropdown.d.ts +1 -0
- package/lib/Navbar/NavbarItem.d.ts +1 -0
- package/lib/Navbar/NavbarMenu.d.ts +1 -0
- package/lib/NavbarLogo/NavbarLogo.d.ts +1 -0
- package/lib/PageNavigation/NextButton.d.ts +1 -0
- package/lib/PageNavigation/PageNavigation.d.ts +1 -0
- package/lib/PageNavigation/PreviousButton.d.ts +1 -0
- package/lib/Pages/Forbidden.d.ts +1 -0
- package/lib/Pages/NotFound.d.ts +1 -0
- package/lib/Profile/LoginLink.d.ts +1 -0
- package/lib/Profile/Profile.js +1 -1
- package/lib/Profile/UserProfile.d.ts +1 -0
- package/lib/ReferenceDocs/ClearButton.d.ts +8 -0
- package/lib/ReferenceDocs/ClearButton.js +48 -0
- package/lib/ReferenceDocs/DevOnboardingTryItSecurity.d.ts +3 -0
- package/lib/ReferenceDocs/DevOnboardingTryItSecurity.js +158 -0
- package/lib/ReferenceDocs/Dropdown.d.ts +28 -0
- package/lib/ReferenceDocs/Dropdown.js +150 -0
- package/lib/ReferenceDocs/TryItSecurity.d.ts +7 -2
- package/lib/ReferenceDocs/TryItSecurity.js +11 -1
- package/lib/ReferenceDocs/index.d.ts +1 -0
- package/lib/ReferenceDocs/index.js +18 -0
- package/lib/Search/Parameters.d.ts +1 -0
- package/lib/Search/Search.d.ts +1 -0
- package/lib/Search/SearchItem.d.ts +1 -0
- package/lib/Search/ShortcutKey.d.ts +1 -0
- package/lib/Search/utils.d.ts +1 -0
- package/lib/Sidebar/ApiCallItem.d.ts +1 -0
- package/lib/Sidebar/ArrowBack.d.ts +1 -0
- package/lib/Sidebar/DrilldownMenuItem.d.ts +1 -0
- package/lib/Sidebar/ExternalIcon.d.ts +1 -0
- package/lib/Sidebar/FooterWrapper.d.ts +3 -0
- package/lib/Sidebar/FooterWrapper.js +15 -0
- package/lib/Sidebar/HeaderWrapper.d.ts +3 -0
- package/lib/Sidebar/HeaderWrapper.js +15 -0
- package/lib/Sidebar/MenuGroup.js +1 -1
- package/lib/Sidebar/MenuItem.d.ts +1 -0
- package/lib/Sidebar/Separator.d.ts +1 -0
- package/lib/Sidebar/SidebarLayout.d.ts +1 -1
- package/lib/Sidebar/SidebarLayout.js +5 -42
- package/lib/Sidebar/index.d.ts +2 -0
- package/lib/Sidebar/index.js +2 -0
- package/lib/SidebarLogo/SidebarLogo.d.ts +1 -0
- package/lib/SourceCode/SourceCode.d.ts +1 -0
- package/lib/TableOfContent/TableOfContent.d.ts +1 -0
- package/lib/globalStyle.js +2 -1
- package/lib/icons/AlertIcon/AlertIcon.d.ts +1 -0
- package/lib/icons/AnchorIcon/AnchorIcon.d.ts +7 -0
- package/lib/icons/AnchorIcon/AnchorIcon.js +23 -0
- package/lib/icons/AnchorIcon/index.d.ts +2 -0
- package/lib/icons/AnchorIcon/index.js +6 -0
- package/lib/icons/ArrowIcon/ArrowIcon.d.ts +2 -0
- package/lib/icons/ArrowIcon/ArrowIcon.js +1 -0
- package/lib/icons/ColorModeIcon/ColorModeIcon.d.ts +1 -0
- package/lib/icons/index.d.ts +1 -0
- package/lib/icons/index.js +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/mocks/Link.d.ts +1 -0
- package/lib/mocks/hooks/index.d.ts +1 -1
- package/lib/mocks/hooks/index.js +3 -1
- package/lib/mocks/useGlobalData.d.ts +1 -0
- package/lib/mocks/useGlobalData.js +9 -0
- package/lib/ui/Dropdown.d.ts +1 -0
- package/package.json +1 -1
- package/src/Button/Button.tsx +22 -5
- package/src/Catalog/Filter.tsx +1 -1
- package/src/Markdown/Admonition.tsx +13 -1
- package/src/Markdown/CodeSample/CodeSample.tsx +15 -2
- package/src/Markdown/Heading.tsx +12 -18
- package/src/Markdown/Mermaid.tsx +9 -1
- package/src/Profile/Profile.tsx +1 -1
- package/src/ReferenceDocs/ClearButton.tsx +30 -0
- package/src/ReferenceDocs/DevOnboardingTryItSecurity.tsx +161 -0
- package/src/ReferenceDocs/Dropdown.tsx +202 -0
- package/src/ReferenceDocs/TryItSecurity.tsx +16 -3
- package/src/ReferenceDocs/index.ts +1 -0
- package/src/Sidebar/FooterWrapper.tsx +9 -0
- package/src/Sidebar/HeaderWrapper.tsx +9 -0
- package/src/Sidebar/MenuGroup.tsx +4 -1
- package/src/Sidebar/SidebarLayout.tsx +2 -46
- package/src/Sidebar/index.ts +2 -0
- package/src/globalStyle.ts +2 -1
- package/src/icons/AnchorIcon/AnchorIcon.tsx +36 -0
- package/src/icons/AnchorIcon/index.ts +2 -0
- package/src/icons/ArrowIcon/ArrowIcon.tsx +2 -0
- package/src/icons/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/mocks/hooks/index.ts +2 -0
- package/src/mocks/useGlobalData.tsx +4 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DropdownOption {
|
|
3
|
+
idx?: number;
|
|
4
|
+
value: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
serverUrl?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DropdownProps {
|
|
10
|
+
options: DropdownOption[];
|
|
11
|
+
onChange: (option: DropdownOption) => void;
|
|
12
|
+
handleClear?: () => void;
|
|
13
|
+
clearable?: boolean;
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
dense?: boolean;
|
|
19
|
+
fullWidth?: boolean;
|
|
20
|
+
variant?: 'dark' | 'light';
|
|
21
|
+
}
|
|
22
|
+
export interface ArrowIconProps {
|
|
23
|
+
className?: string;
|
|
24
|
+
variant?: 'light' | 'dark';
|
|
25
|
+
style?: React.CSSProperties;
|
|
26
|
+
}
|
|
27
|
+
export declare const Dropdown: import("styled-components").StyledComponent<React.NamedExoticComponent<DropdownProps>, any, {}, never>;
|
|
28
|
+
export declare const normalizeText: (description?: string | Record<string, any>) => string;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.normalizeText = exports.Dropdown = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
|
+
const ClearButton_1 = require("./ClearButton");
|
|
33
|
+
const ArrowSvg = ({ className, style }) => (react_1.default.createElement("svg", { className: className, style: style, xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" },
|
|
34
|
+
react_1.default.createElement("polyline", { points: "6 9 12 15 18 9" })));
|
|
35
|
+
const ArrowIcon = (0, styled_components_1.default)(ArrowSvg) `
|
|
36
|
+
position: absolute;
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
z-index: 1;
|
|
39
|
+
top: 50%;
|
|
40
|
+
-webkit-transform: translateY(-50%);
|
|
41
|
+
-ms-transform: translateY(-50%);
|
|
42
|
+
transform: translateY(-50%);
|
|
43
|
+
right: 8px;
|
|
44
|
+
margin: auto;
|
|
45
|
+
text-align: center;
|
|
46
|
+
polyline {
|
|
47
|
+
color: ${(props) => props.variant === 'dark' && 'white'};
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
const DropdownComponent = ({ options, onChange, handleClear, clearable, placeholder, value = '', className, variant = 'light', }) => {
|
|
51
|
+
var _a;
|
|
52
|
+
const handleOnChange = (event) => {
|
|
53
|
+
const { selectedIndex } = event.target;
|
|
54
|
+
const index = placeholder || !value ? selectedIndex - 1 : selectedIndex;
|
|
55
|
+
onChange(options[index]);
|
|
56
|
+
};
|
|
57
|
+
const renderOptions = (0, react_1.useMemo)(() => options.map(({ idx, value, title }, index) => {
|
|
58
|
+
const normalizedValue = (0, exports.normalizeText)(value);
|
|
59
|
+
return (react_1.default.createElement("option", { key: idx || normalizedValue + index, value: normalizedValue, className: "dropdown-option" }, title || normalizedValue));
|
|
60
|
+
}), [options]);
|
|
61
|
+
const normalizedValue = (0, exports.normalizeText)(value);
|
|
62
|
+
const title = ((_a = options.find((option) => option.value === value)) === null || _a === void 0 ? void 0 : _a.title) || normalizedValue;
|
|
63
|
+
return (react_1.default.createElement("div", { className: className + ' dropdown-wrapper' },
|
|
64
|
+
react_1.default.createElement(ArrowIcon, { variant: variant }),
|
|
65
|
+
clearable && (normalizedValue === null || normalizedValue === void 0 ? void 0 : normalizedValue.length) > 0 && react_1.default.createElement(ClearButton_1.ClearButton, { handleClear: handleClear }),
|
|
66
|
+
react_1.default.createElement("select", { onChange: handleOnChange, value: normalizedValue, className: "dropdown-select" },
|
|
67
|
+
placeholder && (react_1.default.createElement("option", { disabled: true, hidden: true, value: placeholder }, placeholder)),
|
|
68
|
+
!normalizedValue && !placeholder && react_1.default.createElement("option", { disabled: true }),
|
|
69
|
+
renderOptions),
|
|
70
|
+
react_1.default.createElement("label", null, title)));
|
|
71
|
+
};
|
|
72
|
+
exports.Dropdown = (0, styled_components_1.default)((0, react_1.memo)(DropdownComponent)) `
|
|
73
|
+
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
outline: none;
|
|
76
|
+
display: inline-block;
|
|
77
|
+
border-radius: var(--border-radius);
|
|
78
|
+
vertical-align: bottom;
|
|
79
|
+
position: relative;
|
|
80
|
+
width: ${({ fullWidth }) => (fullWidth ? '100%' : 'auto')};
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
text-transform: none;
|
|
83
|
+
|
|
84
|
+
label {
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
min-width: 90px;
|
|
87
|
+
height: 36px;
|
|
88
|
+
outline: none;
|
|
89
|
+
display: inline-block;
|
|
90
|
+
color: var(--dropdown-text-color);
|
|
91
|
+
border-radius: var(--border-radius);
|
|
92
|
+
border: var(--dropdown-border);
|
|
93
|
+
padding: var(--dropdown-padding);
|
|
94
|
+
vertical-align: bottom;
|
|
95
|
+
width: ${({ fullWidth }) => (fullWidth ? '100%' : 'auto')};
|
|
96
|
+
text-transform: none;
|
|
97
|
+
line-height: inherit;
|
|
98
|
+
font-size: var(--dropdown-font-size);
|
|
99
|
+
font-family: inherit;
|
|
100
|
+
text-overflow: ellipsis;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
white-space: nowrap;
|
|
103
|
+
|
|
104
|
+
&,
|
|
105
|
+
&:hover,
|
|
106
|
+
&:focus-within {
|
|
107
|
+
border: 1px solid var(--border-color);
|
|
108
|
+
box-shadow: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
${({ variant }) => (variant === 'dark' ? darkDropdownStyle : '')};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.dropdown-select {
|
|
115
|
+
position: absolute;
|
|
116
|
+
top: 0;
|
|
117
|
+
left: 0;
|
|
118
|
+
width: 100%;
|
|
119
|
+
height: 100%;
|
|
120
|
+
opacity: 0;
|
|
121
|
+
border: none;
|
|
122
|
+
appearance: none;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
|
|
125
|
+
color: var(--text-color);
|
|
126
|
+
line-height: inherit;
|
|
127
|
+
font-size: 14px;
|
|
128
|
+
font-family: inherit;
|
|
129
|
+
padding: var(--dropdown-padding);
|
|
130
|
+
${({ variant }) => (variant === 'dark' ? darkDropdownStyle : '')};
|
|
131
|
+
|
|
132
|
+
`;
|
|
133
|
+
const darkDropdownStyle = `
|
|
134
|
+
background-color: var(--panel-samples-dropdown-background-color);
|
|
135
|
+
border: var(--panel-samples-dropdown-border);
|
|
136
|
+
color: var(--panel-samples-dropdown-color);
|
|
137
|
+
|
|
138
|
+
&,
|
|
139
|
+
&:hover,
|
|
140
|
+
&:focus-within {
|
|
141
|
+
border: none;
|
|
142
|
+
box-shadow: none;
|
|
143
|
+
}
|
|
144
|
+
`;
|
|
145
|
+
function isString(value) {
|
|
146
|
+
return typeof value === 'string';
|
|
147
|
+
}
|
|
148
|
+
const normalizeText = (description) => isString(description) ? description : description === null || description === void 0 ? void 0 : description.raw;
|
|
149
|
+
exports.normalizeText = normalizeText;
|
|
150
|
+
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type TryItSecurityProps = {
|
|
3
|
+
apiId?: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange: (newSecretKey: string) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function TryItSecurity(props: TryItSecurityProps): JSX.Element | null;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.TryItSecurity = void 0;
|
|
4
|
-
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const hooks_1 = require("../mocks/hooks");
|
|
9
|
+
const DevOnboardingTryItSecurity_1 = require("./DevOnboardingTryItSecurity");
|
|
10
|
+
function TryItSecurity(props) {
|
|
11
|
+
const { hasDeveloperOnboarding } = (0, hooks_1.useGlobalData)() || {};
|
|
12
|
+
return hasDeveloperOnboarding && props.apiId ? react_1.default.createElement(DevOnboardingTryItSecurity_1.DevOnboardingTryItSecurity, Object.assign({}, props)) : null;
|
|
13
|
+
}
|
|
14
|
+
exports.TryItSecurity = TryItSecurity;
|
|
5
15
|
//# sourceMappingURL=TryItSecurity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TryItSecurity';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./TryItSecurity"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
package/lib/Search/Search.d.ts
CHANGED
package/lib/Search/utils.d.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
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.FooterWrapper = void 0;
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
exports.FooterWrapper = styled_components_1.default.div.attrs(() => ({
|
|
9
|
+
'data-component-name': 'Sidebar/FooterWrapper',
|
|
10
|
+
})) `
|
|
11
|
+
margin: var(--sidebar-offset-top) 0 var(--sidebar-spacing-unit) var(--sidebar-offset-left);
|
|
12
|
+
padding-top: var(--sidebar-spacing-unit);
|
|
13
|
+
border-top: solid 1px #daddde;
|
|
14
|
+
`;
|
|
15
|
+
//# sourceMappingURL=FooterWrapper.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
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.HeaderWrapper = void 0;
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
exports.HeaderWrapper = styled_components_1.default.div.attrs(() => ({
|
|
9
|
+
'data-component-name': 'Sidebar/HeaderWrapper',
|
|
10
|
+
})) `
|
|
11
|
+
margin: var(--sidebar-offset-top) 0 0 var(--sidebar-offset-left);
|
|
12
|
+
padding-bottom: var(--sidebar-spacing-unit);
|
|
13
|
+
border-bottom: solid 1px #daddde;
|
|
14
|
+
`;
|
|
15
|
+
//# sourceMappingURL=HeaderWrapper.js.map
|
package/lib/Sidebar/MenuGroup.js
CHANGED
|
@@ -53,7 +53,7 @@ function MenuGroup({ item, isExpanded, toggleExpanded, children, }) {
|
|
|
53
53
|
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/MenuGroup" },
|
|
54
54
|
react_1.default.createElement(MenuLinkItem_1.MenuLinkItem, { item: item },
|
|
55
55
|
react_1.default.createElement(MenuGroupLabel, { onClick: toggleExpanded, isAlwaysExpanded: item.expanded === 'always', active: item.active },
|
|
56
|
-
react_1.default.createElement(MenuGroupArrow, { direction: isExpanded ? 'down' : 'right' }),
|
|
56
|
+
react_1.default.createElement(MenuGroupArrow, { visibility: item.items.length ? 'visible' : 'hidden', direction: isExpanded ? 'down' : 'right' }),
|
|
57
57
|
item.label)),
|
|
58
58
|
react_1.default.createElement(MenuWrapper, { isExpanded: isExpanded }, showChildren ? children : null),
|
|
59
59
|
item.separatorLine ? react_1.default.createElement(SeparatorLine_1.SeparatorLine, null) : null));
|
|
@@ -11,5 +11,5 @@ interface SidebarLayoutProps {
|
|
|
11
11
|
growContent?: boolean;
|
|
12
12
|
hasNavbar: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare function SidebarLayout({ versions, menu,
|
|
14
|
+
export declare function SidebarLayout({ versions, menu, footer, header, growContent, hasNavbar, }: SidebarLayoutProps): JSX.Element | null;
|
|
15
15
|
export {};
|
|
@@ -7,15 +7,14 @@ exports.SidebarLayout = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Sidebar_1 = require("../Sidebar/Sidebar");
|
|
10
|
+
const FooterWrapper_1 = require("../Sidebar/FooterWrapper");
|
|
11
|
+
const HeaderWrapper_1 = require("../Sidebar/HeaderWrapper");
|
|
10
12
|
const useMobileMenu_1 = require("../hooks/useMobileMenu");
|
|
11
13
|
const MobileSidebarButton_1 = require("../Sidebar/MobileSidebarButton");
|
|
12
14
|
const MenuContainer_1 = require("../Sidebar/MenuContainer");
|
|
13
15
|
const SidebarSearch_1 = require("../Search/SidebarSearch");
|
|
14
16
|
const useThemeConfig_1 = require("../hooks/useThemeConfig");
|
|
15
|
-
|
|
16
|
-
const Link_1 = require("../mocks/Link");
|
|
17
|
-
const Button_1 = require("../Button/Button");
|
|
18
|
-
function SidebarLayout({ versions, menu, backLink, footer, header, growContent, hasNavbar, }) {
|
|
17
|
+
function SidebarLayout({ versions, menu, footer, header, growContent, hasNavbar, }) {
|
|
19
18
|
const [isOpen, setIsOpen] = (0, useMobileMenu_1.useMobileMenu)();
|
|
20
19
|
const toggleMenu = () => setIsOpen(!isOpen);
|
|
21
20
|
const { search, sidebar } = (0, useThemeConfig_1.useThemeConfig)();
|
|
@@ -26,47 +25,11 @@ function SidebarLayout({ versions, menu, backLink, footer, header, growContent,
|
|
|
26
25
|
react_1.default.createElement(MobileSidebarButton_1.MobileSidebarButton, { opened: isOpen, onClick: toggleMenu }),
|
|
27
26
|
!(search === null || search === void 0 ? void 0 : search.hide) && (search === null || search === void 0 ? void 0 : search.placement) === 'sidebar' ? react_1.default.createElement(SidebarSearch_1.SidebarSearch, null) : null,
|
|
28
27
|
react_1.default.createElement(Sidebar_1.Sidebar, { animate: true, opened: isOpen, hasNavbar: hasNavbar },
|
|
29
|
-
header ? react_1.default.createElement(HeaderWrapper, null, header) : null,
|
|
30
|
-
(backLink && (react_1.default.createElement(BackLinkWrapper, null,
|
|
31
|
-
react_1.default.createElement(Link_1.Link, { to: backLink.slug },
|
|
32
|
-
react_1.default.createElement(ArrowBack_1.ArrowBack, null),
|
|
33
|
-
"Back to ",
|
|
34
|
-
backLink.label)))) ||
|
|
35
|
-
null,
|
|
28
|
+
header ? react_1.default.createElement(HeaderWrapper_1.HeaderWrapper, null, header) : null,
|
|
36
29
|
versions,
|
|
37
30
|
react_1.default.createElement(MenuContainer_1.MenuContainer, { growContent: growContent }, menu),
|
|
38
|
-
footer ? react_1.default.createElement(FooterWrapper, null, footer) : null)));
|
|
31
|
+
footer ? react_1.default.createElement(FooterWrapper_1.FooterWrapper, null, footer) : null)));
|
|
39
32
|
}
|
|
40
33
|
exports.SidebarLayout = SidebarLayout;
|
|
41
|
-
const FooterWrapper = styled_components_1.default.div `
|
|
42
|
-
padding: var(--sidebar-offset-top) var(--sidebar-item-padding-horizontal)
|
|
43
|
-
var(--sidebar-item-padding-horizontal) var(--sidebar-offset-left);
|
|
44
|
-
|
|
45
|
-
${Button_1.Button} {
|
|
46
|
-
width: 100%;
|
|
47
|
-
margin: 0;
|
|
48
|
-
}
|
|
49
|
-
`;
|
|
50
|
-
const HeaderWrapper = styled_components_1.default.div `
|
|
51
|
-
padding: var(--sidebar-offset-top) var(--sidebar-item-padding-horizontal)
|
|
52
|
-
var(--sidebar-item-padding-horizontal) var(--sidebar-offset-left);
|
|
53
|
-
`;
|
|
54
|
-
const BackLinkWrapper = styled_components_1.default.div `
|
|
55
|
-
padding: var(--sidebar-offset-top) var(--sidebar-item-padding-horizontal)
|
|
56
|
-
var(--sidebar-item-padding-horizontal)
|
|
57
|
-
calc(var(--sidebar-offset-left) + var(--sidebar-item-padding-horizontal));
|
|
58
|
-
|
|
59
|
-
a {
|
|
60
|
-
color: var(--sidebar-back-button-text-color);
|
|
61
|
-
font-size: var(--sidebar-back-button-font-size);
|
|
62
|
-
font-family: var(--sidebar-back-button-font-family);
|
|
63
|
-
text-decoration: none;
|
|
64
|
-
&:hover {
|
|
65
|
-
color: var(--sidebar-back-button-hover-text-color);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
border-bottom: 1px solid var(--sidebar-border-color);
|
|
70
|
-
`;
|
|
71
34
|
const Wrapper = styled_components_1.default.div ``;
|
|
72
35
|
//# sourceMappingURL=SidebarLayout.js.map
|
package/lib/Sidebar/index.d.ts
CHANGED
package/lib/Sidebar/index.js
CHANGED
|
@@ -33,4 +33,6 @@ __exportStar(require("../Sidebar/Separator"), exports);
|
|
|
33
33
|
__exportStar(require("../Sidebar/SeparatorItem"), exports);
|
|
34
34
|
__exportStar(require("../Sidebar/Sidebar"), exports);
|
|
35
35
|
__exportStar(require("../Sidebar/SidebarLayout"), exports);
|
|
36
|
+
__exportStar(require("../Sidebar/FooterWrapper"), exports);
|
|
37
|
+
__exportStar(require("../Sidebar/HeaderWrapper"), exports);
|
|
36
38
|
//# sourceMappingURL=index.js.map
|
package/lib/globalStyle.js
CHANGED
|
@@ -872,6 +872,7 @@ const apiReferencePanels = (0, styled_components_1.css) `
|
|
|
872
872
|
*/
|
|
873
873
|
|
|
874
874
|
.panel-try-it,
|
|
875
|
+
.panel-pull-right,
|
|
875
876
|
.panel-request-samples,
|
|
876
877
|
.panel-response-samples,
|
|
877
878
|
.panel-callback-samples {
|
|
@@ -1659,7 +1660,7 @@ const loadProgressBar = (0, styled_components_1.css) `
|
|
|
1659
1660
|
#nprogress .peg {
|
|
1660
1661
|
display: block;
|
|
1661
1662
|
position: absolute;
|
|
1662
|
-
right:
|
|
1663
|
+
right: 0;
|
|
1663
1664
|
width: 100px;
|
|
1664
1665
|
height: 100%;
|
|
1665
1666
|
box-shadow: var(--load-progress-bar-shadow);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface AnchorIconProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const AnchorIcon: import("styled-components").StyledComponent<({ className }: AnchorIconProps) => JSX.Element, any, {
|
|
6
|
+
'data-component-name': string;
|
|
7
|
+
}, "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.AnchorIcon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Icon = ({ className }) => (react_1.default.createElement("svg", { "aria-hidden": "true", focusable: "false", height: "16", version: "1.1", viewBox: "0 0 16 16", width: "16", className: className },
|
|
10
|
+
react_1.default.createElement("path", { fillRule: "evenodd", d: "M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" })));
|
|
11
|
+
exports.AnchorIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
12
|
+
'data-component-name': 'icons/AnchorIcon/AnchorIcon',
|
|
13
|
+
})) `
|
|
14
|
+
fill: var(--heading-anchor-color);
|
|
15
|
+
visibility: hidden;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
|
|
18
|
+
background-image: var(--heading-anchor-icon);
|
|
19
|
+
background-size: contain;
|
|
20
|
+
background-repeat: no-repeat;
|
|
21
|
+
background-position: center;
|
|
22
|
+
`;
|
|
23
|
+
//# sourceMappingURL=AnchorIcon.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnchorIcon = void 0;
|
|
4
|
+
var AnchorIcon_1 = require("../../icons/AnchorIcon/AnchorIcon");
|
|
5
|
+
Object.defineProperty(exports, "AnchorIcon", { enumerable: true, get: function () { return AnchorIcon_1.AnchorIcon; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface ArrowIconProps {
|
|
2
3
|
direction?: 'up' | 'right' | 'left' | 'down';
|
|
4
|
+
visibility?: 'visible' | 'hidden';
|
|
3
5
|
}
|
|
4
6
|
export declare const ArrowIcon: import("styled-components").StyledComponent<({ className }: {
|
|
5
7
|
className?: string | undefined;
|
|
@@ -26,6 +26,7 @@ exports.ArrowIcon = (0, styled_components_1.default)(Icon) `
|
|
|
26
26
|
height: var(--sidebar-group-item-chevron-size);
|
|
27
27
|
fill: var(--sidebar-group-item-chevron-color);
|
|
28
28
|
transform: rotate(${directionToTransform}deg);
|
|
29
|
+
visibility: ${({ visibility = 'visible' }) => visibility};
|
|
29
30
|
|
|
30
31
|
vertical-align: middle;
|
|
31
32
|
`;
|
package/lib/icons/index.d.ts
CHANGED
package/lib/icons/index.js
CHANGED
|
@@ -18,4 +18,5 @@ __exportStar(require("../icons/ShelfIcon"), exports);
|
|
|
18
18
|
__exportStar(require("../icons/AlertIcon"), exports);
|
|
19
19
|
__exportStar(require("../icons/ArrowIcon"), exports);
|
|
20
20
|
__exportStar(require("../icons/ColorModeIcon"), exports);
|
|
21
|
+
__exportStar(require("../icons/AnchorIcon"), exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -38,4 +38,6 @@ __exportStar(require("./Sidebar"), exports);
|
|
|
38
38
|
__exportStar(require("./types/config"), exports);
|
|
39
39
|
__exportStar(require("./config"), exports);
|
|
40
40
|
__exportStar(require("./Pages"), exports);
|
|
41
|
+
__exportStar(require("./Markdown"), exports);
|
|
42
|
+
__exportStar(require("./ReferenceDocs"), exports);
|
|
41
43
|
//# sourceMappingURL=index.js.map
|
package/lib/mocks/Link.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ export declare function useSidebarSiblingsData(): {
|
|
|
13
13
|
};
|
|
14
14
|
export declare function usePageSharedData<T = unknown>(_id: string): T;
|
|
15
15
|
export declare function useCatalog(_items: ResolvedNavItem[], _config: CatalogConfig): FilteredCatalog;
|
|
16
|
-
export {};
|
|
16
|
+
export { useGlobalData } from '../useGlobalData';
|
package/lib/mocks/hooks/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCatalog = exports.usePageSharedData = exports.useSidebarSiblingsData = exports.useThemeConfig = void 0;
|
|
3
|
+
exports.useGlobalData = exports.useCatalog = exports.usePageSharedData = exports.useSidebarSiblingsData = exports.useThemeConfig = void 0;
|
|
4
4
|
function useThemeConfig() {
|
|
5
5
|
return {
|
|
6
6
|
search: {
|
|
@@ -69,4 +69,6 @@ function useCatalog(_items, _config) {
|
|
|
69
69
|
throw new Error('Mock not implemented yet.');
|
|
70
70
|
}
|
|
71
71
|
exports.useCatalog = useCatalog;
|
|
72
|
+
var useGlobalData_1 = require("../useGlobalData");
|
|
73
|
+
Object.defineProperty(exports, "useGlobalData", { enumerable: true, get: function () { return useGlobalData_1.useGlobalData; } });
|
|
72
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useGlobalData(): Record<string, unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGlobalData = void 0;
|
|
4
|
+
function useGlobalData() {
|
|
5
|
+
console.log('>>>> mock');
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
exports.useGlobalData = useGlobalData;
|
|
9
|
+
//# sourceMappingURL=useGlobalData.js.map
|
package/lib/ui/Dropdown.d.ts
CHANGED