@redocly/theme 0.39.1 → 0.40.1
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/Dropdown/Dropdown.js +2 -1
- package/lib/components/Footer/FooterCopyright.js +2 -2
- package/lib/components/LastUpdated/LastUpdated.js +2 -2
- package/lib/components/Navbar/Navbar.js +2 -2
- package/lib/components/Navbar/NavbarItem.js +2 -2
- package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +2 -2
- package/lib/core/hooks/__mocks__/use-theme-hooks.js +2 -2
- package/lib/core/hooks/menu/use-mobile-menu-items.js +2 -2
- package/lib/core/hooks/use-language-picker.d.ts +3 -3
- package/lib/core/hooks/use-language-picker.js +2 -2
- package/lib/core/types/hooks.d.ts +12 -2
- package/lib/core/types/index.d.ts +1 -1
- package/lib/core/types/index.js +1 -1
- package/lib/core/types/{i18n.js → l10n.js} +1 -1
- package/lib/icons/CloseOutlineIcon/CloseOutlineIcon.d.ts +9 -0
- package/lib/icons/CloseOutlineIcon/CloseOutlineIcon.js +24 -0
- package/lib/icons/DocumentAddIcon/DocumentAddIcon.d.ts +9 -0
- package/lib/icons/DocumentAddIcon/DocumentAddIcon.js +23 -0
- package/lib/icons/ExportIcon/ExportIcon.d.ts +9 -0
- package/lib/icons/ExportIcon/ExportIcon.js +23 -0
- package/lib/icons/FolderIcon/FolderIcon.d.ts +9 -0
- package/lib/icons/FolderIcon/FolderIcon.js +22 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/package.json +2 -2
- package/src/components/Dropdown/Dropdown.tsx +10 -10
- package/src/components/Footer/FooterCopyright.tsx +2 -2
- package/src/components/LastUpdated/LastUpdated.tsx +2 -2
- package/src/components/Navbar/Navbar.tsx +2 -2
- package/src/components/Navbar/NavbarItem.tsx +2 -2
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +2 -2
- package/src/core/hooks/menu/use-mobile-menu-items.ts +2 -2
- package/src/core/hooks/use-language-picker.ts +5 -5
- package/src/core/types/hooks.ts +12 -2
- package/src/core/types/index.ts +1 -1
- package/src/icons/CloseOutlineIcon/CloseOutlineIcon.tsx +26 -0
- package/src/icons/DocumentAddIcon/DocumentAddIcon.tsx +24 -0
- package/src/icons/ExportIcon/ExportIcon.tsx +24 -0
- package/src/icons/FolderIcon/FolderIcon.tsx +23 -0
- package/src/index.ts +4 -0
- /package/lib/core/types/{i18n.d.ts → l10n.d.ts} +0 -0
- /package/src/core/types/{i18n.ts → l10n.ts} +0 -0
|
@@ -59,7 +59,7 @@ function Dropdown({ children, className, active, trigger, triggerEvent = 'click'
|
|
|
59
59
|
const dropdownTrigger = (0, react_1.cloneElement)(triggerChild, Object.assign(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' } : {})), { tabIndex: 0 }), triggerChild.props), { onKeyDown: triggerEvent === 'click' ? handleKeyDown : undefined }));
|
|
60
60
|
return (react_1.default.createElement(DropdownWrapper, Object.assign({ "data-component-name": "Dropdown/Dropdown", "data-testid": "dropdown" }, dataAttributes, { className: className, ref: dropdownRef, onPointerEnter: triggerEvent === 'hover' ? handleOpen : undefined, onPointerLeave: triggerEvent === 'hover' ? handleClose : undefined, onClick: onClick }),
|
|
61
61
|
dropdownTrigger,
|
|
62
|
-
|
|
62
|
+
react_1.default.createElement(ChildrenWrapper, { placement: placement, alignment: alignment, isOpen: isOpen, onClick: closeOnClick ? handleChildClick : undefined }, children)));
|
|
63
63
|
}
|
|
64
64
|
exports.Dropdown = Dropdown;
|
|
65
65
|
const DropdownWrapper = styled_components_1.default.div `
|
|
@@ -84,6 +84,7 @@ const ChildrenWrapper = styled_components_1.default.div `
|
|
|
84
84
|
bottom: ${({ placement }) => (placement === 'top' ? '100%' : 'auto')};
|
|
85
85
|
left: ${({ alignment }) => (alignment === 'start' ? '0' : 'auto')};
|
|
86
86
|
right: ${({ alignment }) => (alignment === 'end' ? '0' : 'auto')};
|
|
87
|
+
display: ${({ isOpen }) => (isOpen ? 'block' : 'none')};
|
|
87
88
|
|
|
88
89
|
z-index: var(--z-index-raised);
|
|
89
90
|
`;
|
|
@@ -9,9 +9,9 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
9
9
|
const hooks_1 = require("../../core/hooks");
|
|
10
10
|
const LanguagePicker_1 = require("../../components/LanguagePicker/LanguagePicker");
|
|
11
11
|
function FooterCopyright({ copyrightText = '', className, }) {
|
|
12
|
-
const { useTranslate,
|
|
12
|
+
const { useTranslate, useL10n } = (0, hooks_1.useThemeHooks)();
|
|
13
13
|
const { translate } = useTranslate();
|
|
14
|
-
const { changeLanguage } =
|
|
14
|
+
const { changeLanguage } = useL10n();
|
|
15
15
|
return copyrightText ? (react_1.default.createElement(FooterCopyrightWrapper, { className: className, "data-component-name": "Footer/FooterCopyright", "data-translation-key": "theme.footer.copyrightText" },
|
|
16
16
|
react_1.default.createElement(FooterCopyrightLabel, { "data-translation-key": "theme.footer.copyrightText" }, translate('theme.footer.copyrightText', copyrightText)),
|
|
17
17
|
react_1.default.createElement(LanguagePicker_1.LanguagePicker, { onChangeLanguage: changeLanguage, placement: "top", alignment: "end" }))) : null;
|
|
@@ -40,9 +40,9 @@ const FORMATS = {
|
|
|
40
40
|
};
|
|
41
41
|
function LastUpdated(props) {
|
|
42
42
|
const { markdown: { lastUpdatedBlock = {} } = {} } = (0, hooks_1.useThemeConfig)();
|
|
43
|
-
const { useTranslate,
|
|
43
|
+
const { useTranslate, useL10nConfig } = (0, hooks_1.useThemeHooks)();
|
|
44
44
|
const { translate } = useTranslate();
|
|
45
|
-
const { currentLocale } =
|
|
45
|
+
const { currentLocale } = useL10nConfig();
|
|
46
46
|
if (lastUpdatedBlock === null || lastUpdatedBlock === void 0 ? void 0 : lastUpdatedBlock.hide) {
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
@@ -23,8 +23,8 @@ function Navbar({ className }) {
|
|
|
23
23
|
var _a;
|
|
24
24
|
const { isOpen, openMobileMenu, closeMobileMenu } = (0, hooks_1.useMobileMenu)(false);
|
|
25
25
|
const themeConfig = (0, hooks_1.useThemeConfig)();
|
|
26
|
-
const {
|
|
27
|
-
const { changeLanguage } =
|
|
26
|
+
const { useL10n, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
27
|
+
const { changeLanguage } = useL10n();
|
|
28
28
|
const telemetry = useTelemetry();
|
|
29
29
|
const menu = (_a = themeConfig.navbar) === null || _a === void 0 ? void 0 : _a.items;
|
|
30
30
|
const { search: searchSettings, navbar, userMenu: userMenuSettings, logo } = themeConfig;
|
|
@@ -39,9 +39,9 @@ const Link_1 = require("../../components/Link/Link");
|
|
|
39
39
|
const Dropdown_1 = require("../../components/Dropdown/Dropdown");
|
|
40
40
|
function NavbarItem({ navItem, className }) {
|
|
41
41
|
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
42
|
-
const { useTranslate,
|
|
42
|
+
const { useTranslate, useL10nConfig, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
43
43
|
const { translate } = useTranslate();
|
|
44
|
-
const { defaultLocale, currentLocale, locales } =
|
|
44
|
+
const { defaultLocale, currentLocale, locales } = useL10nConfig();
|
|
45
45
|
const telemetry = useTelemetry();
|
|
46
46
|
if (navItem.type !== 'link' && !navItem.items)
|
|
47
47
|
return null;
|
|
@@ -14,10 +14,10 @@ export declare const useThemeHooks: jest.Mock<{
|
|
|
14
14
|
filterTerm: string;
|
|
15
15
|
setFilterTerm: jest.Mock<any, any, any>;
|
|
16
16
|
}, [], any>;
|
|
17
|
-
|
|
17
|
+
useL10n: jest.Mock<{
|
|
18
18
|
changeLanguage: jest.Mock<any, any, any>;
|
|
19
19
|
}, [], any>;
|
|
20
|
-
|
|
20
|
+
useL10nConfig: jest.Mock<{
|
|
21
21
|
currentLocale: string;
|
|
22
22
|
defaultLocale: string;
|
|
23
23
|
locales: {
|
|
@@ -20,10 +20,10 @@ exports.useThemeHooks = jest.fn(() => ({
|
|
|
20
20
|
filterTerm: '',
|
|
21
21
|
setFilterTerm: jest.fn(),
|
|
22
22
|
})),
|
|
23
|
-
|
|
23
|
+
useL10n: jest.fn(() => ({
|
|
24
24
|
changeLanguage: jest.fn(),
|
|
25
25
|
})),
|
|
26
|
-
|
|
26
|
+
useL10nConfig: jest.fn(() => ({
|
|
27
27
|
currentLocale: 'en',
|
|
28
28
|
defaultLocale: 'en',
|
|
29
29
|
locales: [
|
|
@@ -11,9 +11,9 @@ const MENU_SEPARATOR = {
|
|
|
11
11
|
};
|
|
12
12
|
const useMobileMenuItems = (menuType) => {
|
|
13
13
|
var _a, _b, _c;
|
|
14
|
-
const { useTranslate,
|
|
14
|
+
const { useTranslate, useL10nConfig, useCurrentProduct, usePageVersions, useSidebarItems } = (0, hooks_1.useThemeHooks)();
|
|
15
15
|
const { versions = [] } = usePageVersions() || {};
|
|
16
|
-
const { defaultLocale, currentLocale, locales } =
|
|
16
|
+
const { defaultLocale, currentLocale, locales } = useL10nConfig();
|
|
17
17
|
const { translate } = useTranslate();
|
|
18
18
|
const activeVersion = versions.find((version) => version.active);
|
|
19
19
|
const { currentItems: sidebarItems, pushDrilldownState, popDrilldownState, backLink, } = useSidebarItems(activeVersion);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { L10nConfig } from '../../core/types';
|
|
2
2
|
export declare function useLanguagePicker(): {
|
|
3
|
-
currentLocale:
|
|
4
|
-
locales:
|
|
3
|
+
currentLocale: L10nConfig['locales'][number] | undefined;
|
|
4
|
+
locales: L10nConfig['locales'];
|
|
5
5
|
setLocale: (value: string) => void;
|
|
6
6
|
};
|
|
@@ -4,9 +4,9 @@ exports.useLanguagePicker = void 0;
|
|
|
4
4
|
const hooks_1 = require("../../core/hooks");
|
|
5
5
|
const utils_1 = require("../../core/utils");
|
|
6
6
|
function useLanguagePicker() {
|
|
7
|
-
const {
|
|
7
|
+
const { useL10nConfig, usePreloadHistory } = (0, hooks_1.useThemeHooks)();
|
|
8
8
|
const history = usePreloadHistory();
|
|
9
|
-
const { currentLocale, locales, defaultLocale } =
|
|
9
|
+
const { currentLocale, locales, defaultLocale } = useL10nConfig();
|
|
10
10
|
const locale = locales.find((l) => l.code === currentLocale);
|
|
11
11
|
function setLocale(value) {
|
|
12
12
|
const newLangPathname = (0, utils_1.withPathPrefix)((0, utils_1.getPathnameForLocale)(location.pathname, defaultLocale, value, locales));
|
|
@@ -7,10 +7,20 @@ export type ThemeHooks = {
|
|
|
7
7
|
useTranslate: () => {
|
|
8
8
|
translate: TFunction;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated use `useL10n` instead
|
|
12
|
+
* */
|
|
10
13
|
useI18n: () => {
|
|
11
14
|
changeLanguage: (lng?: string | undefined, callback?: Callback | undefined) => Promise<TFunc>;
|
|
12
15
|
};
|
|
13
|
-
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated use `useL10nConfig` instead
|
|
18
|
+
* */
|
|
19
|
+
useI18nConfig: () => L10nConfig;
|
|
20
|
+
useL10n: () => {
|
|
21
|
+
changeLanguage: (lng?: string | undefined, callback?: Callback | undefined) => Promise<TFunc>;
|
|
22
|
+
};
|
|
23
|
+
useL10nConfig: () => L10nConfig;
|
|
14
24
|
useCurrentProduct: () => ProductUiConfig | undefined;
|
|
15
25
|
useProducts: () => ProductUiConfig[];
|
|
16
26
|
usePageVersions: () => {
|
|
@@ -62,7 +72,7 @@ export type ThemeHooks = {
|
|
|
62
72
|
useUserTeams: () => string[];
|
|
63
73
|
usePageProps: <T extends Record<string, unknown>>() => PageProps & T;
|
|
64
74
|
};
|
|
65
|
-
export type
|
|
75
|
+
export type L10nConfig = {
|
|
66
76
|
currentLocale: string;
|
|
67
77
|
defaultLocale: string;
|
|
68
78
|
locales: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '../../core/types/breadcrumb';
|
|
2
2
|
export * from '../../core/types/catalog';
|
|
3
|
-
export * from '../../core/types/
|
|
3
|
+
export * from '../../core/types/l10n';
|
|
4
4
|
export * from '../../core/types/feedback';
|
|
5
5
|
export * from '../../core/types/hooks';
|
|
6
6
|
export * from '../../core/types/markdown';
|
package/lib/core/types/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("../../core/types/breadcrumb"), exports);
|
|
18
18
|
__exportStar(require("../../core/types/catalog"), exports);
|
|
19
|
-
__exportStar(require("../../core/types/
|
|
19
|
+
__exportStar(require("../../core/types/l10n"), exports);
|
|
20
20
|
__exportStar(require("../../core/types/feedback"), exports);
|
|
21
21
|
__exportStar(require("../../core/types/hooks"), exports);
|
|
22
22
|
__exportStar(require("../../core/types/markdown"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const CloseOutlineIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
|
|
4
|
+
'data-component-name': string;
|
|
5
|
+
} & {
|
|
6
|
+
color?: string | undefined;
|
|
7
|
+
size?: string | undefined;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
} & React.SVGProps<SVGSVGElement>, "data-component-name">;
|
|
@@ -0,0 +1,24 @@
|
|
|
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.CloseOutlineIcon = 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({ xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "none" }, props),
|
|
11
|
+
react_1.default.createElement("g", null,
|
|
12
|
+
react_1.default.createElement("path", { d: "M7 0.875C3.5875 0.875 0.875 3.5875 0.875 7C0.875 10.4125 3.5875 13.125 7 13.125C10.4125 13.125 13.125 10.4125 13.125 7C13.125 3.5875 10.4125 0.875 7 0.875ZM7 12.25C4.1125 12.25 1.75 9.8875 1.75 7C1.75 4.1125 4.1125 1.75 7 1.75C9.8875 1.75 12.25 4.1125 12.25 7C12.25 9.8875 9.8875 12.25 7 12.25Z" }),
|
|
13
|
+
react_1.default.createElement("path", { d: "M9.3625 10.0625L7 7.7L4.6375 10.0625L3.9375 9.3625L6.3 7L3.9375 4.6375L4.6375 3.9375L7 6.3L9.3625 3.9375L10.0625 4.6375L7.7 7L10.0625 9.3625L9.3625 10.0625Z" }))));
|
|
14
|
+
exports.CloseOutlineIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
15
|
+
'data-component-name': 'icons/CloseOutlineIcon/CloseOutlineIcon',
|
|
16
|
+
})) `
|
|
17
|
+
path {
|
|
18
|
+
fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
19
|
+
}
|
|
20
|
+
height: ${({ size }) => size || '16px'};
|
|
21
|
+
width: ${({ size }) => size || '16px'};
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
`;
|
|
24
|
+
//# sourceMappingURL=CloseOutlineIcon.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const DocumentAddIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
|
|
4
|
+
'data-component-name': string;
|
|
5
|
+
} & {
|
|
6
|
+
color?: string | undefined;
|
|
7
|
+
size?: string | undefined;
|
|
8
|
+
className?: string | undefined;
|
|
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.DocumentAddIcon = 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", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
11
|
+
react_1.default.createElement("path", { d: "M15 11.9999H13V9.99993H12V11.9999H10V12.9999H12V14.9999H13V12.9999H15V11.9999Z" }),
|
|
12
|
+
react_1.default.createElement("path", { d: "M8 13.9999H4V1.99993H8V4.99993C8.00077 5.26491 8.10637 5.51882 8.29374 5.70619C8.48111 5.89356 8.73502 5.99916 9 5.99993H12V7.99993H13V4.99993C13.0018 4.93421 12.9893 4.86889 12.9634 4.80847C12.9375 4.74804 12.8988 4.69395 12.85 4.64993L9.35 1.14993C9.30599 1.10109 9.2519 1.06239 9.19147 1.03649C9.13104 1.01059 9.06572 0.99812 9 0.999928H4C3.73502 1.00069 3.48111 1.1063 3.29374 1.29367C3.10637 1.48104 3.00077 1.73495 3 1.99993V13.9999C3.00077 14.2649 3.10637 14.5188 3.29374 14.7062C3.48111 14.8936 3.73502 14.9992 4 14.9999H8V13.9999ZM9 2.19993L11.8 4.99993H9V2.19993Z" })));
|
|
13
|
+
exports.DocumentAddIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
14
|
+
'data-component-name': 'icons/DocumentAddIcon/DocumentAddIcon',
|
|
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=DocumentAddIcon.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const ExportIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
|
|
4
|
+
'data-component-name': string;
|
|
5
|
+
} & {
|
|
6
|
+
color?: string | undefined;
|
|
7
|
+
size?: string | undefined;
|
|
8
|
+
className?: string | undefined;
|
|
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.ExportIcon = 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", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
11
|
+
react_1.default.createElement("path", { d: "M13 12V14H3V12H2V14L2.0038 13.9976C2.00333 14.1288 2.02873 14.2589 2.07854 14.3803C2.12836 14.5017 2.20163 14.6121 2.29414 14.7052C2.38666 14.7983 2.49662 14.8723 2.61774 14.9229C2.73885 14.9734 2.86875 14.9997 3 15H13C13.2652 15 13.5196 14.8946 13.7071 14.7071C13.8946 14.5196 14 14.2652 14 14V12H13Z" }),
|
|
12
|
+
react_1.default.createElement("path", { d: "M3 6L3.7055 6.7025L7.5 2.9125V12H8.5V2.9125L12.2955 6.7025L13 6L8 1L3 6Z" })));
|
|
13
|
+
exports.ExportIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
14
|
+
'data-component-name': 'icons/ExportIcon/ExportIcon',
|
|
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=ExportIcon.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const FolderIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
|
|
4
|
+
'data-component-name': string;
|
|
5
|
+
} & {
|
|
6
|
+
color?: string | undefined;
|
|
7
|
+
size?: string | undefined;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
} & React.SVGProps<SVGSVGElement>, "data-component-name">;
|
|
@@ -0,0 +1,22 @@
|
|
|
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.FolderIcon = 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({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 14 14", fill: "none" }, props),
|
|
11
|
+
react_1.default.createElement("path", { d: "M4.88688 2.625L6.38313 4.11688L6.63688 4.375H12.25V11.375H1.75V2.625H4.88688ZM4.88688 1.75H1.75C1.51794 1.75 1.29538 1.84219 1.13128 2.00628C0.967187 2.17038 0.875 2.39294 0.875 2.625V11.375C0.875 11.6071 0.967187 11.8296 1.13128 11.9937C1.29538 12.1578 1.51794 12.25 1.75 12.25H12.25C12.4821 12.25 12.7046 12.1578 12.8687 11.9937C13.0328 11.8296 13.125 11.6071 13.125 11.375V4.375C13.125 4.14294 13.0328 3.92038 12.8687 3.75628C12.7046 3.59219 12.4821 3.5 12.25 3.5H7L5.50813 2.00813C5.42672 1.92624 5.32992 1.86127 5.2233 1.81697C5.11667 1.77267 5.00234 1.74991 4.88688 1.75Z" })));
|
|
12
|
+
exports.FolderIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
13
|
+
'data-component-name': 'icons/FolderIcon/FolderIcon',
|
|
14
|
+
})) `
|
|
15
|
+
path {
|
|
16
|
+
fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
height: ${({ size }) => size || '16px'};
|
|
20
|
+
width: ${({ size }) => size || '16px'};
|
|
21
|
+
`;
|
|
22
|
+
//# sourceMappingURL=FolderIcon.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -123,9 +123,11 @@ export * from './icons/CleanIcon/CleanIcon';
|
|
|
123
123
|
export * from './icons/DeselectIcon/DeselectIcon';
|
|
124
124
|
export * from './icons/FileStorageIcon/FileStorageIcon';
|
|
125
125
|
export * from './icons/FolderAddIcon/FolderAddIcon';
|
|
126
|
+
export * from './icons/FolderIcon/FolderIcon';
|
|
126
127
|
export * from './icons/FolderMoveToIcon/FolderMoveToIcon';
|
|
127
128
|
export * from './icons/SelectIcon/SelectIcon';
|
|
128
129
|
export * from './icons/CloseIcon/CloseIcon';
|
|
130
|
+
export * from './icons/CloseOutlineIcon/CloseOutlineIcon';
|
|
129
131
|
export * from './icons/CloseFilledIcon/CloseFilledIcon';
|
|
130
132
|
export * from './icons/LogoutIcon/LogoutIcon';
|
|
131
133
|
export * from './icons/CheckboxIcon/CheckboxIcon';
|
|
@@ -136,6 +138,7 @@ export * from './icons/DataFormatIcon/DataFormatIcon';
|
|
|
136
138
|
export * from './icons/Spinner/Spinner';
|
|
137
139
|
export * from './icons/CheckmarkIcon/CheckmarkIcon';
|
|
138
140
|
export * from './icons/DownloadIcon/DownloadIcon';
|
|
141
|
+
export * from './icons/DocumentAddIcon/DocumentAddIcon';
|
|
139
142
|
export * from './icons/EmailIcon/EmailIcon';
|
|
140
143
|
export * from './icons/SaveIcon/SaveIcon';
|
|
141
144
|
export * from './icons/CloudUploadIcon/CloudUploadIcon';
|
|
@@ -198,6 +201,7 @@ export * from './icons/SubtractIcon/SubtractIcon';
|
|
|
198
201
|
export * from './icons/PlusCustomIcon/PlusCustomIcon';
|
|
199
202
|
export * from './icons/CharacterIcon/CharacterIcon';
|
|
200
203
|
export * from './icons/FileIcon/FileIcon';
|
|
204
|
+
export * from './icons/ExportIcon/ExportIcon';
|
|
201
205
|
export * from './layouts/RootLayout';
|
|
202
206
|
export * from './layouts/PageLayout';
|
|
203
207
|
export * from './layouts/NotFound';
|
package/lib/index.js
CHANGED
|
@@ -175,9 +175,11 @@ __exportStar(require("./icons/CleanIcon/CleanIcon"), exports);
|
|
|
175
175
|
__exportStar(require("./icons/DeselectIcon/DeselectIcon"), exports);
|
|
176
176
|
__exportStar(require("./icons/FileStorageIcon/FileStorageIcon"), exports);
|
|
177
177
|
__exportStar(require("./icons/FolderAddIcon/FolderAddIcon"), exports);
|
|
178
|
+
__exportStar(require("./icons/FolderIcon/FolderIcon"), exports);
|
|
178
179
|
__exportStar(require("./icons/FolderMoveToIcon/FolderMoveToIcon"), exports);
|
|
179
180
|
__exportStar(require("./icons/SelectIcon/SelectIcon"), exports);
|
|
180
181
|
__exportStar(require("./icons/CloseIcon/CloseIcon"), exports);
|
|
182
|
+
__exportStar(require("./icons/CloseOutlineIcon/CloseOutlineIcon"), exports);
|
|
181
183
|
__exportStar(require("./icons/CloseFilledIcon/CloseFilledIcon"), exports);
|
|
182
184
|
__exportStar(require("./icons/LogoutIcon/LogoutIcon"), exports);
|
|
183
185
|
__exportStar(require("./icons/CheckboxIcon/CheckboxIcon"), exports);
|
|
@@ -188,6 +190,7 @@ __exportStar(require("./icons/DataFormatIcon/DataFormatIcon"), exports);
|
|
|
188
190
|
__exportStar(require("./icons/Spinner/Spinner"), exports);
|
|
189
191
|
__exportStar(require("./icons/CheckmarkIcon/CheckmarkIcon"), exports);
|
|
190
192
|
__exportStar(require("./icons/DownloadIcon/DownloadIcon"), exports);
|
|
193
|
+
__exportStar(require("./icons/DocumentAddIcon/DocumentAddIcon"), exports);
|
|
191
194
|
__exportStar(require("./icons/EmailIcon/EmailIcon"), exports);
|
|
192
195
|
__exportStar(require("./icons/SaveIcon/SaveIcon"), exports);
|
|
193
196
|
__exportStar(require("./icons/CloudUploadIcon/CloudUploadIcon"), exports);
|
|
@@ -250,6 +253,7 @@ __exportStar(require("./icons/SubtractIcon/SubtractIcon"), exports);
|
|
|
250
253
|
__exportStar(require("./icons/PlusCustomIcon/PlusCustomIcon"), exports);
|
|
251
254
|
__exportStar(require("./icons/CharacterIcon/CharacterIcon"), exports);
|
|
252
255
|
__exportStar(require("./icons/FileIcon/FileIcon"), exports);
|
|
256
|
+
__exportStar(require("./icons/ExportIcon/ExportIcon"), exports);
|
|
253
257
|
/* Layouts */
|
|
254
258
|
__exportStar(require("./layouts/RootLayout"), exports);
|
|
255
259
|
__exportStar(require("./layouts/PageLayout"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.1",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"timeago.js": "^4.0.2",
|
|
99
99
|
"i18next": "^22.4.12",
|
|
100
100
|
"nprogress": "^0.2.0",
|
|
101
|
-
"@redocly/config": "0.
|
|
101
|
+
"@redocly/config": "0.9.0"
|
|
102
102
|
},
|
|
103
103
|
"scripts": {
|
|
104
104
|
"start": "npm-run-all --parallel storybook storybook:tokens:watch",
|
|
@@ -89,15 +89,14 @@ export function Dropdown({
|
|
|
89
89
|
>
|
|
90
90
|
{dropdownTrigger}
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
)}
|
|
92
|
+
<ChildrenWrapper
|
|
93
|
+
placement={placement}
|
|
94
|
+
alignment={alignment}
|
|
95
|
+
isOpen={isOpen}
|
|
96
|
+
onClick={closeOnClick ? handleChildClick : undefined}
|
|
97
|
+
>
|
|
98
|
+
{children}
|
|
99
|
+
</ChildrenWrapper>
|
|
101
100
|
</DropdownWrapper>
|
|
102
101
|
);
|
|
103
102
|
}
|
|
@@ -119,12 +118,13 @@ const DropdownWrapper = styled.div`
|
|
|
119
118
|
text-decoration: none;
|
|
120
119
|
`;
|
|
121
120
|
|
|
122
|
-
const ChildrenWrapper = styled.div<{ placement?: string; alignment?: string }>`
|
|
121
|
+
const ChildrenWrapper = styled.div<{ placement?: string; alignment?: string; isOpen?: boolean }>`
|
|
123
122
|
position: absolute;
|
|
124
123
|
top: ${({ placement }) => (placement === 'top' ? 'auto' : '100%')};
|
|
125
124
|
bottom: ${({ placement }) => (placement === 'top' ? '100%' : 'auto')};
|
|
126
125
|
left: ${({ alignment }) => (alignment === 'start' ? '0' : 'auto')};
|
|
127
126
|
right: ${({ alignment }) => (alignment === 'end' ? '0' : 'auto')};
|
|
127
|
+
display: ${({ isOpen }) => (isOpen ? 'block' : 'none')};
|
|
128
128
|
|
|
129
129
|
z-index: var(--z-index-raised);
|
|
130
130
|
`;
|
|
@@ -13,9 +13,9 @@ export function FooterCopyright({
|
|
|
13
13
|
copyrightText = '',
|
|
14
14
|
className,
|
|
15
15
|
}: FooterCopyrightProps): JSX.Element | null {
|
|
16
|
-
const { useTranslate,
|
|
16
|
+
const { useTranslate, useL10n } = useThemeHooks();
|
|
17
17
|
const { translate } = useTranslate();
|
|
18
|
-
const { changeLanguage } =
|
|
18
|
+
const { changeLanguage } = useL10n();
|
|
19
19
|
|
|
20
20
|
return copyrightText ? (
|
|
21
21
|
<FooterCopyrightWrapper
|
|
@@ -23,9 +23,9 @@ export type LastUpdatedProps = {
|
|
|
23
23
|
|
|
24
24
|
export function LastUpdated(props: LastUpdatedProps): JSX.Element | null {
|
|
25
25
|
const { markdown: { lastUpdatedBlock = {} } = {} } = useThemeConfig();
|
|
26
|
-
const { useTranslate,
|
|
26
|
+
const { useTranslate, useL10nConfig } = useThemeHooks();
|
|
27
27
|
const { translate } = useTranslate();
|
|
28
|
-
const { currentLocale } =
|
|
28
|
+
const { currentLocale } = useL10nConfig();
|
|
29
29
|
|
|
30
30
|
if (lastUpdatedBlock?.hide) {
|
|
31
31
|
return null;
|
|
@@ -24,8 +24,8 @@ export type NavbarProps = {
|
|
|
24
24
|
export function Navbar({ className }: NavbarProps): JSX.Element | null {
|
|
25
25
|
const { isOpen, openMobileMenu, closeMobileMenu } = useMobileMenu(false);
|
|
26
26
|
const themeConfig = useThemeConfig();
|
|
27
|
-
const {
|
|
28
|
-
const { changeLanguage } =
|
|
27
|
+
const { useL10n, useTelemetry } = useThemeHooks();
|
|
28
|
+
const { changeLanguage } = useL10n();
|
|
29
29
|
const telemetry = useTelemetry();
|
|
30
30
|
|
|
31
31
|
const menu = themeConfig.navbar?.items;
|
|
@@ -20,9 +20,9 @@ export type NavbarItemProps = {
|
|
|
20
20
|
|
|
21
21
|
export function NavbarItem({ navItem, className }: NavbarItemProps): JSX.Element | null {
|
|
22
22
|
const { pathname } = useLocation();
|
|
23
|
-
const { useTranslate,
|
|
23
|
+
const { useTranslate, useL10nConfig, useTelemetry } = useThemeHooks();
|
|
24
24
|
const { translate } = useTranslate();
|
|
25
|
-
const { defaultLocale, currentLocale, locales } =
|
|
25
|
+
const { defaultLocale, currentLocale, locales } = useL10nConfig();
|
|
26
26
|
const telemetry = useTelemetry();
|
|
27
27
|
|
|
28
28
|
if (navItem.type !== 'link' && !navItem.items) return null;
|
|
@@ -19,10 +19,10 @@ export const useThemeHooks = jest.fn(() => ({
|
|
|
19
19
|
filterTerm: '',
|
|
20
20
|
setFilterTerm: jest.fn(),
|
|
21
21
|
})),
|
|
22
|
-
|
|
22
|
+
useL10n: jest.fn(() => ({
|
|
23
23
|
changeLanguage: jest.fn(),
|
|
24
24
|
})),
|
|
25
|
-
|
|
25
|
+
useL10nConfig: jest.fn(() => ({
|
|
26
26
|
currentLocale: 'en',
|
|
27
27
|
defaultLocale: 'en',
|
|
28
28
|
locales: [
|
|
@@ -16,10 +16,10 @@ const MENU_SEPARATOR: ResolvedNavItem = {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export const useMobileMenuItems = (menuType: MobileMenuType) => {
|
|
19
|
-
const { useTranslate,
|
|
19
|
+
const { useTranslate, useL10nConfig, useCurrentProduct, usePageVersions, useSidebarItems } =
|
|
20
20
|
useThemeHooks();
|
|
21
21
|
const { versions = [] } = usePageVersions() || {};
|
|
22
|
-
const { defaultLocale, currentLocale, locales } =
|
|
22
|
+
const { defaultLocale, currentLocale, locales } = useL10nConfig();
|
|
23
23
|
const { translate } = useTranslate();
|
|
24
24
|
const activeVersion = versions.find((version) => version.active);
|
|
25
25
|
const {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { L10nConfig } from '@redocly/theme/core/types';
|
|
2
2
|
|
|
3
3
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
4
4
|
import { getPathnameForLocale, withPathPrefix } from '@redocly/theme/core/utils';
|
|
5
5
|
|
|
6
6
|
export function useLanguagePicker(): {
|
|
7
|
-
currentLocale:
|
|
8
|
-
locales:
|
|
7
|
+
currentLocale: L10nConfig['locales'][number] | undefined;
|
|
8
|
+
locales: L10nConfig['locales'];
|
|
9
9
|
setLocale: (value: string) => void;
|
|
10
10
|
} {
|
|
11
|
-
const {
|
|
11
|
+
const { useL10nConfig, usePreloadHistory } = useThemeHooks();
|
|
12
12
|
const history = usePreloadHistory();
|
|
13
|
-
const { currentLocale, locales, defaultLocale } =
|
|
13
|
+
const { currentLocale, locales, defaultLocale } = useL10nConfig();
|
|
14
14
|
|
|
15
15
|
const locale = locales.find((l) => l.code === currentLocale);
|
|
16
16
|
|
package/src/core/types/hooks.ts
CHANGED
|
@@ -15,10 +15,20 @@ import type {
|
|
|
15
15
|
|
|
16
16
|
export type ThemeHooks = {
|
|
17
17
|
useTranslate: () => { translate: TFunction };
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated use `useL10n` instead
|
|
20
|
+
* */
|
|
18
21
|
useI18n: () => {
|
|
19
22
|
changeLanguage: (lng?: string | undefined, callback?: Callback | undefined) => Promise<TFunc>;
|
|
20
23
|
};
|
|
21
|
-
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated use `useL10nConfig` instead
|
|
26
|
+
* */
|
|
27
|
+
useI18nConfig: () => L10nConfig;
|
|
28
|
+
useL10n: () => {
|
|
29
|
+
changeLanguage: (lng?: string | undefined, callback?: Callback | undefined) => Promise<TFunc>;
|
|
30
|
+
};
|
|
31
|
+
useL10nConfig: () => L10nConfig;
|
|
22
32
|
useCurrentProduct: () => ProductUiConfig | undefined;
|
|
23
33
|
useProducts: () => ProductUiConfig[];
|
|
24
34
|
usePageVersions: () => {
|
|
@@ -66,7 +76,7 @@ export type ThemeHooks = {
|
|
|
66
76
|
usePageProps: <T extends Record<string, unknown>>() => PageProps & T;
|
|
67
77
|
};
|
|
68
78
|
|
|
69
|
-
export type
|
|
79
|
+
export type L10nConfig = {
|
|
70
80
|
currentLocale: string;
|
|
71
81
|
defaultLocale: string;
|
|
72
82
|
locales: { code: string; name: string }[];
|
package/src/core/types/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@redocly/theme/core/types/breadcrumb';
|
|
2
2
|
export * from '@redocly/theme/core/types/catalog';
|
|
3
|
-
export * from '@redocly/theme/core/types/
|
|
3
|
+
export * from '@redocly/theme/core/types/l10n';
|
|
4
4
|
export * from '@redocly/theme/core/types/feedback';
|
|
5
5
|
export * from '@redocly/theme/core/types/hooks';
|
|
6
6
|
export * from '@redocly/theme/core/types/markdown';
|
|
@@ -0,0 +1,26 @@
|
|
|
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 xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="none" {...props}>
|
|
10
|
+
<g>
|
|
11
|
+
<path d="M7 0.875C3.5875 0.875 0.875 3.5875 0.875 7C0.875 10.4125 3.5875 13.125 7 13.125C10.4125 13.125 13.125 10.4125 13.125 7C13.125 3.5875 10.4125 0.875 7 0.875ZM7 12.25C4.1125 12.25 1.75 9.8875 1.75 7C1.75 4.1125 4.1125 1.75 7 1.75C9.8875 1.75 12.25 4.1125 12.25 7C12.25 9.8875 9.8875 12.25 7 12.25Z" />
|
|
12
|
+
<path d="M9.3625 10.0625L7 7.7L4.6375 10.0625L3.9375 9.3625L6.3 7L3.9375 4.6375L4.6375 3.9375L7 6.3L9.3625 3.9375L10.0625 4.6375L7.7 7L10.0625 9.3625L9.3625 10.0625Z" />
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const CloseOutlineIcon = styled(Icon).attrs(() => ({
|
|
18
|
+
'data-component-name': 'icons/CloseOutlineIcon/CloseOutlineIcon',
|
|
19
|
+
}))<IconProps>`
|
|
20
|
+
path {
|
|
21
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
22
|
+
}
|
|
23
|
+
height: ${({ size }) => size || '16px'};
|
|
24
|
+
width: ${({ size }) => size || '16px'};
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
`;
|
|
@@ -0,0 +1,24 @@
|
|
|
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" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path d="M15 11.9999H13V9.99993H12V11.9999H10V12.9999H12V14.9999H13V12.9999H15V11.9999Z" />
|
|
11
|
+
<path d="M8 13.9999H4V1.99993H8V4.99993C8.00077 5.26491 8.10637 5.51882 8.29374 5.70619C8.48111 5.89356 8.73502 5.99916 9 5.99993H12V7.99993H13V4.99993C13.0018 4.93421 12.9893 4.86889 12.9634 4.80847C12.9375 4.74804 12.8988 4.69395 12.85 4.64993L9.35 1.14993C9.30599 1.10109 9.2519 1.06239 9.19147 1.03649C9.13104 1.01059 9.06572 0.99812 9 0.999928H4C3.73502 1.00069 3.48111 1.1063 3.29374 1.29367C3.10637 1.48104 3.00077 1.73495 3 1.99993V13.9999C3.00077 14.2649 3.10637 14.5188 3.29374 14.7062C3.48111 14.8936 3.73502 14.9992 4 14.9999H8V13.9999ZM9 2.19993L11.8 4.99993H9V2.19993Z" />
|
|
12
|
+
</svg>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const DocumentAddIcon = styled(Icon).attrs(() => ({
|
|
16
|
+
'data-component-name': 'icons/DocumentAddIcon/DocumentAddIcon',
|
|
17
|
+
}))<IconProps>`
|
|
18
|
+
path {
|
|
19
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
height: ${({ size }) => size || '16px'};
|
|
23
|
+
width: ${({ size }) => size || '16px'};
|
|
24
|
+
`;
|
|
@@ -0,0 +1,24 @@
|
|
|
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" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path d="M13 12V14H3V12H2V14L2.0038 13.9976C2.00333 14.1288 2.02873 14.2589 2.07854 14.3803C2.12836 14.5017 2.20163 14.6121 2.29414 14.7052C2.38666 14.7983 2.49662 14.8723 2.61774 14.9229C2.73885 14.9734 2.86875 14.9997 3 15H13C13.2652 15 13.5196 14.8946 13.7071 14.7071C13.8946 14.5196 14 14.2652 14 14V12H13Z" />
|
|
11
|
+
<path d="M3 6L3.7055 6.7025L7.5 2.9125V12H8.5V2.9125L12.2955 6.7025L13 6L8 1L3 6Z" />
|
|
12
|
+
</svg>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const ExportIcon = styled(Icon).attrs(() => ({
|
|
16
|
+
'data-component-name': 'icons/ExportIcon/ExportIcon',
|
|
17
|
+
}))<IconProps>`
|
|
18
|
+
path {
|
|
19
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
height: ${({ size }) => size || '16px'};
|
|
23
|
+
width: ${({ size }) => size || '16px'};
|
|
24
|
+
`;
|
|
@@ -0,0 +1,23 @@
|
|
|
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 xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" fill="none" {...props}>
|
|
10
|
+
<path d="M4.88688 2.625L6.38313 4.11688L6.63688 4.375H12.25V11.375H1.75V2.625H4.88688ZM4.88688 1.75H1.75C1.51794 1.75 1.29538 1.84219 1.13128 2.00628C0.967187 2.17038 0.875 2.39294 0.875 2.625V11.375C0.875 11.6071 0.967187 11.8296 1.13128 11.9937C1.29538 12.1578 1.51794 12.25 1.75 12.25H12.25C12.4821 12.25 12.7046 12.1578 12.8687 11.9937C13.0328 11.8296 13.125 11.6071 13.125 11.375V4.375C13.125 4.14294 13.0328 3.92038 12.8687 3.75628C12.7046 3.59219 12.4821 3.5 12.25 3.5H7L5.50813 2.00813C5.42672 1.92624 5.32992 1.86127 5.2233 1.81697C5.11667 1.77267 5.00234 1.74991 4.88688 1.75Z" />
|
|
11
|
+
</svg>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const FolderIcon = styled(Icon).attrs(() => ({
|
|
15
|
+
'data-component-name': 'icons/FolderIcon/FolderIcon',
|
|
16
|
+
}))<IconProps>`
|
|
17
|
+
path {
|
|
18
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
height: ${({ size }) => size || '16px'};
|
|
22
|
+
width: ${({ size }) => size || '16px'};
|
|
23
|
+
`;
|
package/src/index.ts
CHANGED
|
@@ -147,9 +147,11 @@ export * from '@redocly/theme/icons/CleanIcon/CleanIcon';
|
|
|
147
147
|
export * from '@redocly/theme/icons/DeselectIcon/DeselectIcon';
|
|
148
148
|
export * from '@redocly/theme/icons/FileStorageIcon/FileStorageIcon';
|
|
149
149
|
export * from '@redocly/theme/icons/FolderAddIcon/FolderAddIcon';
|
|
150
|
+
export * from '@redocly/theme/icons/FolderIcon/FolderIcon';
|
|
150
151
|
export * from '@redocly/theme/icons/FolderMoveToIcon/FolderMoveToIcon';
|
|
151
152
|
export * from '@redocly/theme/icons/SelectIcon/SelectIcon';
|
|
152
153
|
export * from '@redocly/theme/icons/CloseIcon/CloseIcon';
|
|
154
|
+
export * from '@redocly/theme/icons/CloseOutlineIcon/CloseOutlineIcon';
|
|
153
155
|
export * from '@redocly/theme/icons/CloseFilledIcon/CloseFilledIcon';
|
|
154
156
|
export * from '@redocly/theme/icons/LogoutIcon/LogoutIcon';
|
|
155
157
|
export * from '@redocly/theme/icons/CheckboxIcon/CheckboxIcon';
|
|
@@ -160,6 +162,7 @@ export * from '@redocly/theme/icons/DataFormatIcon/DataFormatIcon';
|
|
|
160
162
|
export * from '@redocly/theme/icons/Spinner/Spinner';
|
|
161
163
|
export * from '@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon';
|
|
162
164
|
export * from '@redocly/theme/icons/DownloadIcon/DownloadIcon';
|
|
165
|
+
export * from '@redocly/theme/icons/DocumentAddIcon/DocumentAddIcon';
|
|
163
166
|
export * from '@redocly/theme/icons/EmailIcon/EmailIcon';
|
|
164
167
|
export * from '@redocly/theme/icons/SaveIcon/SaveIcon';
|
|
165
168
|
export * from '@redocly/theme/icons/CloudUploadIcon/CloudUploadIcon';
|
|
@@ -222,6 +225,7 @@ export * from '@redocly/theme/icons/SubtractIcon/SubtractIcon';
|
|
|
222
225
|
export * from '@redocly/theme/icons/PlusCustomIcon/PlusCustomIcon';
|
|
223
226
|
export * from '@redocly/theme/icons/CharacterIcon/CharacterIcon';
|
|
224
227
|
export * from '@redocly/theme/icons/FileIcon/FileIcon';
|
|
228
|
+
export * from '@redocly/theme/icons/ExportIcon/ExportIcon';
|
|
225
229
|
/* Layouts */
|
|
226
230
|
export * from '@redocly/theme/layouts/RootLayout';
|
|
227
231
|
export * from '@redocly/theme/layouts/PageLayout';
|
|
File without changes
|
|
File without changes
|